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)