summaryrefslogtreecommitdiff
path: root/src/handler/builder.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/handler/builder.ts')
-rw-r--r--src/handler/builder.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/handler/builder.ts b/src/handler/builder.ts
new file mode 100644
index 0000000..148542a
--- /dev/null
+++ b/src/handler/builder.ts
@@ -0,0 +1,19 @@
+import { SlashCommandBuilder } from "@discordjs/builders";
+import { Command, HandlerFn } from ".";
+
+export class CommandBuilder extends SlashCommandBuilder {
+ private _handler: HandlerFn;
+
+ constructor() {
+ super();
+ }
+
+ handler(handler: HandlerFn): this {
+ this._handler = handler;
+ return this;
+ }
+
+ build(): Command {
+ return { json: this.toJSON(), handler: this._handler };
+ }
+}