fix a error

This commit is contained in:
IThundxr 2023-03-27 20:45:08 -04:00
parent 3ad8fab217
commit dcd1d82999
No known key found for this signature in database
GPG key ID: 1A6215040459750E

View file

@ -99,6 +99,7 @@ client.once('ready', async () => {
client.on('interactionCreate', async (interaction) => {
if (interaction.isButton() && interaction.customId === 'delete-message') {
try {
const messageRef = interaction.message.reference?.messageId;
if (messageRef) {
const msg = await interaction.message.channel.messages.fetch(messageRef);
@ -113,6 +114,11 @@ client.on('interactionCreate', async (interaction) => {
}
}
}
catch (e) {
console.error(e);
interaction.reply({ content: 'Something went wrong!', ephemeral: true})
}
}
if (interaction.isChatInputCommand()) {
const { commandName } = interaction;