From 2b7253ffae763bba51c27ae93f0d25dd9ca01e35 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 10 Jun 2022 22:28:28 -0400 Subject: [PATCH] Moving OTSs back to root --- One-Time Scripts/_clear-commands.js | 27 ------------------- One-Time Scripts/_deploy-commands.js | 40 ---------------------------- One-Time Scripts/_deploy_global.js | 40 ---------------------------- 3 files changed, 107 deletions(-) delete mode 100644 One-Time Scripts/_clear-commands.js delete mode 100644 One-Time Scripts/_deploy-commands.js delete mode 100644 One-Time Scripts/_deploy_global.js diff --git a/One-Time Scripts/_clear-commands.js b/One-Time Scripts/_clear-commands.js deleted file mode 100644 index 869c90d..0000000 --- a/One-Time Scripts/_clear-commands.js +++ /dev/null @@ -1,27 +0,0 @@ -// dotenv for handling environment variables -const dotenv = require('dotenv'); -dotenv.config(); - -const { REST } = require('@discordjs/rest'); -const { Routes } = require('discord-api-types/v9'); -const clientId = process.env.clientId; -const { guildId } = require('../config.json'); -const token = process.env.TOKEN; - -const rest = new REST({ version: '9' }).setToken(token); - -(async () => { - try { - console.log('Started refreshing application (/) commands.'); - - await rest.put( - Routes.applicationGuildCommands(clientId, guildId), - { body: '' }, - ); - - console.log('Successfully reloaded application (/) commands.'); - process.exit(); - } catch (error) { - console.error(error); - } -})(); \ No newline at end of file diff --git a/One-Time Scripts/_deploy-commands.js b/One-Time Scripts/_deploy-commands.js deleted file mode 100644 index 5ba21ce..0000000 --- a/One-Time Scripts/_deploy-commands.js +++ /dev/null @@ -1,40 +0,0 @@ -// dotenv for handling environment variables -const dotenv = require('dotenv'); -dotenv.config(); - -const { REST } = require('@discordjs/rest'); -const { Routes } = require('discord-api-types/v9'); -const { guildId } = require('./config.json'); -const clientId = process.env.clientId; -const token = process.env.TOKEN; -const fs = require('fs'); - -const commands = []; -const commandFiles = fs.readdirSync('./slash-commands').filter(file => file.endsWith('.js')); - -for (const file of commandFiles) { - const command = require(`./slash-commands/${file}`); - if (command.data != undefined) { - commands.push(command.data.toJSON()); - } -} - -console.log(commands); - -const rest = new REST({ version: '9' }).setToken(token); - -(async () => { - try { - console.log('Started refreshing application (/) commands.'); - - await rest.put( - Routes.applicationGuildCommands(clientId, guildId), - { body: commands }, - ); - - console.log('Successfully reloaded application (/) commands.'); - process.exit(); - } catch (error) { - console.error(error); - } -})(); \ No newline at end of file diff --git a/One-Time Scripts/_deploy_global.js b/One-Time Scripts/_deploy_global.js deleted file mode 100644 index 6152f49..0000000 --- a/One-Time Scripts/_deploy_global.js +++ /dev/null @@ -1,40 +0,0 @@ -// dotenv for handling environment variables -const dotenv = require('dotenv'); -dotenv.config(); - -const { REST } = require('@discordjs/rest'); -const { Routes } = require('discord-api-types/v9'); -const { guildId } = require('./config.json'); -const clientId = process.env.clientId; -const token = process.env.TOKEN; -const fs = require('fs'); - -const commands = []; -const commandFiles = fs.readdirSync('./slash-commands').filter(file => file.endsWith('.js')); - -for (const file of commandFiles) { - const command = require(`./slash-commands/${file}`); - if (command.data != undefined) { - commands.push(command.data.toJSON()); - } -} - -console.log(commands); - -const rest = new REST({ version: '9' }).setToken(token); - -(async () => { - try { - console.log('Started refreshing application (/) commands.'); - - await rest.put( - Routes.applicationGuildCommands(clientId), - { body: commands }, - ); - - console.log('Successfully reloaded application (/) commands.'); - process.exit(); - } catch (error) { - console.error(error); - } -})(); \ No newline at end of file