mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 15:56:52 +02:00
Soundboard Random by Default
This commit is contained in:
@@ -22,11 +22,12 @@ module.exports = class SoundboardCommand extends Command {
|
||||
key: 'sound',
|
||||
prompt: 'What sound would you like to play?',
|
||||
type: 'string',
|
||||
default: sounds[Math.floor(Math.random() * sounds.length)],
|
||||
validate: sound => {
|
||||
if (sounds.includes(sound.toLowerCase())) return true;
|
||||
return 'Invalid Sound. Use `help soundboard` for a list of sounds.';
|
||||
},
|
||||
parse: sound => sound.toLowerCase()
|
||||
parse: sound => path.join(__dirname, '..', '..', 'assets', 'sounds', `${sound.toLowerCase()}.mp3`)
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -43,7 +44,7 @@ module.exports = class SoundboardCommand extends Command {
|
||||
if (this.client.voiceConnections.has(channel.guild.id)) return msg.say('I am already playing a sound.');
|
||||
const connection = await channel.join();
|
||||
await msg.react('🔊');
|
||||
const dispatcher = connection.playFile(path.join(__dirname, '..', '..', 'assets', 'sounds', `${sound}.mp3`));
|
||||
const dispatcher = connection.playFile(sound, { volume: 0.25 });
|
||||
dispatcher.once('end', () => {
|
||||
channel.leave();
|
||||
msg.react('✅');
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "31.1.3",
|
||||
"version": "31.1.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user