Skip to content

Commit a10ed40

Browse files
committed
fixed rest refenrece before initialization and commandsPath variable
1 parent d35ae87 commit a10ed40

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,16 @@ module.exports.deployCommands = async function deployCommands(
6565
console.log(`🔁 Started refreshing global and guild commands.`);
6666

6767
try {
68+
const rest = new REST().setToken(opts.token);
69+
6870
const currentCommands = await rest.get(Routes.commands(clientId));
6971
let currentMap = new Map();
7072
currentCommands.forEach((cmd) => {
7173
currentMap.set(cmd.name, cmd);
7274
});
7375

7476
for (const file of commandFiles) {
75-
const filePath = path.join(commandsPath, file);
77+
const filePath = path.join(filePath, file);
7678
const command = require(filePath);
7779
if (!("data" in command)) {
7880
console.error(
@@ -95,8 +97,6 @@ module.exports.deployCommands = async function deployCommands(
9597
}
9698
}
9799

98-
const rest = new REST().setToken(opts.token);
99-
100100
let data;
101101

102102
data = await rest.put(Routes.commands(clientId), { body: commands });

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-helper",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "A simple, easy to use module that houses functions to can refresh global and guild specific commands for your Discord App.",
55
"main": "./index.js",
66
"scripts": { },

0 commit comments

Comments
 (0)