djs-builder 0.6.7 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/handler/starter.js +8 -3
- package/package.json +1 -1
package/handler/starter.js
CHANGED
|
@@ -106,9 +106,11 @@ async function starter(client, options) {
|
|
|
106
106
|
.filter((cmd) => cmd.data && (typeof cmd.run === "function" || typeof cmd.execute === "function"));
|
|
107
107
|
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
client.slashCommands = new Map(validSlashCommands.map(cmd => [cmd.data.name, cmd]));
|
|
110
|
+
client.slashData = validSlashCommands.map(cmd => cmd.data.toJSON());
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
112
114
|
|
|
113
115
|
termenal.slash = validSlashCommands.length;
|
|
114
116
|
}
|
|
@@ -314,6 +316,9 @@ async function starter(client, options) {
|
|
|
314
316
|
|
|
315
317
|
client.once("ready", async () => {
|
|
316
318
|
if (ownerId) client.owner = await client.users.fetch(ownerId);
|
|
319
|
+
if (client.slashData?.length) {
|
|
320
|
+
await client.application.commands.set(client.slashData);
|
|
321
|
+
}
|
|
317
322
|
|
|
318
323
|
if (terminal_info) {
|
|
319
324
|
await terminalInfo(client, options, termenal);
|