Skip to content

Commit 4dd3b8c

Browse files
committed
added built-in function to test creating a command
1 parent 21a4076 commit 4dd3b8c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,14 @@ class cDClient extends Client {
155155
console.log("rest", rest);
156156
console.log("token", rest.token);
157157
for (let cmd of _new) {
158-
data = await rest.post(`/applications/${clientId}/commands`, {
159-
body: cmd,
160-
});
158+
// The `cmd` variable is 100% correct - checked it
159+
// Using built-in
160+
data = await this.application.commands.create(cmd);
161+
162+
// Using REST
163+
// data = await rest.post(`/applications/${clientId}/commands`, {
164+
// body: cmd,
165+
// });
161166
if (logOptions.created)
162167
console.log(`✔️ Created '${data.name}'`);
163168
}

0 commit comments

Comments
 (0)