From 715a0ff35ca9bc1625ef441be0bb595dbf5165e2 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sun, 10 Jun 2018 01:37:29 +0000 Subject: [PATCH] DECTalk broke :( --- commands/voice/dec-talk.js | 57 -------------------------------------- package.json | 4 +-- 2 files changed, 2 insertions(+), 59 deletions(-) delete mode 100644 commands/voice/dec-talk.js diff --git a/commands/voice/dec-talk.js b/commands/voice/dec-talk.js deleted file mode 100644 index b5df918c..00000000 --- a/commands/voice/dec-talk.js +++ /dev/null @@ -1,57 +0,0 @@ -const Command = require('../../structures/Command'); -const request = require('node-superfetch'); - -module.exports = class DECTalkCommand extends Command { - constructor(client) { - super(client, { - name: 'dec-talk', - aliases: ['moon-base-alpha', 'text-to-speech', 'tts'], - group: 'voice', - memberName: 'dec-talk', - description: 'The world\'s best Text-to-Speech.', - guildOnly: true, - throttling: { - usages: 1, - duration: 10 - }, - args: [ - { - key: 'text', - prompt: 'What text do you want to say?', - type: 'string', - max: 1000 - } - ] - }); - } - - async run(msg, { text }) { - const channel = msg.member.voiceChannel; - if (!channel) return msg.say('Please enter a voice channel first.'); - if (!channel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) { - return msg.say('Missing the "Connect" or "Speak" permission for the voice channel.'); - } - if (!channel.joinable) return msg.say('Your voice channel is not joinable.'); - if (this.client.voiceConnections.has(channel.guild.id)) return msg.say('I am already playing a sound.'); - try { - const connection = await channel.join(); - let url = 'http://tts.cyzon.us'; - try { - await request - .get('http://tts.cyzon.us/tts') - .query({ text }) - .redirects(0); - } catch (err) { - if (err.headers.location) url += err.headers.location; - else throw err; - } - const dispatcher = connection.play(url); - dispatcher.once('finish', () => channel.leave()); - dispatcher.once('error', () => channel.leave()); - return null; - } catch (err) { - channel.leave(); - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/package.json b/package.json index 94eeb254..33293f31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "79.0.1", + "version": "80.0.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { @@ -39,7 +39,7 @@ "erlpack": "github:discordapp/erlpack", "mathjs": "^4.4.2", "node-opus": "^0.3.0", - "node-superfetch": "github:dragonfire535/node-superfetch", + "node-superfetch": "^0.0.4", "pg": "^6.4.2", "pg-hstore": "^2.3.2", "random-js": "^1.0.8",