From eba5679806c7f7aefbc8ec5ea5cf0d67625313f7 Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 17 Mar 2021 15:28:44 +0400 Subject: [PATCH] refactor(helpers): rename executeSlashCommand to sendInteractionResponse (#676) --- ...xecute_slash_command.ts => send_interaction_response.ts} | 2 +- src/helpers/mod.ts | 6 +++--- src/interactions/types/slash.ts | 2 +- src/types/webhook.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) rename src/helpers/commands/{execute_slash_command.ts => send_interaction_response.ts} (96%) diff --git a/src/helpers/commands/execute_slash_command.ts b/src/helpers/commands/send_interaction_response.ts similarity index 96% rename from src/helpers/commands/execute_slash_command.ts rename to src/helpers/commands/send_interaction_response.ts index 42a652214..35567dced 100644 --- a/src/helpers/commands/execute_slash_command.ts +++ b/src/helpers/commands/send_interaction_response.ts @@ -10,7 +10,7 @@ import { endpoints } from "../../util/constants.ts"; * * NOTE: By default we will suppress mentions. To enable mentions, just pass any mentions object. */ -export async function executeSlashCommand( +export async function sendInteractionResponse( id: string, token: string, options: SlashCommandResponseOptions, diff --git a/src/helpers/mod.ts b/src/helpers/mod.ts index 0f06ff11d..e65c9c8ea 100644 --- a/src/helpers/mod.ts +++ b/src/helpers/mod.ts @@ -17,9 +17,9 @@ import { createSlashCommand } from "./commands/create_slash_command.ts"; import { deleteSlashCommand } from "./commands/delete_slash_command.ts"; import { deleteSlashResponse } from "./commands/delete_slash_response.ts"; import { editSlashResponse } from "./commands/edit_slash_response.ts"; -import { executeSlashCommand } from "./commands/execute_slash_command.ts"; import { getSlashCommand } from "./commands/get_slash_command.ts"; import { getSlashCommands } from "./commands/get_slash_commands.ts"; +import { sendInteractionResponse } from "./commands/send_interaction_response.ts"; import { upsertSlashCommand } from "./commands/upsert_slash_command.ts"; import { upsertSlashCommands } from "./commands/upsert_slash_commands.ts"; import { createEmoji } from "./emojis/create_emoji.ts"; @@ -168,7 +168,6 @@ export { editWebhookWithToken, editWidget, emojiURL, - executeSlashCommand, executeWebhook, fetchMembers, followChannel, @@ -229,6 +228,7 @@ export { removeRole, removeUserReaction, sendDirectMessage, + sendInteractionResponse, sendMessage, startTyping, swapChannels, @@ -264,7 +264,7 @@ export let helpers = { deleteSlashCommand, deleteSlashResponse, editSlashResponse, - executeSlashCommand, + sendInteractionResponse, getSlashCommand, getSlashCommands, upsertSlashCommand, diff --git a/src/interactions/types/slash.ts b/src/interactions/types/slash.ts index b466b6bbd..aab5632ff 100644 --- a/src/interactions/types/slash.ts +++ b/src/interactions/types/slash.ts @@ -70,7 +70,7 @@ export interface EditSlashCommandOptions { guildID?: string; } -export interface ExecuteSlashCommandOptions { +export interface SendInteractionResponseOptions { type: InteractionResponseType; data: SlashCommandCallbackData; } diff --git a/src/types/webhook.ts b/src/types/webhook.ts index 21e6a99cb..6e4aaecfd 100644 --- a/src/types/webhook.ts +++ b/src/types/webhook.ts @@ -215,13 +215,13 @@ export interface EditSlashCommandOptions { options?: SlashCommandOption[]; } -export interface ExecuteSlashCommandOptions { +export interface SendInteractionResponseOptions { type: InteractionResponseType; data: SlashCommandCallbackData; } export interface SlashCommandResponseOptions - extends ExecuteSlashCommandOptions { + extends SendInteractionResponseOptions { /** Whether to make this response visible ONLY to the user who used this command. It will also be deleted after some time. */ private?: boolean; }