Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Akhil Pillai authored Dec 10, 2024
1 parent ee83870 commit 963556a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,20 @@ client
.on(Events.ClientReady, () => logger.info('Client#ready'))
.on(Events.InteractionCreate, async interaction => {
if (interaction.user.bot) return;
const blacklisted = (await db.get<Snowflake[]>([DatabaseKeys.Blacklist]))
?.value;
if (
(blacklisted ?? []).includes(interaction.user.id) &&
interaction.isCommand()
) {
await interaction.reply({
content: 'You are blacklisted from using this bot.',
ephemeral: true
});
return;
}
try {
const blacklisted = (await db.get<Snowflake[]>([DatabaseKeys.Blacklist]))?.value;
if (
(blacklisted ?? []).includes(interaction.user.id) &&
interaction.isCommand()
) {
await interaction.reply({
content: 'You are blacklisted from using this bot.',
ephemeral: true
});
return;
}
} catch (e) { logger.error(e); }

if (interaction.isChatInputCommand()) {
const command = client.commands.get(interaction.commandName);
if (!command) {
Expand Down

0 comments on commit 963556a

Please sign in to comment.