-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.ts
34 lines (28 loc) · 914 Bytes
/
index.ts
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
28
29
30
31
32
33
34
import type {
SlashCommandBuilder,
ChatInputCommandInteraction,
ContextMenuCommandBuilder,
ContextMenuCommandInteraction,
SlashCommandOptionsOnlyBuilder,
} from "discord.js";
import { default as product_notes } from "./product/notes.js";
import { default as close } from "./util/close.js";
import { default as reopen } from "./util/reopen.js";
import { default as walkthrough } from "./util/walkthrough.js";
type AnyCommandBuilder =
| SlashCommandBuilder
| SlashCommandOptionsOnlyBuilder
| ContextMenuCommandBuilder;
type AnyInteraction =
| ChatInputCommandInteraction
| ContextMenuCommandInteraction;
const commandObject: {
[key: string]: {
data: AnyCommandBuilder;
execute: (interaction: AnyInteraction) => unknown;
};
} = {};
for (const command of [product_notes, close, reopen, walkthrough]) {
commandObject[command.data.name] = command;
}
export default commandObject;