Multiple Words

This commit is contained in:
Daniel Odendahl Jr
2017-07-15 17:04:27 +00:00
parent 8f00bce00b
commit f6afb27cf4
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -1,4 +1,5 @@
const Command = require('../../structures/Command');
const words = ['fire', 'draw', 'shoot', 'bang', 'pull'];
module.exports = class GunfightCommand extends Command {
constructor(client) {
@@ -40,8 +41,9 @@ module.exports = class GunfightCommand extends Command {
await msg.say('Get Ready...');
const length = Math.floor(Math.random() * (30000 - 1000 + 1) + 1000);
this.client.setTimeout(async () => {
await msg.say('TYPE `FIRE` NOW!');
const filter = (res) => [opponent.id, msg.author.id].includes(res.author.id) && res.content.toLowerCase() === 'fire'; // eslint-disable-line max-len
const word = words[Math.floor(Math.random() * words.length)];
await msg.say(`TYPE \`${word.toUpperCase()}\` NOW!`);
const filter = (res) => [opponent.id, msg.author.id].includes(res.author.id) && res.content.toLowerCase() === word; // eslint-disable-line max-len
const winner = await msg.channel.awaitMessages(filter, {
max: 1,
time: 30000
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "27.3.0",
"version": "27.3.1",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {