.
This commit is contained in:
parent
583f70e7b7
commit
0f03a53c8f
26
_clear-commands.js
Normal file
26
_clear-commands.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// 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, clientId } = 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);
|
||||||
|
}
|
||||||
|
})();
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"isDev": true,
|
"isDev": false,
|
||||||
"clientId": "858181619721175050",
|
"clientId": "858181619721175050",
|
||||||
"guildId": "760701839427108874",
|
"guildId": "760701839427108874",
|
||||||
"devChannelId": "890752931643654144",
|
"devChannelId": "890752931643654144",
|
||||||
|
1
main.js
1
main.js
@ -26,6 +26,7 @@ const { MessageActionRow, MessageButton } = require('discord.js');
|
|||||||
const fn = require('./functions.js');
|
const fn = require('./functions.js');
|
||||||
const config = require('./config.json');
|
const config = require('./config.json');
|
||||||
const strings = require('./strings.json');
|
const strings = require('./strings.json');
|
||||||
|
config.isDev = process.env.isDev;
|
||||||
|
|
||||||
client.once('ready', () => {
|
client.once('ready', () => {
|
||||||
fn.collections.slashCommands(client);
|
fn.collections.slashCommands(client);
|
||||||
|
Loading…
Reference in New Issue
Block a user