summaryrefslogtreecommitdiff
path: root/src/handler/builder.ts
diff options
context:
space:
mode:
authorMatthieuCoder <matthieu@matthieu-dev.xyz>2023-01-03 14:21:17 +0400
committerMatthieuCoder <matthieu@matthieu-dev.xyz>2023-01-03 14:21:17 +0400
commit80c28510bc446c255e15117ad206d41f5bc2b231 (patch)
treee8aa0bb740801be4a537053e96c02b50440089ea /src/handler/builder.ts
first commit
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 };
+ }
+}