Update (v6.0.0)

This commit is contained in:
Zerio
2021-09-23 22:22:33 +02:00
parent 4c2069cdf9
commit 5dcf2affc8
45 changed files with 418 additions and 465 deletions

View File

@@ -1,14 +0,0 @@
module.exports = (client, message) => {
if (message.author.bot || message.channel.type === 'dm') return;
const prefix = client.config.discord.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));
if (cmd) cmd.execute(client, message, args);
};

30
events/messageCreate.js Normal file
View File

@@ -0,0 +1,30 @@
module.exports = (client, message) => {
if (message.author.bot || message.channel.type === 'dm') return;
const prefix = client.config.app.px;
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);
};

View File

@@ -1,5 +1,5 @@
module.exports = async (client) => {
console.log(`Logged in as ${client.user.username}. Ready on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users`);
console.log(`Logged to the client ${client.user.username}\n-> Ready on ${client.guilds.cache.size} servers for a total of ${client.users.cache.size} users`);
client.user.setActivity(client.config.discord.activity);
client.user.setActivity(client.config.app.playing);
};