From 410f8b043e74ee57678fc9851aa83850a76b8ef8 Mon Sep 17 00:00:00 2001 From: indifferentketchup Date: Tue, 21 Apr 2026 19:50:11 +0000 Subject: [PATCH] fix: add Escalate button to email ticket welcome embed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gmail-poll.js was hand-rolling its own Close+Claim-only action row. Replaced with getTicketActionRow({ escalationTier: 0 }) — same helper panel-created tickets use. Email and Discord tickets now show identical buttons on creation: Close, Claim, Escalate. --- gmail-poll.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/gmail-poll.js b/gmail-poll.js index 04d529f..0cbeb09 100644 --- a/gmail-poll.js +++ b/gmail-poll.js @@ -3,9 +3,7 @@ */ const { ChannelType, - ActionRowBuilder, - ButtonBuilder, - ButtonStyle, + EmbedBuilder } = require('discord.js'); const { mongoose, withRetry } = require('./db-connection'); @@ -23,6 +21,7 @@ const { getGmailClient } = require('./services/gmail'); const { getNextTicketNumber, checkTicketLimits, getOrCreateTicketCategory, toDiscordSafeName, getSenderLocal } = require('./services/tickets'); const { logError, logGmail, logAutomation } = require('./services/debugLog'); const { enqueueSend } = require('./services/channelQueue'); +const { getTicketActionRow } = require('./utils/ticketComponents'); const Ticket = mongoose.model('Ticket'); const Transcript = mongoose.model('Transcript'); @@ -230,18 +229,7 @@ async function poll(client) { ? GAME_NAME_TO_KEY[detectedGame] || null : null; - const buttons = new ActionRowBuilder().addComponents( - new ButtonBuilder() - .setCustomId('close_ticket') - .setLabel(CONFIG.BUTTON_LABEL_CLOSE) - .setEmoji(CONFIG.BUTTON_EMOJI_CLOSE) - .setStyle(ButtonStyle.Secondary), - new ButtonBuilder() - .setCustomId('claim_ticket') - .setLabel(CONFIG.BUTTON_LABEL_CLAIM) - .setEmoji(CONFIG.BUTTON_EMOJI_CLAIM) - .setStyle(ButtonStyle.Secondary) - ); + const buttons = getTicketActionRow({ escalationTier: 0 }); const ticketInfoEmbed = new EmbedBuilder() .setColor(CONFIG.EMBED_COLOR_INFO)