Soundboard Command is Back

This commit is contained in:
Dragon Fire
2020-05-25 12:20:47 -04:00
parent 525f4ad38d
commit 17b2f4db7a
7 changed files with 73 additions and 2 deletions
+6 -1
View File
@@ -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)
+5
View File
@@ -0,0 +1,5 @@
[
"nipah",
"pikachu",
"subaru ringtone"
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
+61
View File
@@ -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;
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "114.29.6",
"version": "114.30.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {