mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
assign correct options
This commit is contained in:
@@ -17,7 +17,7 @@ import { snakelize, validateSlashCommands } from "../../../util/utils.ts";
|
||||
* Guild commands update **instantly**. We recommend you use guild commands for quick testing, and global commands when they're ready for public use.
|
||||
*/
|
||||
export async function createSlashCommand(options: CreateGlobalApplicationCommand, guildId?: bigint) {
|
||||
validateSlashCommands([options], true);
|
||||
[options] = validateSlashCommands([options], true) as CreateGlobalApplicationCommand[];
|
||||
|
||||
return await rest.runMethod<ApplicationCommand>(
|
||||
"post",
|
||||
|
||||
@@ -9,7 +9,7 @@ import { validateSlashCommands } from "../../../util/utils.ts";
|
||||
* Edit an existing slash command. If this command did not exist, it will create it.
|
||||
*/
|
||||
export async function upsertSlashCommand(commandId: bigint, options: EditGlobalApplicationCommand, guildId?: bigint) {
|
||||
validateSlashCommands([options]);
|
||||
[options] = validateSlashCommands([options]);
|
||||
|
||||
return await rest.runMethod<ApplicationCommand>(
|
||||
"patch",
|
||||
|
||||
@@ -11,7 +11,7 @@ import { validateSlashCommands } from "../../../util/utils.ts";
|
||||
* **NOTE:** Any slash commands that are not specified in this function will be **deleted**. If you don't provide the commandId and rename your command, the command gets a new Id.
|
||||
*/
|
||||
export async function upsertSlashCommands(options: EditGlobalApplicationCommand[], guildId?: bigint) {
|
||||
validateSlashCommands(options);
|
||||
options = validateSlashCommands(options);
|
||||
|
||||
return await rest.runMethod<ApplicationCommand[]>(
|
||||
"put",
|
||||
|
||||
Reference in New Issue
Block a user