summaryrefslogtreecommitdiff
path: root/src/commands/fun/drawcards.ts
diff options
context:
space:
mode:
author8cy <[email protected]>2020-07-23 23:24:17 -0700
committer8cy <[email protected]>2020-07-23 23:24:17 -0700
commitbb511abc03bb66848947e37a999502b813c77269 (patch)
tree612c010fc8317e1cdf11471a18aad0270819d33e /src/commands/fun/drawcards.ts
parentfix: if clear amount equal or over 100, round down to 99 (diff)
downloaddep-core-bb511abc03bb66848947e37a999502b813c77269.tar.xz
dep-core-bb511abc03bb66848947e37a999502b813c77269.zip
goodbye old uwufier :cry:
Diffstat (limited to 'src/commands/fun/drawcards.ts')
-rw-r--r--src/commands/fun/drawcards.ts61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/commands/fun/drawcards.ts b/src/commands/fun/drawcards.ts
deleted file mode 100644
index 5d53b72..0000000
--- a/src/commands/fun/drawcards.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import { shuffle } from '../../utils/Util.js'
-const suits = ['♣', '♥', '♦', '♠']
-const faces = ['Jack', 'Queen', 'King']
-
-module.exports = class DrawCardsFun extends Command {
- constructor(client) {
- super(client, {
- name: 'drawcards',
- aliases: [
- 'draw-cards',
- 'drawhand',
- 'draw-hand'
- ],
- group: 'fun',
- memberName: 'drawcards',
- description: 'Draw a hand of playing cards.',
- examples: ['uwu!drawcards 5'],
- throttling: {
- usages: 5,
- duration: 30
- },
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- args: [
- {
- key: 'aAmount',
- label: 'hand size',
- prompt: 'How many cards would you like to draw?',
- type: 'integer',
- max: 10,
- min: 1
- },
- {
- key: 'aJokers',
- prompt: 'Do you want to include jokers in the draw?',
- type: 'boolean',
- default: false
- }
- ],
- });
- this.deck = null
- }
- run(msg: CommandoMessage, { aAmount, aJokers }) {
- if (!this.deck) this.deck = this.generateDeck()
- let cards = this.deck
- if (!aJokers) cards = cards.filter(card => !card.includes('Joker'))
- return msg.reply(`${aAmount === 1 ? '' : '\n'}${shuffle(cards).slice(0, aAmount).join('\n')}`)
- }
- generateDeck() {
- const deck = []
- for (const suit of suits) {
- deck.push(`${suit} Ace`)
- for (let i = 2; i <= 10; i++) deck.push(`${suit} ${i}`)
- for (const face of faces) deck.push(`${suit} ${face}`)
- }
- deck.push('⭐ Joker')
- deck.push('⭐ Joker')
- return deck
- }
-}; \ No newline at end of file