-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMelody.js
56 lines (48 loc) · 2.21 KB
/
Melody.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
const Discord = require('discord.js');
const bot = new Discord.Client({
partials: ['MESSAGE', 'CHANNEL', 'REACTION']
});
const embed = new Discord.MessageEmbed();
const config = require('./settings.json');
const { loadCommands } = require('./utils/loadCommands');
const DisTube = require('distube');
bot.on('message', msg => {
let link = 'http';
if (msg.content.startsWith(link)) {
embed.setTitle('**Links Not Allowed**');
embed.setColor(0xff0000);
embed.setDescription("**Dude Links Not Allowed Here\n\n I Hope You Unterstand And Don't Want to be Banned**");
msg.channel.send(embed);
}
});
bot.distube = new DisTube(bot, { searchSongs: false, emitNewSongOnly: true });
bot.distube
.on("playSong", (message, queue, song) => {
embed.setTitle('Playing');
embed.setColor('0xa117f2');
embed.setTimestamp();
embed.setFooter(`Requested By: ${message.author.username}`, message.author.displayAvatarURL({ dynamic: true }));
embed.setDescription(`\`${song.name}\` - \`${song.formattedDuration}\``);
message.channel.send(embed);
})
.on("addSong", (message, queue, song) => {
embed.setTitle('Added');
embed.setTimestamp();
embed.setColor('0xa117f2');
embed.setFooter(`Added By: ${message.author.username}`, message.author.displayAvatarURL({ dynamic: true }));
embed.setDescription(`${song.name} - \`${song.formattedDuration}\``);
message.channel.send(embed);
})
.on("playList", (message, queue, playlist, song) => {
embed.setTitle('Playlist');
embed.setColor('0xa117f2');
embed.setTimestamp();
embed.setFooter(`Requested By: ${message.author.username}`, message.author.displayAvatarURL({ dynamic: true }));
embed.setDescription(`\`${playlist.name}\` playlist (${playlist.songs.length} songs).\nRequested by: ${song.user}\nNow playing \`${song.name}\` - \`${song.formattedDuration}\`\n${status(queue)}`);
message.channel.send(embed);
})
require('./utils/loadEvents')(bot);
bot.commands = new Discord.Collection();
bot.aliases = new Discord.Collection();
loadCommands(bot);
bot.login(config.token);