summaryrefslogtreecommitdiff
path: root/commands/voice/wahoo.js
blob: d89dfe32ad80ba38a3e447f92006aa672252a505 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const { Command } = require('discord.js-commando');

module.exports = class WahooVoice extends Command {
    constructor(client) {
        super(client, {
            name: 'wahoo',
            aliases: ['mario'],
            group: 'voice',
            memberName: 'wahoo',
            description: 'wahoo',
            guildOnly: true
        });
    }
    async run(msg) {
        if (msg.member.voice.channel && !msg.guild.voice) {
            const connection = await msg.member.voice.channel.join();
            const dispatcher = connection.play('./assets/audio/wahoo.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');
        }
    }
};