UNPKG

@ayanaware/bentocord

Version:

Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.

45 lines 2.13 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReplyCommand = void 0; const bento_1 = require("@ayanaware/bento"); const CommandContext_1 = require("../../commands/CommandContext"); const CommandManager_1 = require("../../commands/CommandManager"); const OptionType_1 = require("../../commands/constants/OptionType"); const PromptManager_1 = require("../PromptManager"); class ReplyCommand { constructor() { this.name = '@ayanaware/bentocord:ReplyCommand'; this.parent = CommandManager_1.CommandManager; this.definition = { name: ['r', 'reply'], description: 'Reply to a pending prompt', options: [ { type: OptionType_1.OptionType.STRING, name: 'response', description: 'Response', rest: true }, ], }; } async execute(ctx, { response }) { if (ctx instanceof CommandContext_1.InteractionCommandContext) { try { await ctx.deleteExecutionMessage(); } catch { /* Failed */ } } return this.pm.handleResponse(ctx.channelId, ctx.userId, response); } } __decorate([ (0, bento_1.Inject)(), __metadata("design:type", PromptManager_1.PromptManager) ], ReplyCommand.prototype, "pm", void 0); exports.ReplyCommand = ReplyCommand; //# sourceMappingURL=Reply.js.map