From 7391135125ee1c9abcb142bc00f8d7b0df140254 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Sat, 18 Apr 2020 04:49:52 -0700 Subject: change case in 8ball + add coinflip, v7.1.2 --- src/commands/fun/coinflip.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/commands/fun/coinflip.ts (limited to 'src/commands/fun/coinflip.ts') diff --git a/src/commands/fun/coinflip.ts b/src/commands/fun/coinflip.ts new file mode 100644 index 0000000..e2c39bc --- /dev/null +++ b/src/commands/fun/coinflip.ts @@ -0,0 +1,31 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; + +module.exports = class CoinFlipFun extends Command { + constructor(client) { + super(client, { + name: 'coinflip', + aliases: ['flipcoin'], + group: 'fun', + memberName: 'coinflip', + description: 'Flip a coin.', + throttling: { + usages: 5, + duration: 30 + }, + examples: ['uwu!coinflip', 'uwu!flipcoin'], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] + }); + } + run(msg: CommandoMessage) { + var r = ['heads!', 'tails!']; + var s = r[Math.floor(Math.random() * r.length)]; + let embed = new MessageEmbed() + + .setAuthor('It\'s', 'https://upload.wikimedia.org/wikipedia/commons/3/33/Circle-icons-coin.svg') + .setDescription('`' + s + '`'); + + msg.channel.send(embed); + } +}; \ No newline at end of file -- cgit v1.2.3