Decrease tableflip delay

This commit is contained in:
Daniel Odendahl Jr
2018-07-01 02:07:40 +00:00
parent 5abe92b220
commit 65c6631354
6 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ module.exports = class AkinatorCommand extends Command {
async progress(channel, answer) { async progress(channel, answer) {
const session = this.sessions.get(channel.id); const session = this.sessions.get(channel.id);
const { body } = await request const { body } = await request
.get('http://192.99.38.142:8126/ws/answer') .get('http://158.69.225.49:8152/ws/answer')
.query({ .query({
session: session.id, session: session.id,
signature: session.signature, signature: session.signature,
@@ -111,7 +111,7 @@ module.exports = class AkinatorCommand extends Command {
async guess(channel) { async guess(channel) {
const session = this.sessions.get(channel.id); const session = this.sessions.get(channel.id);
const { body } = await request const { body } = await request
.get('http://192.99.38.142:8126/ws/list') .get('http://158.69.225.49:8152/ws/list')
.query({ .query({
session: session.id, session: session.id,
signature: session.signature, signature: session.signature,
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { wait, randomRange, verify } = require('../../util/Util'); const { delay, randomRange, verify } = require('../../util/Util');
const words = ['fire', 'draw', 'shoot', 'bang', 'pull']; const words = ['fire', 'draw', 'shoot', 'bang', 'pull'];
module.exports = class GunfightCommand extends Command { module.exports = class GunfightCommand extends Command {
@@ -36,7 +36,7 @@ module.exports = class GunfightCommand extends Command {
return msg.say('Looks like they declined...'); return msg.say('Looks like they declined...');
} }
await msg.say('Get Ready...'); await msg.say('Get Ready...');
await wait(randomRange(1000, 30000)); await delay(randomRange(1000, 30000));
const word = words[Math.floor(Math.random() * words.length)]; const word = words[Math.floor(Math.random() * words.length)];
await msg.say(`TYPE \`${word.toUpperCase()}\` NOW!`); await msg.say(`TYPE \`${word.toUpperCase()}\` NOW!`);
const filter = res => [opponent.id, msg.author.id].includes(res.author.id) && res.content.toLowerCase() === word; const filter = res => [opponent.id, msg.author.id].includes(res.author.id) && res.content.toLowerCase() === word;
+2 -2
View File
@@ -1,6 +1,6 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const request = require('node-superfetch'); const request = require('node-superfetch');
const { wait } = require('../../util/Util'); const { delay } = require('../../util/Util');
module.exports = class IllegalCommand extends Command { module.exports = class IllegalCommand extends Command {
constructor(client) { constructor(client) {
@@ -52,7 +52,7 @@ module.exports = class IllegalCommand extends Command {
task: 'gif', task: 'gif',
word: text word: text
}); });
await wait(5000); await delay(5000);
return body; return body;
} }
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { wait } = require('../../util/Util'); const { delay } = require('../../util/Util');
const frames = [ const frames = [
'(-°□°)- ┬─┬', '(-°□°)- ┬─┬',
'(╯°□°)╯ ]', '(╯°□°)╯ ]',
@@ -22,7 +22,7 @@ module.exports = class TableflipCommand extends Command {
async run(msg) { async run(msg) {
const message = await msg.say('(\\\\°□°)\\\\ ┬─┬'); const message = await msg.say('(\\\\°□°)\\\\ ┬─┬');
for (const frame of frames) { for (const frame of frames) {
await wait(300); await delay(200);
await message.edit(frame); await message.edit(frame);
} }
return message; return message;
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiao", "name": "xiao",
"version": "80.1.0", "version": "80.1.1",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Xiao.js", "main": "Xiao.js",
"scripts": { "scripts": {
+1 -1
View File
@@ -5,7 +5,7 @@ const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea'];
const no = ['no', 'n', 'nah', 'nope']; const no = ['no', 'n', 'nah', 'nope'];
class Util { class Util {
static wait(ms) { static delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms)); return new Promise(resolve => setTimeout(resolve, ms));
} }