diff options
Diffstat (limited to 'commands/voice/fart.js')
| -rw-r--r-- | commands/voice/fart.js | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/commands/voice/fart.js b/commands/voice/fart.js new file mode 100644 index 0000000..f5b1dfd --- /dev/null +++ b/commands/voice/fart.js @@ -0,0 +1,73 @@ +const { Command } = require('discord.js-commando'); + +module.exports = class FartVoice extends Command { + constructor(client) { + super(client, { + name: 'fart', + group: 'voice', + memberName: 'fart', + description: 'gives you a random fart', + guildOnly: true + }); + } + async run(msg) { + if (msg.member.voice.channel && !msg.guild.voice) { + const connection = await msg.member.voice.channel.join(); + var fartNum = Math.floor((Math.random() * 8) + 1); + + if (fartNum == 1) { + msg.reply('you got fart 1, courtesy of Sin'); + const dispatcher = connection.play('./assets/audio/farts/1.mp3'); + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } else if (fartNum == 2) { + msg.reply('you got fart 2, courtesy of Sin'); + const dispatcher = connection.play('./assets/audio/farts/2.mp3'); + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } else if (fartNum == 3) { + msg.reply('you got fart 3, courtesy of Sin'); + const dispatcher = connection.play('./assets/audio/farts/3.mp3'); + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } else if (fartNum == 4) { + msg.reply('you got fart 4, courtesy of Sin'); + const dispatcher = connection.play('./assets/audio/farts/4.mp3'); + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } else if (fartNum == 5) { + msg.reply('you got fart 5, courtesy of Sin'); + const dispatcher = connection.play('./assets/audio/farts/5.mp3'); + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } else if (fartNum == 6) { + msg.reply('you got fart 6, courtesy of nick'); + const dispatcher = connection.play('./assets/audio/farts/6.mp3'); + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } else if (fartNum == 7) { + msg.reply('you got fart 7, courtesy of nick'); + const dispatcher = connection.play('./assets/audio/farts/7.mp3'); + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } else if (fartNum == 8) { + msg.reply('you got fart 8, courtesy of nick'); + const dispatcher = connection.play('./assets/audio/farts/8.mp3'); + dispatcher.on('finish', () => { + connection.disconnect(); + }); + } + } else if (msg.guild.voice) { + msg.reply('i\'m already playing that lol'); + } else { + msg.reply('you need to join a voice channel first silly'); + } + } +};
\ No newline at end of file |