diff --git a/commands/text-edit/dec-talk.js b/commands/text-edit/dec-talk.js index 0c4b7e41..bee3a329 100644 --- a/commands/text-edit/dec-talk.js +++ b/commands/text-edit/dec-talk.js @@ -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 { diff --git a/package.json b/package.json index 232cb7d4..859e542b 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/util/Util.js b/util/Util.js index f2d3deaf..1b9bbbbf 100644 --- a/util/Util.js +++ b/util/Util.js @@ -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) {