mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
Update upsert_slash_command.ts
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { applicationId } from "../../bot.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { EditGlobalApplicationCommand } from "../../types/interactions/edit_global_application_command.ts";
|
||||
import { ApplicationCommand } from "../../types/mod.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { validateSlashCommands } from "../../util/utils.ts";
|
||||
|
||||
@@ -14,13 +15,11 @@ export async function upsertSlashCommand(
|
||||
) {
|
||||
validateSlashCommands([options]);
|
||||
|
||||
const result = await rest.runMethod(
|
||||
return await rest.runMethod<ApplicationCommand>(
|
||||
"patch",
|
||||
guildId
|
||||
? endpoints.COMMANDS_GUILD_ID(applicationId, guildId, commandId)
|
||||
: endpoints.COMMANDS_ID(applicationId, commandId),
|
||||
options,
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user