From 2347762ecccb48a9fbd54a1c88b138d41ced3329 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 1 Aug 2023 10:58:27 +1000 Subject: [PATCH] guild ID no longer hardcoded --- bot/deploy.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bot/deploy.js b/bot/deploy.js index 920de24..027642a 100644 --- a/bot/deploy.js +++ b/bot/deploy.js @@ -2,11 +2,17 @@ const { REST, Routes } = require('discord.js'); const { clientId, token } = require('../botconfig.json'); -const guildId = '413591792185769984'; const read = require('fs-readdir-recursive'); const commands = []; 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) { const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/'))); commands.push({