From 2212cbd71111ac5abec38992e1705a0e23dcbfa2 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 6 Mar 2022 15:34:30 +0900 Subject: [PATCH 1/2] Create 8ball.ts --- 8ball Command/8ball.ts | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 8ball Command/8ball.ts diff --git a/8ball Command/8ball.ts b/8ball Command/8ball.ts new file mode 100644 index 0000000..8018175 --- /dev/null +++ b/8ball Command/8ball.ts @@ -0,0 +1,57 @@ +import { CommandContext } from '../../structures/addons/CommandAddons'; +import { Command } from '../../structures/Command'; +import { mainColor } from '../../handlers/locale'; + +class EightballCommand extends Command { + constructor() { + super({ + trigger: "8ball", + description: "Ask some questions to magic 8-ball!", + type: "ChatInput", + module: "utillities", + args: [ + { + trigger: 'question', + description: 'Put your question here.', + isLegacyFlag: false, + required: true, + type: 'String', + } + ] + }); + } + + async run(ctx: CommandContext) { + + const answers = ['It is certain.', 'Reply hazy, try again.', "Don't count on it.", 'It is decidedly so.', 'Ask again later.', 'My reply is no.', 'Without a doubt.', 'Better not tell you now.', 'My sources say no.', 'Yes - definitely.', 'Cannot predict now.', 'Outlook not so good.', 'You may rely on it.', 'Concentrate and ask again.', 'Very doubtful.', 'As I see it, yes.', 'Most likely.', 'Outlook good.', 'Yes.', 'Signs point to yes.', 'No.' + ]; + const result = Math.floor((Math.random() * answers.length)); + + return ctx.reply({ + embeds: [ + { + author: { + name: '🎱 Magic 8-ball', + }, + fields: [ + { + name: 'Question', + value: ctx.args['question'] + }, + { + name: 'Answer', + value: answers[result] + }, + ], + color: mainColor, + footer: { + text: ctx.user.tag, + iconURL: ctx.user.displayAvatarURL({ dynamic: true }) + } + } + ] + }) + } +} + +export default EightballCommand; From 18e039bd32d0f361e7cc1a4738da07133771d6c0 Mon Sep 17 00:00:00 2001 From: Oji0721 <90021248+Oji0721@users.noreply.github.com> Date: Sun, 6 Mar 2022 15:45:36 +0900 Subject: [PATCH 2/2] Create README.md --- 8ball Command/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 8ball Command/README.md diff --git a/8ball Command/README.md b/8ball Command/README.md new file mode 100644 index 0000000..37accb3 --- /dev/null +++ b/8ball Command/README.md @@ -0,0 +1,15 @@ +# 8ball Command +This plugin will add a magic 8 ball command. + +## Setup +* Copy the contents of the `8ball.ts` file into a new file with this path in your bot: `src/commands/information/8ball.ts`. + +* If you found some bug let me know it. + +## If you want to change the answers read this. +* To change/add answers go to `8ball.ts` then go to where it says `const answer = ` and in the [] you can change the answers. +* Template of adding them `['text1', 'text2', 'text3']` and etc. + +* I’m gessing you know this but where it says text here that is where you put your answers. + +Aurora_Jack#5330