Skip to content

Commit 9565c50

Browse files
committed
final release of deployCommands()
1 parent 570d652 commit 9565c50

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module.exports = class cDClient extends Client {
8686

8787
let rest;
8888
if (this.token) {
89-
rest = client.rest;
89+
rest = this.rest;
9090
} else {
9191
rest = new REST().setToken(token);
9292
}
@@ -98,10 +98,10 @@ module.exports = class cDClient extends Client {
9898
);
9999

100100
// TODO: Update it to client.application.commands and fetch
101-
let currentCommands = client.application.commands.cache;
101+
let currentCommands = this.application.commands.cache;
102102
if (!currentCommands)
103-
if (client) {
104-
currentCommands = await client.application.commands.fetch();
103+
if (this) {
104+
currentCommands = await this.application.commands.fetch();
105105
} else {
106106
currentCommands = await rest.get(
107107
`/applications/${clientId}/commands`
@@ -157,7 +157,7 @@ module.exports = class cDClient extends Client {
157157

158158
if (logUpdates)
159159
console.log(`🔁 Updating ${updated.length} global commands...`);
160-
data = await rest.put(`/applications/${client.id}/commands`, {
160+
data = await rest.put(`/applications/${clientId}/commands`, {
161161
body: updated,
162162
});
163163
if (logUpdates)
@@ -172,10 +172,10 @@ module.exports = class cDClient extends Client {
172172

173173
// TODO: Only do this, if the client is present so that no client is needed
174174
// Wait for the guilds to cache before continuing
175-
while (!client.guilds.cache.size) {
175+
while (!this.guilds.cache.size) {
176176
await new Promise((resolve) => setTimeout(resolve, 1000));
177177
}
178-
clientGuilds = client.guilds.cache;
178+
clientGuilds = this.guilds.cache;
179179

180180
if (logUpdates) console.log(`🔁 Updating guild commands...`);
181181
let updatedPrivates = 0;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "djs-command-deployer",
3-
"version": "0.5.4",
3+
"version": "0.6.0",
44
"description": "",
55
"main": "./index.js",
66
"scripts": {},

0 commit comments

Comments
 (0)