Skip to content

Commit

Permalink
Merge pull request #539 from Aazann/patch-1
Browse files Browse the repository at this point in the history
Update InteractionCreate.ts
  • Loading branch information
LucasB25 authored Apr 20, 2024
2 parents e1799b7 + a2dfe80 commit 39a4c96
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/events/client/InteractionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 39a4c96

Please sign in to comment.