🧑💻 Fixed some code smells
This commit is contained in:
parent
1d04890c92
commit
038b8070f9
1 changed files with 12 additions and 6 deletions
|
@ -1,6 +1,5 @@
|
||||||
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
|
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
import { ChatInputCommandInteraction } from "discord.js";
|
||||||
|
|
||||||
import modules from "./modules";
|
import modules from "./modules";
|
||||||
|
|
||||||
export const moduleData = modules;
|
export const moduleData = modules;
|
||||||
|
@ -19,14 +18,21 @@ export const builder = (group: SlashCommandSubcommandGroupBuilder) => {
|
||||||
export const execute = async (interaction: ChatInputCommandInteraction) => {
|
export const execute = async (interaction: ChatInputCommandInteraction) => {
|
||||||
switch (interaction.options.getSubcommand()) {
|
switch (interaction.options.getSubcommand()) {
|
||||||
case "give":
|
case "give":
|
||||||
return modules.give.execute(interaction);
|
await modules.give.execute(interaction);
|
||||||
|
break;
|
||||||
case "set":
|
case "set":
|
||||||
return modules.set.execute(interaction);
|
await modules.set.execute(interaction);
|
||||||
|
break;
|
||||||
case "take":
|
case "take":
|
||||||
return modules.take.execute(interaction);
|
await modules.take.execute(interaction);
|
||||||
|
break;
|
||||||
case "transfer":
|
case "transfer":
|
||||||
return modules.transfer.execute(interaction);
|
await modules.transfer.execute(interaction);
|
||||||
|
break;
|
||||||
case "giveaway":
|
case "giveaway":
|
||||||
return modules.giveaway.execute(interaction);
|
await modules.giveaway.execute(interaction);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error("No module found for that specific command");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue