Skip to content

Commit

Permalink
faster botban (this feature has never been used)
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Jun 27, 2024
1 parent 705d97a commit 1605a23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/events/interactionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
if (!interaction.inGuild()) return;

const banlist = await import("@json/botbans.json");
if (banlist.ids.indexOf(interaction.user.id) > -1) {
if (banlist.ids.includes(interaction.user.id)) {
// all interactions have the string() and reply() methods
return interaction.reply({
content: interaction.strings().error.botbanned,
Expand Down
5 changes: 3 additions & 2 deletions src/events/slashCommandUsed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export default {
try {
// try subcommand
if (command.execute instanceof Collection) {
const subCommand = interaction.options.getSubcommand();
await command.execute.get(subCommand)(interaction);
const subcommandName = interaction.options.getSubcommand();
const subcommand = command.execute.get(subcommandName);
await subcommand(interaction);
}
// regular command
else await command.execute(interaction);
Expand Down

0 comments on commit 1605a23

Please sign in to comment.