chore: remove stale button handler
This commit is contained in:
parent
ff664c5f04
commit
a4d326bb26
1 changed files with 0 additions and 16 deletions
16
src/index.ts
16
src/index.ts
|
@ -98,22 +98,6 @@ client.once('ready', async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('interactionCreate', async (interaction) => {
|
client.on('interactionCreate', async (interaction) => {
|
||||||
if (interaction.isButton() && interaction.customId === 'delete-message') {
|
|
||||||
const messageRef = interaction.message.reference?.messageId;
|
|
||||||
if (messageRef) {
|
|
||||||
const msg = await interaction.message.channel.messages.fetch(messageRef);
|
|
||||||
|
|
||||||
if (interaction?.user === msg.author) {
|
|
||||||
await interaction.message.delete();
|
|
||||||
} else {
|
|
||||||
await interaction.reply({
|
|
||||||
content: 'You can only delete your own messages!',
|
|
||||||
ephemeral: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interaction.isChatInputCommand()) {
|
if (interaction.isChatInputCommand()) {
|
||||||
const { commandName } = interaction;
|
const { commandName } = interaction;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue