From a2dfe808672015b78777ca0718ce92383b94bf4a Mon Sep 17 00:00:00 2001 From: Aazan <118600828+Aazann@users.noreply.github.com> Date: Sat, 20 Apr 2024 12:00:30 +0530 Subject: [PATCH] Update InteractionCreate.ts Removed Usage of Slash Command for Setup Channel Signed-off-by: Aazan <118600828+Aazann@users.noreply.github.com> --- src/events/client/InteractionCreate.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/events/client/InteractionCreate.ts b/src/events/client/InteractionCreate.ts index 512b02201..a550898cb 100644 --- a/src/events/client/InteractionCreate.ts +++ b/src/events/client/InteractionCreate.ts @@ -22,6 +22,13 @@ export default class InteractionCreate extends Event { interaction instanceof CommandInteraction && interaction.type === InteractionType.ApplicationCommand ) { + const setup = await this.client.db.getSetup(interaction.guildId); + if ( + setup && + interaction.channelId === setup.textId + ) { +return interaction.reply({ content: `You can't use commands in setup channel.` , ephemeral: true}) + } const { commandName } = interaction; await this.client.db.get(interaction.guildId); // get or create guild data const command = this.client.commands.get(interaction.commandName);