feat: sendPrivateInteractionResponse helper (#2096)

This commit is contained in:
Yuzu
2022-03-12 05:34:33 +00:00
committed by GitHub
parent 7e69f29217
commit fc779bf6d0
2 changed files with 8 additions and 0 deletions

View File

@@ -123,6 +123,7 @@ export * from "./src/getMembersPaginated.ts";
export * from "./src/moveMember.ts";
export * from "./src/sendAutoCompleteChoices.ts";
export * from "./src/sendDirectMessage.ts";
export * from "./src/sendPrivateInteractionResponse.ts";
export * from "./src/suppressEmbeds.ts";
export * from "./src/threads.ts";
export default enableHelpersPlugin;

View File

@@ -0,0 +1,7 @@
import type { Bot, DiscordenoInteractionResponse, DiscordenoMessage } from "../deps.ts";
/** sendInteractionResponse with ephemeral reply */
export function sendPrivateInteractionResponse(bot: Bot, id: bigint, token: string, options: DiscordenoInteractionResponse): Promise<DiscordenoMessage | undefined> {
if (options.data && !options.data?.flags) options.data.flags = 64; // private: true
return bot.helpers.sendInteractionResponse(id, token, options);
}