diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-01 17:04:06 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-01 17:04:06 -0500 |
commit | 34fa8e02539b300312103a27d965a3b2de557ae9 (patch) | |
tree | ae2d83a6473b3de941e96dd19f9b5f70e75d5fcd /src/commands | |
parent | 342b01c7f51dbe8beef1d3deb37822080ed6097f (diff) | |
download | tanzanite-34fa8e02539b300312103a27d965a3b2de557ae9.tar.gz tanzanite-34fa8e02539b300312103a27d965a3b2de557ae9.tar.bz2 tanzanite-34fa8e02539b300312103a27d965a3b2de557ae9.zip |
idk why this didn't get committed
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/fun/coinFlip.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/commands/fun/coinFlip.ts b/src/commands/fun/coinFlip.ts new file mode 100644 index 0000000..b0805cd --- /dev/null +++ b/src/commands/fun/coinFlip.ts @@ -0,0 +1,26 @@ +import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; + +export default class CoinFlipCommand extends BushCommand { + public constructor() { + super('coinFlip', { + aliases: ['coin-flip', 'cf'], + category: 'fun', + description: 'Flip a virtual coin.', + usage: ['coinflip'], + examples: ['coinflip'], + clientPermissions: (m) => util.clientSendAndPermCheck(m), + userPermissions: [], + slash: true + }); + } + + public override async exec(message: BushMessage | BushSlashMessage) { + const random = Math.random(); + let result: string; + const fall = message.author.id === '322862723090219008' ? 0.1 : 0.001; //dw about it + if (random < fall) result = 'The coin fell off the table :('; + else if (random <= 0.5 + fall / 2) result = 'Heads'; + else result = 'Tails'; + await message.util.reply(result); + } +} |