UNPKG

@jadl/cmd

Version:
21 lines (20 loc) 750 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Thinks = void 0; const v9_1 = require("discord-api-types/v9"); const Decorators_1 = require("../../utils/Decorators"); exports.Thinks = Decorators_1.Decorators.createCommandDecorator(([ephemeral], cmd) => { cmd.onRun.push(async (int, { worker }) => { int.responded = true; const body = { type: v9_1.InteractionResponseType.DeferredChannelMessageWithSource }; if (ephemeral === true) body.data = { flags: v9_1.MessageFlags.Ephemeral }; await worker.api.post(`/interactions/${int.id}/${int.token}/callback`, { body }); }); });