Initial commit
This commit is contained in:
17
events/interactionCreate.js
Normal file
17
events/interactionCreate.js
Normal file
@@ -0,0 +1,17 @@
|
||||
module.exports = (client, int) => {
|
||||
if (!int.isButton()) return;
|
||||
|
||||
const queue = player.getQueue(int.guildId);
|
||||
|
||||
switch (int.customId) {
|
||||
case 'saveTrack': {
|
||||
if (!queue || !queue.playing) return int.reply({ content: `No music currently playing... try again ? ❌`, ephemeral: true, components: [] });
|
||||
|
||||
int.member.send(`You saved the track ${queue.current.title} | ${queue.current.author} from the server ${int.member.guild.name} ✅`).then(() => {
|
||||
return int.reply({ content: `I have sent you the title of the music by private messages ✅`, ephemeral: true, components: [] });
|
||||
}).catch(error => {
|
||||
return int.reply({ content: `Unable to send you a private message... try again ? ❌`, ephemeral: true, components: [] });
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
30
events/messageCreate.js
Normal file
30
events/messageCreate.js
Normal file
@@ -0,0 +1,30 @@
|
||||
module.exports = (client, message) => {
|
||||
if (message.author.bot || message.channel.type === 'dm') return;
|
||||
|
||||
const prefix = client.config.app.prefix;
|
||||
|
||||
if (message.content.indexOf(prefix) !== 0) return;
|
||||
|
||||
const args = message.content.slice(prefix.length).trim().split(/ +/g);
|
||||
const command = args.shift().toLowerCase();
|
||||
|
||||
const cmd = client.commands.get(command) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(command));
|
||||
|
||||
const DJ = client.config.opt.DJ;
|
||||
|
||||
if (cmd && DJ.enabled && DJ.commands.includes(cmd.name)) {
|
||||
const roleDJ = message.guild.roles.cache.find(x => x.name === DJ.roleName);
|
||||
|
||||
if (!message.member._roles.includes(roleDJ.id)) {
|
||||
return message.channel.send(`This command is reserved for members with the ${DJ.roleName} role on the server ${message.author}... try again ? ❌`);
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd && cmd.voiceChannel) {
|
||||
if (!message.member.voice.channel) return message.channel.send(`You're not in a voice channel ${message.author}... try again ? ❌`);
|
||||
|
||||
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`You are not in the same voice channel ${message.author}... try again ? ❌`);
|
||||
}
|
||||
|
||||
if (cmd) cmd.execute(client, message, args);
|
||||
};
|
13
events/ready.js
Normal file
13
events/ready.js
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = async (client) => {
|
||||
|
||||
console.log(`${client.user.tag} oberve les ${client.guilds.cache.map(g => g.memberCount).reduce((a,b) => a + b)} utilisateur du serveur !`)
|
||||
|
||||
let activites = ['Créé par Lantium ! Les admins sont les gardiens de la sagesse et de la picole <3' ], i = 0;
|
||||
setInterval(() => client.user.setPresence({
|
||||
activities: [{
|
||||
name: `${activites [i++ % activites.length]}`,
|
||||
type: 'PLAYING'
|
||||
}],
|
||||
status: 'online' }),
|
||||
5000);
|
||||
};
|
Reference in New Issue
Block a user