Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions 8ball Command/8ball.ts
Original file line number Diff line number Diff line change
@@ -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;
15 changes: 15 additions & 0 deletions 8ball Command/README.md
Original file line number Diff line number Diff line change
@@ -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