summaryrefslogtreecommitdiff
path: root/commands/fart.js
blob: de628896497b0deaf1c6933649cb96d4a2313fdc (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
module.exports = {
    name: 'fart',
    description: '',
    async execute(msg, args, bot) {
        if (msg.member.voiceChannel && !msg.guild.voiceConnection) {
            const connection = await msg.member.voiceChannel.join();
            var fartNum = Math.floor((Math.random() * 8) + 1);

            if (fartNum == 1) {
                msg.reply('you got fart 1, courtesy of Sin');
                const dispatcher = connection.playFile('./assets/audio/farts/1.mp3', {
                    volume: 0.5
                });
                dispatcher.on('end', () => {
                    msg.member.voiceChannel.leave();
                });
            } else if (fartNum == 2) {
                msg.reply('you got fart 2, courtesy of Sin');
                const dispatcher = connection.playFile('./assets/audio/farts/2.mp3', {
                    volume: 0.5
                });
                dispatcher.on('end', () => {
                    msg.member.voiceChannel.leave();
                });
            } else if (fartNum == 3) {
                msg.reply('you got fart 3, courtesy of Sin');
                const dispatcher = connection.playFile('./assets/audio/farts/3.mp3', {
                    volume: 0.5
                });
                dispatcher.on('end', () => {
                    msg.member.voiceChannel.leave();
                });
            } else if (fartNum == 4) {
                msg.reply('you got fart 4, courtesy of Sin');
                const dispatcher = connection.playFile('./assets/audio/farts/4.mp3', {
                    volume: 0.5
                });
                dispatcher.on('end', () => {
                    msg.member.voiceChannel.leave();
                });
            } else if (fartNum == 5) {
                msg.reply('you got fart 5, courtesy of Sin');
                const dispatcher = connection.playFile('./assets/audio/farts/5.mp3', {
                    volume: 0.5
                });
                dispatcher.on('end', () => {
                    msg.member.voiceChannel.leave();
                });
            } else if (fartNum == 6) {
                msg.reply('you got fart 6, courtesy of nick');
                const dispatcher = connection.playFile('./assets/audio/farts/6.mp3', {
                    volume: 0.5
                });
                dispatcher.on('end', () => {
                    msg.member.voiceChannel.leave();
                });
            } else if (fartNum == 7) {
                msg.reply('you got fart 7, courtesy of nick');
                const dispatcher = connection.playFile('./assets/audio/farts/7.mp3', {
                    volume: 0.5
                });
                dispatcher.on('end', () => {
                    msg.member.voiceChannel.leave();
                });
            } else if (fartNum == 8) {
                msg.reply('you got fart 8, courtesy of nick');
                const dispatcher = connection.playFile('./assets/audio/farts/8.mp3', {
                    volume: 0.5
                });
                dispatcher.on('end', () => {
                    msg.member.voiceChannel.leave();
                });
            }
        } else if (msg.guild.voiceConnection) {
            msg.reply('i\'m already playing that lol');
        } else {
            msg.reply('you need to join a voice channel first silly');
        }
    }
};