Refactor roleplay commands, bro-hoof, meme, remove face, add dotenv support

This commit is contained in:
Daniel Odendahl Jr
2018-08-28 22:26:58 +00:00
parent 5f81ce16c3
commit a4518c05ce
35 changed files with 349 additions and 287 deletions
+3 -12
View File
@@ -1,8 +1,7 @@
const request = require('node-superfetch');
const crypto = require('crypto');
const { IMGUR_KEY, SUCCESS_EMOJI_ID } = process.env;
const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea'];
const no = ['no', 'n', 'nah', 'nope'];
const { SUCCESS_EMOJI_ID } = process.env;
const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea', 'ya'];
const no = ['no', 'n', 'nah', 'nope', 'nop'];
module.exports = class Util {
static delay(ms) {
@@ -59,14 +58,6 @@ module.exports = class Util {
return crypto.createHash(algorithm).update(text).digest('hex');
}
static async randomFromImgurAlbum(album) {
const { body } = await request
.get(`https://api.imgur.com/3/album/${album}`)
.set({ Authorization: `Client-ID ${IMGUR_KEY}` });
if (!body.data.images.length) return null;
return body.data.images[Math.floor(Math.random() * body.data.images.length)].link;
}
static today(timeZone) {
const now = new Date();
if (timeZone) now.setUTCHours(now.getUTCHours() + timeZone);