diff --git a/README.md b/README.md index 3fed678f..1c96621a 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 444 +Total: 445 ### Utility: @@ -691,6 +691,7 @@ Total: 444 * **dec-talk:** The world's best Text-to-Speech. * **join:** Joins your voice channel. * **leave:** Leaves the current voice channel. +* **soundboard:** Plays a sound in a voice channel. ### Phone: @@ -768,6 +769,7 @@ here. - [07th Expansion](http://07th-expansion.net/) * box-choosing (Original Game) + * soundboard (Nipah Sound) - [20th Century Fox](https://www.foxmovies.com/) * bart-chalkboard ([Image, Original "The Simpsons" Show](http://www.simpsonsworld.com/)) * eat-pant ([Original "The Simpsons" Show](http://www.simpsonsworld.com/)) @@ -1230,6 +1232,7 @@ here. * hat (Ash Hat Original Anime) * pokedex (Images, Original Game) * pokemon-fusion (Original Game) + * soundboard (Pikachu Sound) * whos-that-pokemon (Images, Original Game) * wynaut (Image, Original Anime) - [Pottermore](https://my.pottermore.com/sorting) @@ -1249,6 +1252,8 @@ here. * cat (API) - [RandomFox](https://randomfox.ca/) * fox (API) +- [Re:ZERO -Starting Life in Another World-](http://re-zero-anime.jp/) + * soundboard (Subaru Ringtone Sound) - [Recipe Puppy](http://www.recipepuppy.com/) * recipe ([API](http://www.recipepuppy.com/about/api/)) - [RedBubble - Akbar Mna](https://www.redbubble.com/en/people/akbarmna/shop) diff --git a/assets/json/soundboard.json b/assets/json/soundboard.json new file mode 100644 index 00000000..e47a2494 --- /dev/null +++ b/assets/json/soundboard.json @@ -0,0 +1,5 @@ +[ + "nipah", + "pikachu", + "subaru ringtone" +] diff --git a/assets/sounds/soundboard/nipah.mp3 b/assets/sounds/soundboard/nipah.mp3 new file mode 100644 index 00000000..b17348f4 Binary files /dev/null and b/assets/sounds/soundboard/nipah.mp3 differ diff --git a/assets/sounds/soundboard/pikachu.mp3 b/assets/sounds/soundboard/pikachu.mp3 new file mode 100644 index 00000000..a3f940cc Binary files /dev/null and b/assets/sounds/soundboard/pikachu.mp3 differ diff --git a/assets/sounds/soundboard/subaru ringtone.mp3 b/assets/sounds/soundboard/subaru ringtone.mp3 new file mode 100644 index 00000000..34cf4d08 Binary files /dev/null and b/assets/sounds/soundboard/subaru ringtone.mp3 differ diff --git a/commands/voice/soundboard.js b/commands/voice/soundboard.js new file mode 100644 index 00000000..c40635cb --- /dev/null +++ b/commands/voice/soundboard.js @@ -0,0 +1,61 @@ +const Command = require('../../structures/Command'); +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 a voice channel.', + guildOnly: true, + throttling: { + usages: 1, + duration: 10 + }, + userPermissions: ['CONNECT', 'SPEAK'], + credit: [ + { + name: 'Pokémon', + url: 'https://www.pokemon.com/us/', + reason: 'Pikachu Sound' + }, + { + name: '07th Expansion', + url: 'http://07th-expansion.net/', + reason: 'Nipah Sound' + }, + { + name: 'Re:ZERO -Starting Life in Another World-', + url: 'http://re-zero-anime.jp/', + reason: 'Subaru Ringtone Sound' + } + ], + args: [ + { + key: 'sound', + prompt: `What sound do you want to play? Either ${list(sounds, 'or')}.`, + type: 'string', + default: () => `${sounds[Math.floor(Math.random() * sounds.length)]}.mp3`, + oneOf: sounds, + parse: sound => `${sound.toLowerCase()}.mp3` + } + ] + }); + } + + async run(msg, { sound }) { + const inGuild = msg.guild ? undefined : null; + const connection = this.client.voice.connections.get(msg.guild.id); + if (!connection) { + return msg.reply(`I am not in a voice channel. Use ${msg.anyUsage('join', inGuild, inGuild)} to fix that!`); + } + connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'soundboard', sound)); + if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) { + await msg.react('🔉'); + } + return null; + } +}; diff --git a/package.json b/package.json index 16a64945..8b790566 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "114.29.6", + "version": "114.30.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {