-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
70 lines (64 loc) · 2.25 KB
/
index.js
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
const Discord = require('discord.js');
const {
token
} = process.env.token
const client = new Discord.Client();
const Distube = require('distube');
const { SpotifyPlugin } = require("@distube/spotify");
const distube = new Distube.default(client, { emitNewSongOnly: true, plugins: [new SpotifyPlugin()] });
const prefix = '&'
client.login(token);
client.on('ready', () => {
console.log('Ready!');
});
client.on('reconnecting', () => {
console.log('Reconnecting!');
});
client.on('disconnect', () => {
console.log('Disconnect!');
});
client.on('message', async (message) => {
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const commands = args.shift();
if (commands == "play") {
if (!message.member.voice.channel) return message.channel.send('ayy voice channel join ago badmash -FBI');
if (!args[0]) return message.channel.send('haad hesaru helana 😤');
distube.play(message, args.join(" "));
}
if (commands == "pause") {
distube.pause(message)
message.channel.send("ha nonsense togo break, nangu had koogi koogi sakagoytu");
}
if (commands == "resume") {
distube.resume(message)
message.channel.send("yeshtot madudyalo vapas barakke, innen bittogtidde vc");
}
if (commands === 'skip') {
distube.skip(message)
message.channel.send("paapa aa artist kashta patti sangeeta produce madidane, ninu skip madtiyalo, aytu nangenu");
}
if (commands == "stop") {
distube.stop(message);
message.channel.send('ha nadi maneg haadu mugitu')
}
if (commands === 'queue') {
const queue = distube.getQueue(message)
if (!queue) {
message.channel.send('Nothing playing right now!')
} else {
message.channel.send(
`Current queue: \n${queue.songs
.map(
(song, id) =>
`**${id ? id : 'Playing'}**. ${song.name} - \`${song.formattedDuration
}\``,
)
.slice(0, 10)
.join('\n')
}`,
)
}
}
})