Don't need tsubaki if I can just make it myself

This commit is contained in:
Daniel Odendahl Jr
2017-10-23 20:39:56 +00:00
parent cf23f22318
commit 984f8f473c
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
const { Command } = require('discord.js-commando');
const snekfetch = require('snekfetch');
const path = require('path');
const { promisifyAll } = require('tsubaki');
const { promisifyAll } = require('../../util/Util');
const fs = promisifyAll(require('fs'));
module.exports = class DECTalkCommand extends Command {
+1 -2
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "49.3.1",
"version": "49.3.2",
"description": "Your personal server companion.",
"main": "XiaoBot.js",
"scripts": {
@@ -39,7 +39,6 @@
"erlpack": "github:discordapp/erlpack",
"node-opus": "^0.2.7",
"snekfetch": "^3.5.5",
"tsubaki": "^1.2.0",
"uws": "^8.14.1",
"xml-js": "^1.5.1"
},
+8
View File
@@ -48,6 +48,14 @@ class Util {
return `${prefix.slice(text.length)}${text}`;
}
static promisifyAll(obj, suffix = 'Async') {
for (const key of Object.keys(obj)) {
if (typeof obj[key] !== 'function') continue;
obj[`${key}${suffix}`] = promisify(obj[key]);
}
return obj;
}
static greyscale(ctx, x, y, width, height) {
const data = ctx.getImageData(x, y, width, height);
for (let i = 0; i < data.data.length; i += 4) {