feat(handlers/webhook): support ephemeral messages (#602)

Co-authored-by: ayntee <ayyantee@gmail.com>
This commit is contained in:
Skillz4Killz
2021-03-06 13:59:45 -05:00
committed by GitHub
parent 33ff8cd752
commit e5bf5cd47c
2 changed files with 14 additions and 3 deletions
+7 -2
View File
@@ -6,10 +6,10 @@ import {
EditSlashResponseOptions,
EditWebhookMessageOptions,
Errors,
ExecuteSlashCommandOptions,
ExecuteWebhookOptions,
MessageCreateOptions,
SlashCommand,
SlashCommandResponseOptions,
UpsertSlashCommandOptions,
UpsertSlashCommandsOptions,
WebhookCreateOptions,
@@ -448,7 +448,7 @@ export function deleteSlashCommand(id: string, guildID?: string) {
export async function executeSlashCommand(
id: string,
token: string,
options: ExecuteSlashCommandOptions,
options: SlashCommandResponseOptions,
) {
// If its already been executed, we need to send a followup response
if (cache.executedSlashCommands.has(token)) {
@@ -464,6 +464,11 @@ export async function executeSlashCommand(
900000,
);
// If the user wants this as a private message mark it ephemeral
if (options.private) {
options.data.flags = 64;
}
// If no mentions are provided, force disable mentions
if (!(options.data.allowed_mentions)) {
options.data.allowed_mentions = { parse: [] };