mirror of
https://github.com/arthur-pbty/bot-discord-coins.git
synced 2026-06-13 23:58:10 +02:00
ajout de colors + de client.config.owners (pour bypass les perm)
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"owners": ["1066067393123733595", "671763971803447298"]
|
||||
}
|
||||
@@ -15,8 +15,12 @@ module.exports = {
|
||||
const command = client.commands.get(commandName);
|
||||
if (!command) return;
|
||||
|
||||
const permissionLevel = 11//await getPermissionLevel(message.member, message.guild);
|
||||
if (permissionLevel < command.permission) return message.reply("Vous n'avez pas la permission d'utiliser cette commande.");
|
||||
const permissionLevel = 1 //await getPermissionLevel(message.member, message.guild);
|
||||
if (permissionLevel < command.permission) {
|
||||
if (!client.config.owners.includes(message.author.id)) {
|
||||
return message.reply("Vous n'avez pas la permission d'utiliser cette commande.");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
command.execute(message, args, client);
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@ const db = require('../fonctions/database.js');
|
||||
module.exports = {
|
||||
name: Events.ClientReady,
|
||||
async execute(client) {
|
||||
console.log(`Le bot ${client.user.tag} est en ligne.`);
|
||||
console.log(`[READY] ${client.user.tag} est prêt ||| ${client.guilds.cache.size.toLocaleString('fr-FR')} serveurs | ${client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0).toLocaleString('fr-FR')} utilisateurs\n`.green);
|
||||
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
@@ -40,29 +40,29 @@ module.exports = {
|
||||
|
||||
//AntiCrash
|
||||
process.on('unhandledRejection', (error) => {
|
||||
console.log(' [antiCrash] :: Unhandled Rejection/Catch');
|
||||
console.log(' [antiCrash] :: Unhandled Rejection/Catch'.red);
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
process.on("uncaughtException", (error, origin) => {
|
||||
console.log(' [antiCrash] :: Uncaught Exception/Catch');
|
||||
console.log(' [antiCrash] :: Uncaught Exception/Catch'.red);
|
||||
console.log(error);
|
||||
console.log('Information supplémentaire:', origin);
|
||||
});
|
||||
|
||||
process.on('uncaughtExceptionMonitor', (error, origin) => {
|
||||
console.log(' [antiCrash] :: Uncaught Exception Monitor/Catch');
|
||||
console.log(' [antiCrash] :: Uncaught Exception Monitor/Catch'.red);
|
||||
console.log(error);
|
||||
console.log('Information supplémentaire:', origin);
|
||||
});
|
||||
|
||||
process.on('beforeExit', (code) => {
|
||||
console.log(' [antiCrash] :: Before Exit');
|
||||
console.log(' [antiCrash] :: Before Exit'.red);
|
||||
console.log('Code de sortie:', code);
|
||||
});
|
||||
|
||||
process.on('exit', (code) => {
|
||||
console.log(' [antiCrash] :: Exit');
|
||||
console.log(' [antiCrash] :: Exit'.red);
|
||||
console.log('Code de sortie:', code);
|
||||
});
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@ const { Client, IntentsBitField, Collection } = require("discord.js");
|
||||
const loadCommands = require("./fonctions/loadCommands");
|
||||
const loadEvents = require("./fonctions/loadEvents");
|
||||
const client = new Client({intents: new IntentsBitField(3276799)});
|
||||
const color = require('colors')
|
||||
|
||||
client.events = new Collection();
|
||||
client.commands = new Collection();
|
||||
client.config = require("./config.json");
|
||||
|
||||
console.log(`${loadEvents(client, '..\\events')} events loaded`);
|
||||
console.log(`${loadCommands(client, '..\\commands')} commands loaded`);
|
||||
console.log(`${loadEvents(client, '..\\events')} events loaded`.grey);
|
||||
console.log(`${loadCommands(client, '..\\commands')} commands loaded`.grey);
|
||||
|
||||
client.login(process.env.TOKEN);
|
||||
Reference in New Issue
Block a user