fix a error
This commit is contained in:
parent
3ad8fab217
commit
dcd1d82999
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue