diff --git a/README.md b/README.md index 9918bd87..3103464a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Xiao is a Discord bot coded in JavaScript with 7. Run `npm i -g pm2` to install PM2. 8. Run `pm2 start Xiao.js --name xiao` to run the bot. -## Commands (341) +## Commands (338) ### Utility: * **eval:** Executes JavaScript code. @@ -273,12 +273,6 @@ Xiao is a Discord bot coded in JavaScript with * **wizard-convention:** Who is the Dragon? Who is the healer? Who is the mind reader? Will the Dragon eat them all? * **word-chain:** Try to come up with words that start with the last letter of your opponent's word. -### Voice Channel: - -* **dec-talk:** The world's best Text-to-Speech. -* **leave-voice-channel:** Leaves a voice channel, in case the bot gets stuck. -* **soundboard:** Plays a sound in your voice channel. - ### Image Manipulation: * **achievement:** Sends a Minecraft achievement with the text of your choice. diff --git a/Xiao.js b/Xiao.js index 05c11e07..a0e5838c 100644 --- a/Xiao.js +++ b/Xiao.js @@ -23,7 +23,6 @@ client.registry ['search', 'Search'], ['analyze', 'Analyzers'], ['games', 'Games'], - ['voice', 'Voice Channel'], ['image-edit', 'Image Manipulation'], ['avatar-edit', 'Avatar Manipulation'], ['text-edit', 'Text Manipulation'], diff --git a/assets/json/soundboard.json b/assets/json/soundboard.json deleted file mode 100644 index 32b66ed7..00000000 --- a/assets/json/soundboard.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "airhorn": "airhorn.mp3", - "alarm": "alarm.mp3", - "ayaya": "ayaya.mp3", - "car crash": "car-crash.mp3", - "cat": "cat.mp3", - "cow": "cow.mp3", - "dun-dun-dun": "dun-dun-dun.mp3", - "laugh track": "laugh-track.mp3", - "pikachu": "pikachu.mp3", - "rooster": "rooster.mp3", - "slow clap": "slow-clap.mp3", - "you got mail": "you-got-mail.mp3" -} diff --git a/assets/sounds/airhorn.mp3 b/assets/sounds/airhorn.mp3 deleted file mode 100644 index 2bcba2d5..00000000 Binary files a/assets/sounds/airhorn.mp3 and /dev/null differ diff --git a/assets/sounds/alarm.mp3 b/assets/sounds/alarm.mp3 deleted file mode 100644 index 220b938b..00000000 Binary files a/assets/sounds/alarm.mp3 and /dev/null differ diff --git a/assets/sounds/ayaya.mp3 b/assets/sounds/ayaya.mp3 deleted file mode 100644 index 4c866d53..00000000 Binary files a/assets/sounds/ayaya.mp3 and /dev/null differ diff --git a/assets/sounds/car-crash.mp3 b/assets/sounds/car-crash.mp3 deleted file mode 100644 index 8d05ef42..00000000 Binary files a/assets/sounds/car-crash.mp3 and /dev/null differ diff --git a/assets/sounds/cat.mp3 b/assets/sounds/cat.mp3 deleted file mode 100644 index 79484ed9..00000000 Binary files a/assets/sounds/cat.mp3 and /dev/null differ diff --git a/assets/sounds/cow.mp3 b/assets/sounds/cow.mp3 deleted file mode 100644 index cc47634a..00000000 Binary files a/assets/sounds/cow.mp3 and /dev/null differ diff --git a/assets/sounds/dun-dun-dun.mp3 b/assets/sounds/dun-dun-dun.mp3 deleted file mode 100644 index c3037f8b..00000000 Binary files a/assets/sounds/dun-dun-dun.mp3 and /dev/null differ diff --git a/assets/sounds/laugh-track.mp3 b/assets/sounds/laugh-track.mp3 deleted file mode 100644 index 270fdf3f..00000000 Binary files a/assets/sounds/laugh-track.mp3 and /dev/null differ diff --git a/assets/sounds/pikachu.mp3 b/assets/sounds/pikachu.mp3 deleted file mode 100644 index 8e817ceb..00000000 Binary files a/assets/sounds/pikachu.mp3 and /dev/null differ diff --git a/assets/sounds/rooster.mp3 b/assets/sounds/rooster.mp3 deleted file mode 100644 index b6bca9a5..00000000 Binary files a/assets/sounds/rooster.mp3 and /dev/null differ diff --git a/assets/sounds/slow-clap.mp3 b/assets/sounds/slow-clap.mp3 deleted file mode 100644 index 2ecc2531..00000000 Binary files a/assets/sounds/slow-clap.mp3 and /dev/null differ diff --git a/assets/sounds/you-got-mail.mp3 b/assets/sounds/you-got-mail.mp3 deleted file mode 100644 index eb7e686c..00000000 Binary files a/assets/sounds/you-got-mail.mp3 and /dev/null differ diff --git a/commands/voice/dec-talk.js b/commands/voice/dec-talk.js deleted file mode 100644 index c1914b34..00000000 --- a/commands/voice/dec-talk.js +++ /dev/null @@ -1,53 +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: ['text-to-speech', 'tts'], - group: 'voice', - memberName: 'dec-talk', - description: 'The world\'s best Text-to-Speech.', - guildOnly: true, - throttling: { - usages: 1, - duration: 10 - }, - userPermissions: ['CONNECT', 'SPEAK'], - clientPermissions: ['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'], - args: [ - { - key: 'text', - prompt: 'What text do you want to say?', - type: 'string', - max: 1024 - } - ] - }); - } - - async run(msg, { text }) { - const voiceChannel = msg.member.voice.channel; - if (!voiceChannel) return msg.say('Please enter a voice channel first.'); - if (!voiceChannel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) { - return msg.say('Missing the "Connect" or "Speak" permission for the voice channel.'); - } - if (!voiceChannel.joinable) return msg.say('Your voice channel is not joinable.'); - if (this.client.voiceConnections.has(voiceChannel.guild.id)) return msg.say('I am already playing a sound.'); - try { - const connection = await voiceChannel.join(); - const { url } = await request - .get('http://tts.cyzon.us/tts') - .query({ text }); - const dispatcher = connection.play(url); - await msg.react('🔉'); - dispatcher.once('finish', () => voiceChannel.leave()); - dispatcher.once('error', () => voiceChannel.leave()); - return null; - } catch (err) { - voiceChannel.leave(); - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/commands/voice/leave.js b/commands/voice/leave.js deleted file mode 100644 index 09ab7ead..00000000 --- a/commands/voice/leave.js +++ /dev/null @@ -1,22 +0,0 @@ -const Command = require('../../structures/Command'); - -module.exports = class LeaveVoiceChannelCommand extends Command { - constructor(client) { - super(client, { - name: 'leave-voice-channel', - aliases: ['leave-vc'], - group: 'voice', - memberName: 'leave', - description: 'Leaves a voice channel, in case the bot gets stuck.', - guildOnly: true, - userPermissions: ['MOVE_MEMBERS'] - }); - } - - run(msg) { - if (!this.client.voiceConnections.has(msg.guild.id)) return msg.reply('I am not in a voice channel...'); - const { channel } = this.client.voiceConnections.get(msg.guild.id); - channel.leave(); - return msg.say(`Left **${channel.name}**.`); - } -}; diff --git a/commands/voice/soundboard.js b/commands/voice/soundboard.js deleted file mode 100644 index ec655313..00000000 --- a/commands/voice/soundboard.js +++ /dev/null @@ -1,54 +0,0 @@ -const Command = require('../../structures/Command'); -const { list } = require('../../util/Util'); -const path = require('path'); -const sounds = require('../../assets/json/soundboard'); - -module.exports = class SoundboardCommand extends Command { - constructor(client) { - super(client, { - name: 'soundboard', - aliases: ['sound'], - group: 'voice', - memberName: 'soundboard', - description: 'Plays a sound in your voice channel.', - details: `**Sounds:** ${Object.keys(sounds).join(', ')}`, - guildOnly: true, - throttling: { - usages: 1, - duration: 10 - }, - userPermissions: ['CONNECT', 'SPEAK'], - clientPermissions: ['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'], - args: [ - { - key: 'sound', - prompt: `What sound would you like to play? Either ${list(Object.keys(sounds), 'or')}.`, - type: 'string', - oneOf: Object.keys(sounds), - parse: sound => sound.toLowerCase() - } - ] - }); - } - - async run(msg, { sound }) { - const voiceChannel = msg.member.voice.channel; - if (!voiceChannel) return msg.reply('Please enter a voice channel first.'); - if (!voiceChannel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) { - return msg.reply('Missing the "Connect" or "Speak" permission for the voice channel.'); - } - if (!voiceChannel.joinable) return msg.reply('Your voice channel is not joinable.'); - if (this.client.voiceConnections.has(voiceChannel.guild.id)) return msg.reply('I am already playing a sound.'); - try { - const connection = await voiceChannel.join(); - const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound])); - await msg.react('🔉'); - dispatcher.once('finish', () => voiceChannel.leave()); - dispatcher.once('error', () => voiceChannel.leave()); - return null; - } catch (err) { - voiceChannel.leave(); - throw err; - } - } -}; diff --git a/package.json b/package.json index bf5691c8..4f6a3158 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "101.10.2", + "version": "102.0.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { @@ -45,7 +45,6 @@ "moment-duration-format": "^2.2.2", "moment-timezone": "^0.5.23", "neopet-image-finder": "^5.0.2", - "node-opus": "^0.3.1", "node-superfetch": "^0.1.9", "random-js": "^1.0.8", "winston": "^3.2.1",