fix/duplicated global commands in issue #8
This commit is contained in:
2 files changed
+2
-3
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayzr-bot",
|
"name": "dayzr-bot",
|
||||||
"version": "9.7.0",
|
"version": "9.7.1",
|
||||||
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ module.exports = {
|
|||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = require(`../commands/${file}`);
|
const command = require(`../commands/${file}`);
|
||||||
if (!commands.global) commands.push(command); // don't include global commands
|
if (!command.global) commands.push(command); // don't include global commands
|
||||||
}
|
}
|
||||||
|
|
||||||
const rest = new REST({ version: '10' }).setToken(client.config.Token);
|
const rest = new REST({ version: '10' }).setToken(client.config.Token);
|
||||||
@@ -43,7 +43,6 @@ module.exports = {
|
|||||||
const commands = [];
|
const commands = [];
|
||||||
const commandFiles = fs.readdirSync(path.join(__dirname, "..", "commands")).filter(file => file.endsWith('.js'));
|
const commandFiles = fs.readdirSync(path.join(__dirname, "..", "commands")).filter(file => file.endsWith('.js'));
|
||||||
|
|
||||||
// Place your client and guild ids here
|
|
||||||
const clientId = client.application.id;
|
const clientId = client.application.id;
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
|
|||||||
Reference in new issue
Block a user