This commit is contained in:
The Foxon 2023-06-28 04:32:19 +12:00
parent 3d36346a4e
commit ec68b87738

View File

@ -16,14 +16,16 @@ export default function updateCommands(config: ConfigManager) {
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN); const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN);
(async () => { (async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`); console.log(`Started refreshing ${commands.length} application (/) commands.`);
try {
await rest.put( await rest.put(
Routes.applicationCommands(String(process.env.CLIENT_ID)), Routes.applicationCommands(String(process.env.CLIENT_ID)),
{ body: [] }, { body: [] },
); );
} catch (e) { }
try {
const data: any = await rest.put( const data: any = await rest.put(
Routes.applicationGuildCommands(String(process.env.CLIENT_ID), String(process.env.GUILD_ID)), Routes.applicationGuildCommands(String(process.env.CLIENT_ID), String(process.env.GUILD_ID)),
{ body: commands }, { body: commands },