Update upsert_slash_command.ts

This commit is contained in:
ITOH
2021-04-23 23:31:37 +02:00
parent 653e608d0e
commit 7ee20b0b3e
+2 -3
View File
@@ -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;
}