From d7be838434420091185792f294ab24aea839301a Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 16 May 2021 22:15:19 -0400 Subject: [PATCH] Trebek is dead :( --- commands/voice/trebek.js | 67 ---------------------------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 commands/voice/trebek.js diff --git a/commands/voice/trebek.js b/commands/voice/trebek.js deleted file mode 100644 index 57b5c02c..00000000 --- a/commands/voice/trebek.js +++ /dev/null @@ -1,67 +0,0 @@ -const Command = require('../../structures/Command'); -const request = require('node-superfetch'); -const { Readable } = require('stream'); -const { reactIfAble } = require('../../util/Util'); -const { LOADING_EMOJI_ID } = process.env; - -module.exports = class TrebekCommand extends Command { - constructor(client) { - super(client, { - name: 'trebek', - aliases: ['alex-trebek'], - group: 'voice', - memberName: 'trebek', - description: 'Speak text like Alex Trebek.', - guildOnly: true, - throttling: { - usages: 2, - duration: 30 - }, - userPermissions: ['CONNECT', 'SPEAK'], - credit: [ - { - name: 'Uberduck', - url: 'https://uberduck.ai/', - reason: 'API', - reasonURL: 'https://uberduck.ai/#voice=trebek' - } - ], - args: [ - { - key: 'speech', - label: 'text', - prompt: 'What text do you want to say?', - type: 'string', - max: 500 - } - ] - }); - } - - async run(msg, { speech }) { - const connection = this.client.voice.connections.get(msg.guild.id); - if (!connection) { - const usage = this.client.registry.commands.get('join').usage(); - return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`); - } - if (this.client.dispatchers.has(msg.guild.id)) return msg.reply('I am already playing audio in this server.'); - try { - await reactIfAble(msg, this.client.user, LOADING_EMOJI_ID, '💬'); - const { text } = await request - .post('https://api.uberduck.ai/speak') - .send({ - voice: 'trebek', - speech - }); - const dispatcher = connection.play(Readable.from([Buffer.from(text, 'base64')])); - this.client.dispatchers.set(msg.guild.id, dispatcher); - dispatcher.once('finish', () => this.client.dispatchers.delete(msg.guild.id)); - dispatcher.once('error', () => this.client.dispatchers.delete(msg.guild.id)); - await reactIfAble(msg, this.client.user, '🔉'); - return null; - } catch (err) { - await reactIfAble(msg, this.client.user, '⚠️'); - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/package.json b/package.json index 44ae3384..770f4081 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "139.6.1", + "version": "140.0.0", "description": "Your personal server companion.", "main": "Xiao.js", "private": true,