mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
types(ApplicationCommandManager): add missing overload for fetch (#6904)
This commit is contained in:
@@ -105,6 +105,12 @@ const guildCommandId = '234567890123456789'; // example id
|
||||
client.on('ready', async () => {
|
||||
console.log(`Client is logged in as ${client.user!.tag} and ready!`);
|
||||
|
||||
// Test fetching all global commands and ones from one guild
|
||||
assertType<Collection<string, ApplicationCommand>>(await client.application!.commands.fetch());
|
||||
assertType<Collection<string, ApplicationCommand>>(
|
||||
await client.application!.commands.fetch({ guildId: testGuildId }),
|
||||
);
|
||||
|
||||
// Test command manager methods
|
||||
const globalCommand = await client.application?.commands.fetch(globalCommandId);
|
||||
const guildCommandFromGlobal = await client.application?.commands.fetch(guildCommandId, { guildId: testGuildId });
|
||||
|
||||
Reference in New Issue
Block a user