Support "hit" and "stand" in blackjack verification

This commit is contained in:
Dragon Fire
2020-04-11 09:39:10 -04:00
parent 2006e22029
commit 2159d3722d
5 changed files with 11 additions and 8 deletions
+3 -1
View File
@@ -3,6 +3,8 @@ const { stripIndents } = require('common-tags');
const { shuffle, verify } = require('../../util/Util');
const suits = ['♣', '♥', '♦', '♠'];
const faces = ['Jack', 'Queen', 'King'];
const hitWords = ['hit', 'hit me'];
const standWords = ['stand'];
module.exports = class BlackjackCommand extends Command {
constructor(client) {
@@ -62,7 +64,7 @@ module.exports = class BlackjackCommand extends Command {
_Hit?_
`);
const hit = await verify(msg.channel, msg.author);
const hit = await verify(msg.channel, msg.author, { otherYes: hitWords, otherNo: standWords });
if (hit) {
const card = this.draw(msg.channel, playerHand);
const total = this.calculate(playerHand);
+1 -1
View File
@@ -72,7 +72,7 @@ module.exports = class BoxChoosingCommand extends Command {
path += pick;
i = 0;
} else {
const verification = await verify(msg.channel, msg.author, 120000);
const verification = await verify(msg.channel, msg.author, { time: 120000 });
if (!verification) {
end = true;
break;
+1 -1
View File
@@ -66,7 +66,7 @@ module.exports = class HungerGamesCommand extends Command {
}
text += `\n\n_Proceed?_`;
await msg.say(text);
const verification = await verify(msg.channel, msg.author, 120000);
const verification = await verify(msg.channel, msg.author, { time: 120000 });
if (!verification) {
this.client.games.delete(msg.channel.id);
return msg.say('See you next time!');