Skip to content

Commit 963556a

Browse files
author
Akhil Pillai
authored
Update index.ts
1 parent ee83870 commit 963556a

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/index.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,20 @@ client
179179
.on(Events.ClientReady, () => logger.info('Client#ready'))
180180
.on(Events.InteractionCreate, async interaction => {
181181
if (interaction.user.bot) return;
182-
const blacklisted = (await db.get<Snowflake[]>([DatabaseKeys.Blacklist]))
183-
?.value;
184-
if (
185-
(blacklisted ?? []).includes(interaction.user.id) &&
186-
interaction.isCommand()
187-
) {
188-
await interaction.reply({
189-
content: 'You are blacklisted from using this bot.',
190-
ephemeral: true
191-
});
192-
return;
193-
}
182+
try {
183+
const blacklisted = (await db.get<Snowflake[]>([DatabaseKeys.Blacklist]))?.value;
184+
if (
185+
(blacklisted ?? []).includes(interaction.user.id) &&
186+
interaction.isCommand()
187+
) {
188+
await interaction.reply({
189+
content: 'You are blacklisted from using this bot.',
190+
ephemeral: true
191+
});
192+
return;
193+
}
194+
} catch (e) { logger.error(e); }
195+
194196
if (interaction.isChatInputCommand()) {
195197
const command = client.commands.get(interaction.commandName);
196198
if (!command) {

0 commit comments

Comments
 (0)