From 938590a2136c732f52937cab0ce697dd7ec27117 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 31 Jan 2021 18:28:23 -0500 Subject: [PATCH] feat: doubt command --- src/commands/Fun/doubt.ts | 23 +++++++++++++++++++++++ src/languages/en-US.ts | 3 +++ src/lib/types/Languages.d.ts | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 src/commands/Fun/doubt.ts diff --git a/src/commands/Fun/doubt.ts b/src/commands/Fun/doubt.ts new file mode 100644 index 0000000..f502b8a --- /dev/null +++ b/src/commands/Fun/doubt.ts @@ -0,0 +1,23 @@ +import { CommandOptions, KlasaMessage } from 'klasa'; +import { SteveCommand } from '@lib/structures/commands/SteveCommand'; +import { Message, MessageReaction } from 'discord.js'; +import { ApplyOptions } from '@skyra/decorators'; + +@ApplyOptions({ + aliases: ['x'], + description: lang => lang.tget('commandDoubtDescription'), + extendedHelp: lang => lang.tget('commandDoubtExtended') +}) +export default class extends SteveCommand { + + public async run(msg: KlasaMessage): Promise { + if (!msg.reference?.messageID) return msg.channel.send(msg.language.tget('commandDoubtExtended')); + + const targetMessage = msg.channel.messages.cache.get(msg.reference.messageID); + + if (!targetMessage) return msg.channel.send(msg.language.tget('commandDoubtFail')); + + return targetMessage.react('805574339651043378'); + } + +} diff --git a/src/languages/en-US.ts b/src/languages/en-US.ts index 8c8ea1a..a4af1d2 100644 --- a/src/languages/en-US.ts +++ b/src/languages/en-US.ts @@ -458,6 +458,9 @@ export default class extends Language { extendedHelp: 'The ability to search for a relevant XKCD is coming soon!' }), commandXkcdInvalid: 'I was unable to find that XKCD.', + commandDoubtDescription: 'React to a message with <:x2doubt:805574339651043378>.', + commandDoubtExtended: 'This command must be used when replying to a message.', + commandDoubtFail: 'Something went wrong and I couldn\'t find that message.', /** * ################################ * # MODERATION SYSTEM # diff --git a/src/lib/types/Languages.d.ts b/src/lib/types/Languages.d.ts index e844358..93d4ae7 100644 --- a/src/lib/types/Languages.d.ts +++ b/src/lib/types/Languages.d.ts @@ -194,6 +194,9 @@ declare module 'klasa' { commandXkcdDescription: string; commandXkcdExtended: string; commandXkcdInvalid: string; + commandDoubtDescription: string; + commandDoubtExtended: string; + commandDoubtFail: string; moderationNoDuration: string; moderationNoReason: string; moderationNoSteve: string;