Improve soundboard and dec-talk

This commit is contained in:
Daniel Odendahl Jr
2018-10-15 14:35:41 +00:00
parent e78d6c94e5
commit fd361e4cc5
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -17,15 +17,14 @@ module.exports = class SoundboardCommand extends Command {
usages: 1, usages: 1,
duration: 10 duration: 10
}, },
userPermissions: ['CONNECT', 'SPEAK'],
clientPermissions: ['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'],
args: [ args: [
{ {
key: 'sound', key: 'sound',
prompt: `What sound would you like to play? Either ${list(Object.keys(sounds), 'or')}.`, prompt: `What sound would you like to play? Either ${list(Object.keys(sounds), 'or')}.`,
type: 'string', type: 'string',
validate: sound => { oneOf: Object.keys(sounds),
if (sounds[sound.toLowerCase()]) return true;
return `Invalid sound, please enter either ${list(Object.keys(sounds), 'or')}.`;
},
parse: sound => sound.toLowerCase() parse: sound => sound.toLowerCase()
} }
] ]
@@ -43,6 +42,7 @@ module.exports = class SoundboardCommand extends Command {
try { try {
const connection = await voiceChannel.join(); const connection = await voiceChannel.join();
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound])); const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound]));
await msg.react('🔉');
dispatcher.once('finish', () => voiceChannel.leave()); dispatcher.once('finish', () => voiceChannel.leave());
dispatcher.once('error', () => voiceChannel.leave()); dispatcher.once('error', () => voiceChannel.leave());
return null; return null;
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiao", "name": "xiao",
"version": "95.1.0", "version": "95.1.1",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Xiao.js", "main": "Xiao.js",
"scripts": { "scripts": {