mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 00:07:36 +02:00
Multiple Words
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
|
const words = ['fire', 'draw', 'shoot', 'bang', 'pull'];
|
||||||
|
|
||||||
module.exports = class GunfightCommand extends Command {
|
module.exports = class GunfightCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -40,8 +41,9 @@ module.exports = class GunfightCommand extends Command {
|
|||||||
await msg.say('Get Ready...');
|
await msg.say('Get Ready...');
|
||||||
const length = Math.floor(Math.random() * (30000 - 1000 + 1) + 1000);
|
const length = Math.floor(Math.random() * (30000 - 1000 + 1) + 1000);
|
||||||
this.client.setTimeout(async () => {
|
this.client.setTimeout(async () => {
|
||||||
await msg.say('TYPE `FIRE` NOW!');
|
const word = words[Math.floor(Math.random() * words.length)];
|
||||||
const filter = (res) => [opponent.id, msg.author.id].includes(res.author.id) && res.content.toLowerCase() === 'fire'; // eslint-disable-line max-len
|
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, {
|
const winner = await msg.channel.awaitMessages(filter, {
|
||||||
max: 1,
|
max: 1,
|
||||||
time: 30000
|
time: 30000
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "27.3.0",
|
"version": "27.3.1",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user