-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommandHandler.js
More file actions
27 lines (24 loc) · 876 Bytes
/
commandHandler.js
File metadata and controls
27 lines (24 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pingInteractionHandler from './commands/ping.js';
import helpInteractionHandler from './commands/help.js';
import imagineInteractionHandler from './commands/imagine.js';
import settingsInteractionHandler from './commands/settings.js';
async function commandHandler(interaction) {
if (!interaction.isChatInputCommand()) return;
switch (interaction.commandName) {
case "imagine":
imagineInteractionHandler(interaction);
break;
case "ping":
pingInteractionHandler(interaction);
break;
case "help":
helpInteractionHandler(interaction);
break;
case 'settings':
settingsInteractionHandler(interaction);
break;
default:
await interaction.reply({ content: 'Command Not Found' });
}
}
export default commandHandler;