types(ApplicationCommandManager): add missing overload for fetch (#6904)

This commit is contained in:
Vlad Frangu
2021-10-28 17:19:19 +03:00
committed by GitHub
parent 91a432e49d
commit ee93a27e15
2 changed files with 9 additions and 2 deletions

View File

@@ -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 });