guild ID no longer hardcoded
This commit is contained in:
parent
75b9d712af
commit
2347762ecc
1 changed files with 7 additions and 1 deletions
|
@ -2,11 +2,17 @@
|
||||||
|
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
const { clientId, token } = require('../botconfig.json');
|
const { clientId, token } = require('../botconfig.json');
|
||||||
const guildId = '413591792185769984';
|
|
||||||
const read = require('fs-readdir-recursive');
|
const read = require('fs-readdir-recursive');
|
||||||
const commands = [];
|
const commands = [];
|
||||||
const commandFiles = read('./commands').filter(file => file.endsWith('.js'));
|
const commandFiles = read('./commands').filter(file => file.endsWith('.js'));
|
||||||
|
|
||||||
|
if (process.argv.length === 2) {
|
||||||
|
console.log('No guild ID provided, deployment failed.');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const guildId = process.argv[2];
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/')));
|
const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/')));
|
||||||
commands.push({
|
commands.push({
|
||||||
|
|
Loading…
Reference in a new issue