Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
v2.1.0
  • Loading branch information
0xDevansh authored Oct 9, 2022
2 parents e46574b + 0699f51 commit f0a5a80
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/core/commands/syncCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,19 @@ export const syncCommands = async (client: Client): Promise<void> => {

application.client.logMethod('Successfully synced commands', 'verbose');
};

/**
* Force-syncs all global slash commands
*
* @param {Client} client The bot's client
*/
export const syncAllGlobalCommands = async (client: Client): Promise<void> => {
const application = client.application?.partial ? await client.application?.fetch() : client.application;
if (!application) throw new Error('Client application not found');

// sync global commands
const global = client.commands.get('global');
if (global) {
await application.commands.set(global);
}
};

0 comments on commit f0a5a80

Please sign in to comment.