summaryrefslogtreecommitdiff
path: root/src/sys/handler/builder.ts
diff options
context:
space:
mode:
authorMatthieuCoder <matthieu@matthieu-dev.xyz>2023-01-05 01:40:50 +0400
committerMatthieuCoder <matthieu@matthieu-dev.xyz>2023-01-05 01:40:50 +0400
commit3fd9efd18867cdf7452e7d0b3cbc3f33d508e699 (patch)
tree7117e4cc69affee70c7b933590cca55c3ddcd21a /src/sys/handler/builder.ts
parent9337745c2771aff4a9ec8250fd13021a929fef97 (diff)
documentation and internals overhaul
Diffstat (limited to 'src/sys/handler/builder.ts')
-rw-r--r--src/sys/handler/builder.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sys/handler/builder.ts b/src/sys/handler/builder.ts
new file mode 100644
index 0000000..feb5780
--- /dev/null
+++ b/src/sys/handler/builder.ts
@@ -0,0 +1,22 @@
+import { SlashCommandBuilder } from "@discordjs/builders";
+import { Command, HandlerFn } from ".";
+
+/**
+ * Simple wrapper around the SlashCommandBuilder provided by Discord.js
+ */
+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 };
+ }
+}