summaryrefslogtreecommitdiff
path: root/commands/wahoo.js
blob: a6e7c966659f6f45df1499426c4ae4230d20570b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const voice_check_dialog = require('../utils/voice_check_dialog.js');

module.exports = {
    name: 'wahoo',
    aliases: ['mario'],
    description: '',
    async execute(msg, args, bot) {
        if (msg.member.voiceChannel && !msg.guild.voiceConnection) {
            const connection = await msg.member.voiceChannel.join();
            const dispatcher = connection.playFile('./assets/audio/wahoo.mp3', {
                volume: 1.0
            });

            dispatcher.on('end', () => {
                msg.member.voiceChannel.leave();
            });
        } else {
            voice_check_dialog.execute(msg);
        }
    }
};