mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
Update get_slash_commands.ts
This commit is contained in:
@@ -6,12 +6,12 @@ import { endpoints } from "../../util/constants.ts";
|
|||||||
|
|
||||||
/** Fetch all of the global commands for your application. */
|
/** Fetch all of the global commands for your application. */
|
||||||
export async function getSlashCommands(guildId?: string) {
|
export async function getSlashCommands(guildId?: string) {
|
||||||
const result = (await rest.runMethod(
|
const result = await rest.runMethod<ApplicationCommand[]>(
|
||||||
"get",
|
"get",
|
||||||
guildId
|
guildId
|
||||||
? endpoints.COMMANDS_GUILD(applicationId, guildId)
|
? endpoints.COMMANDS_GUILD(applicationId, guildId)
|
||||||
: endpoints.COMMANDS(applicationId),
|
: endpoints.COMMANDS(applicationId),
|
||||||
)) as ApplicationCommand[];
|
);
|
||||||
|
|
||||||
return new Collection(result.map((command) => [command.name, command]));
|
return new Collection(result.map((command) => [command.name, command]));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user