fix: add Escalate button to email ticket welcome embed

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.
This commit is contained in:
2026-04-21 19:50:11 +00:00
parent 2a04e3964c
commit 410f8b043e

View File

@@ -3,9 +3,7 @@
*/ */
const { const {
ChannelType, ChannelType,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
EmbedBuilder EmbedBuilder
} = require('discord.js'); } = require('discord.js');
const { mongoose, withRetry } = require('./db-connection'); 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 { getNextTicketNumber, checkTicketLimits, getOrCreateTicketCategory, toDiscordSafeName, getSenderLocal } = require('./services/tickets');
const { logError, logGmail, logAutomation } = require('./services/debugLog'); const { logError, logGmail, logAutomation } = require('./services/debugLog');
const { enqueueSend } = require('./services/channelQueue'); const { enqueueSend } = require('./services/channelQueue');
const { getTicketActionRow } = require('./utils/ticketComponents');
const Ticket = mongoose.model('Ticket'); const Ticket = mongoose.model('Ticket');
const Transcript = mongoose.model('Transcript'); const Transcript = mongoose.model('Transcript');
@@ -230,18 +229,7 @@ async function poll(client) {
? GAME_NAME_TO_KEY[detectedGame] || null ? GAME_NAME_TO_KEY[detectedGame] || null
: null; : null;
const buttons = new ActionRowBuilder().addComponents( const buttons = getTicketActionRow({ escalationTier: 0 });
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 ticketInfoEmbed = new EmbedBuilder() const ticketInfoEmbed = new EmbedBuilder()
.setColor(CONFIG.EMBED_COLOR_INFO) .setColor(CONFIG.EMBED_COLOR_INFO)