From ed14ccefca4541d5ad7991c61f7c8225490ca26b Mon Sep 17 00:00:00 2001 From: Keanu Date: Thu, 13 Aug 2020 20:58:41 +0200 Subject: [PATCH] Added 8ball command to fun. --- src/commands/fun.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++ src/commands/info.ts | 6 +----- 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 src/commands/fun.ts diff --git a/src/commands/fun.ts b/src/commands/fun.ts new file mode 100644 index 0000000..6932a6d --- /dev/null +++ b/src/commands/fun.ts @@ -0,0 +1,48 @@ +import Command from "../core/command"; +import {CommonLibrary} from "../core/lib"; + +const responses = [ + "Most likely,", + "It is certain,", + "It is decidedly so,", + "Without a doubt,", + "Definitely,", + "You may rely on it,", + "As I see it, yes,", + "Outlook good,", + "Yes,", + "Signs point to yes,", + "Reply hazy, try again,", + "Ask again later,", + "Better not tell you now,", + "Cannot predict now,", + "Concentrate and ask again,", + "Don't count on it,", + "My reply is no,", + "My sources say no,", + "Outlook not so good,", + "Very doubtful," +]; + +export default new Command({ + description: "Fun commands.", + endpoint: false, + run: "Please provide an argument.\nFor help, run `.help fun`.", + subcommands: + { + "8ball": new Command({ + description: "Answers your question in an 8-ball manner.", + endpoint: false, + usage: "", + run: "Please provide a question.", + any: new Command({ + description: "Question to ask the 8 Ball.", + async run($: CommonLibrary): Promise + { + const sender = $.message.author; + $.channel.send(responses[Math.floor(Math.random() * responses.length)] + ` <@${sender.id}>`); + } + }) + }) + } +}); \ No newline at end of file diff --git a/src/commands/info.ts b/src/commands/info.ts index c858009..739c8ad 100644 --- a/src/commands/info.ts +++ b/src/commands/info.ts @@ -6,11 +6,7 @@ import { verificationLevels, filterLevels, regions, flags } from "../defs/info"; export default new Command({ description: "Command to provide all sorts of info about the current server, a user, etc.", - async run($: CommonLibrary): Promise - { - $.channel.send("Please provide an argument. `.help info`") - console.log(verificationLevels); - }, + run: "Please provide an argument.\nFor help, run `.help info`.", subcommands: { avatar: new Command({