reupload commands every single time
This commit is contained in:
parent
d1377b538d
commit
acd576343b
2 changed files with 11 additions and 8 deletions
|
@ -2,9 +2,7 @@ import { SlashCommandBuilder, Routes, PermissionFlagsBits } from 'discord.js';
|
||||||
import { REST } from '@discordjs/rest';
|
import { REST } from '@discordjs/rest';
|
||||||
import { getTags } from './tagsTags';
|
import { getTags } from './tagsTags';
|
||||||
|
|
||||||
import 'dotenv/config';
|
export const reuploadCommands = async () => {
|
||||||
|
|
||||||
(async () => {
|
|
||||||
const tags = await getTags();
|
const tags = await getTags();
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
|
@ -55,7 +53,4 @@ import 'dotenv/config';
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('Successfully registered application commands.');
|
console.log('Successfully registered application commands.');
|
||||||
})().catch((e) => {
|
};
|
||||||
console.error(e);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
|
|
10
src/index.ts
10
src/index.ts
|
@ -12,6 +12,7 @@ import { tagsCommand } from './commands/tags';
|
||||||
import random from 'just-random';
|
import random from 'just-random';
|
||||||
import { green, bold, yellow } from 'kleur/colors';
|
import { green, bold, yellow } from 'kleur/colors';
|
||||||
import 'dotenv/config';
|
import 'dotenv/config';
|
||||||
|
import { reuploadCommands } from './_reupload';
|
||||||
|
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
intents: [
|
intents: [
|
||||||
|
@ -121,4 +122,11 @@ client.on('interactionCreate', async (interaction) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
client.login(process.env.DISCORD_TOKEN);
|
reuploadCommands()
|
||||||
|
.then(() => {
|
||||||
|
client.login(process.env.DISCORD_TOKEN);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.error(e);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue