diff --git a/assets/json/soundboard.json b/assets/json/soundboard.json index 9129627e..b681986f 100644 --- a/assets/json/soundboard.json +++ b/assets/json/soundboard.json @@ -1,8 +1,22 @@ [ - "airhorn", - "cat", - "dun-dun-dun", - "laugh track", - "pikachu", - "space" + "airhorn": "airhorn.mp3", + "ayaya": "ayaya.mp3", + "cat": "cat.mp3", + "doh": "doh.mp3", + "dun-dun-dun": "dun-dun-dun.mp3", + "eat my shorts": "eat-my-shorts.mp3", + "glados bird": "glados-bird.mp3", + "it's a trap": "its-a-trap.mp3", + "laugh track": "laugh-track.mp3", + "mario death": "mario-death.mp3", + "no this is patrick": "no-this-is-patrick.mp3", + "pikachu": "pikachu.mp3", + "pokemon center": "pokemon-center.mp3", + "space": "space.mp3", + "spongebob laugh": "spongebob-laugh.mp3", + "ugly barnacle": "ugly-barnacle.mp3", + "vader": "vader.mp3", + "woohoo": "woohoo.mp3", + "wumbo": "wumbo.mp3", + "zelda chest": "zelda-chest.mp3" ] diff --git a/assets/sounds/ayaya.mp3 b/assets/sounds/ayaya.mp3 new file mode 100644 index 00000000..4c866d53 Binary files /dev/null and b/assets/sounds/ayaya.mp3 differ diff --git a/assets/sounds/doh.mp3 b/assets/sounds/doh.mp3 new file mode 100644 index 00000000..07634a1f Binary files /dev/null and b/assets/sounds/doh.mp3 differ diff --git a/assets/sounds/eat-my-shorts.mp3 b/assets/sounds/eat-my-shorts.mp3 new file mode 100644 index 00000000..537a5c02 Binary files /dev/null and b/assets/sounds/eat-my-shorts.mp3 differ diff --git a/assets/sounds/glados-bird.mp3 b/assets/sounds/glados-bird.mp3 new file mode 100644 index 00000000..41d850ab Binary files /dev/null and b/assets/sounds/glados-bird.mp3 differ diff --git a/assets/sounds/its-a-trap.mp3 b/assets/sounds/its-a-trap.mp3 new file mode 100644 index 00000000..3d9597dc Binary files /dev/null and b/assets/sounds/its-a-trap.mp3 differ diff --git a/assets/sounds/laugh track.mp3 b/assets/sounds/laugh-track.mp3 similarity index 100% rename from assets/sounds/laugh track.mp3 rename to assets/sounds/laugh-track.mp3 diff --git a/assets/sounds/mario-death.mp3 b/assets/sounds/mario-death.mp3 new file mode 100644 index 00000000..5d97899b Binary files /dev/null and b/assets/sounds/mario-death.mp3 differ diff --git a/assets/sounds/no-this-is-patrick.mp3 b/assets/sounds/no-this-is-patrick.mp3 new file mode 100644 index 00000000..0ca29e01 Binary files /dev/null and b/assets/sounds/no-this-is-patrick.mp3 differ diff --git a/assets/sounds/pokemon-center.mp3 b/assets/sounds/pokemon-center.mp3 new file mode 100644 index 00000000..bca7c07c Binary files /dev/null and b/assets/sounds/pokemon-center.mp3 differ diff --git a/assets/sounds/spongebob-laugh b/assets/sounds/spongebob-laugh new file mode 100644 index 00000000..6917a08f Binary files /dev/null and b/assets/sounds/spongebob-laugh differ diff --git a/assets/sounds/ugly-barnacle.mp3 b/assets/sounds/ugly-barnacle.mp3 new file mode 100644 index 00000000..3f9d075f Binary files /dev/null and b/assets/sounds/ugly-barnacle.mp3 differ diff --git a/assets/sounds/vader.mp3 b/assets/sounds/vader.mp3 new file mode 100644 index 00000000..12f158d8 Binary files /dev/null and b/assets/sounds/vader.mp3 differ diff --git a/assets/sounds/woohoo.mp3 b/assets/sounds/woohoo.mp3 new file mode 100644 index 00000000..d4a52976 Binary files /dev/null and b/assets/sounds/woohoo.mp3 differ diff --git a/assets/sounds/wumbo.mp3 b/assets/sounds/wumbo.mp3 new file mode 100644 index 00000000..f83b258d Binary files /dev/null and b/assets/sounds/wumbo.mp3 differ diff --git a/assets/sounds/zelda-chest.mp3 b/assets/sounds/zelda-chest.mp3 new file mode 100644 index 00000000..30d70ded Binary files /dev/null and b/assets/sounds/zelda-chest.mp3 differ diff --git a/commands/other/soundboard.js b/commands/other/soundboard.js index bd4d203a..f21fea25 100644 --- a/commands/other/soundboard.js +++ b/commands/other/soundboard.js @@ -20,12 +20,12 @@ module.exports = class SoundboardCommand extends Command { args: [ { key: 'sound', - prompt: `What sound would you like to play? Either ${list(sounds, 'or')}.`, + prompt: `What sound would you like to play? Either ${list(Object.keys(sounds), 'or')}.`, type: 'string', - default: () => sounds[Math.floor(Math.random() * sounds.length)], + default: () => Object.keys(sounds)[Math.floor(Math.random() * sounds.length)], validate: sound => { - if (sounds.includes(sound.toLowerCase())) return true; - return `Invalid sound, please enter either ${list(sounds, 'or')}.`; + if (sounds[sound.toLowerCase()]) return true; + return `Invalid sound, please enter either ${list(Object.keys(sounds), 'or')}.`; }, parse: sound => sound.toLowerCase() } @@ -43,7 +43,7 @@ module.exports = class SoundboardCommand extends Command { if (this.client.voiceConnections.has(channel.guild.id)) return msg.reply('I am already playing a sound.'); try { const connection = await channel.join(); - const dispatcher = connection.playFile(path.join(__dirname, '..', '..', 'assets', 'sounds', `${sound}.mp3`)); + const dispatcher = connection.playFile(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound])); dispatcher.once('end', () => channel.leave()); dispatcher.once('error', () => channel.leave()); return null; diff --git a/package.json b/package.json index a120a63f..7a76cf17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "56.0.0", + "version": "56.0.1", "description": "Your personal server companion.", "main": "XiaoBot.js", "scripts": {