mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
refactor(util): COMMANDS_GUILD_ID constant arg order (#440)
* fmt * refactor(util): change arg order for COMMANDS_GUILD_ID * refactor(handlers): change arg order for COMMANDS_GUILD_ID * feat(handlers): add getSlashCommand function * Update mod.ts * remove that
This commit is contained in:
@@ -116,6 +116,7 @@ import {
|
||||
editWebhookMessage,
|
||||
executeSlashCommand,
|
||||
executeWebhook,
|
||||
getSlashCommand,
|
||||
getSlashCommands,
|
||||
getWebhook,
|
||||
upsertSlashCommand,
|
||||
@@ -237,6 +238,7 @@ export let handlers = {
|
||||
editWebhookMessage,
|
||||
deleteWebhookMessage,
|
||||
createSlashCommand,
|
||||
getSlashCommand,
|
||||
getSlashCommands,
|
||||
upsertSlashCommand,
|
||||
editSlashCommand,
|
||||
|
||||
@@ -20,10 +20,11 @@ import { botHasChannelPermissions } from "../../util/permissions.ts";
|
||||
import { urlToBase64 } from "../../util/utils.ts";
|
||||
import { structures } from "../structures/mod.ts";
|
||||
|
||||
/** Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations:
|
||||
*
|
||||
* Webhook names cannot be: 'clyde'
|
||||
*/
|
||||
/**
|
||||
* Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations:
|
||||
*
|
||||
* Webhook names cannot be: 'clyde'
|
||||
*/
|
||||
export async function createWebhook(
|
||||
channelID: string,
|
||||
options: WebhookCreateOptions,
|
||||
@@ -310,7 +311,7 @@ export function deleteSlashCommand(id: string, guildID?: string) {
|
||||
return RequestManager.delete(endpoints.COMMANDS_ID(applicationID, id));
|
||||
}
|
||||
return RequestManager.delete(
|
||||
endpoints.COMMANDS_GUILD_ID(applicationID, id, guildID),
|
||||
endpoints.COMMANDS_GUILD_ID(applicationID, guildID, id),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -339,7 +340,7 @@ export function executeSlashCommand(
|
||||
Date.now() + 900000,
|
||||
);
|
||||
|
||||
// IF NO MENTIONS ARE PROVIDED, FORCE DISABLE MENTIONS
|
||||
// If no mentions are provided, force disable mentions
|
||||
if (!(options.data.allowed_mentions)) {
|
||||
options.data.allowed_mentions = { parse: [] };
|
||||
}
|
||||
|
||||
@@ -143,8 +143,8 @@ export const endpoints = {
|
||||
`${baseEndpoints.BASE_URL}/applications/${applicationID}/commands/${commandID}`,
|
||||
COMMANDS_GUILD_ID: (
|
||||
applicationID: string,
|
||||
commandID: string,
|
||||
guildID: string,
|
||||
commandID: string,
|
||||
) =>
|
||||
`${baseEndpoints.BASE_URL}/applications/${applicationID}/guilds/${guildID}/commands/${commandID}`,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user