mirror of
https://github.com/arthur-pbty/bot-discord-coins.git
synced 2026-06-26 22:23:01 +02:00
Merge branch 'main' of https://github.com/arthur-pbty/bot-discord-coins
This commit is contained in:
+14
-7
@@ -7,8 +7,10 @@ module.exports = {
|
||||
name: Events.ClientReady,
|
||||
async execute(client) {
|
||||
console.log(`[READY] ${client.user.tag} est prêt ||| ${client.guilds.cache.size} serveurs | ${client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)} utilisateurs\n`.green);
|
||||
loggT(`[READY] ${client.user.tag} est prêt ||| ${client.guilds.cache.size} serveurs | ${client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)} utilisateurs\n`)
|
||||
loggT(`\n\n`)
|
||||
loggT(`[READY] ${client.user.tag} est prêt ||| ${client.guilds.cache.size} serveurs | ${client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)} utilisateurs`);
|
||||
|
||||
console.log('setPresence : ...')
|
||||
client.user.setPresence({
|
||||
activities: [{
|
||||
name: '/azelie',
|
||||
@@ -17,17 +19,21 @@ module.exports = {
|
||||
}],
|
||||
status: 'online'
|
||||
});
|
||||
console.log('setPresence : OK')
|
||||
|
||||
|
||||
client.guilds.cache.forEach(guild => {
|
||||
console.log('BD update : ...')
|
||||
db.run(`INSERT OR IGNORE INTO config (guildId, name, value) VALUES (?, ?, ?)`, [guild.id, 'prefix', '&']);
|
||||
guild.members.cache.forEach(member => {
|
||||
db.run(`INSERT OR IGNORE INTO users (guildId, userId) VALUES (?, ?)`, [guild.id, member.id]);
|
||||
});
|
||||
console.log('BD update : OK')
|
||||
});
|
||||
|
||||
|
||||
setInterval(async () => {
|
||||
console.log('Recompense vocal : ...')
|
||||
client.guilds.cache.forEach(guild => {
|
||||
guild.members.cache.filter(member => member.voice.channel).forEach(member => {
|
||||
if (member.voice.selfMute == true) {
|
||||
@@ -49,9 +55,11 @@ module.exports = {
|
||||
db.run('UPDATE users SET xp = xp + 20 WHERE guildId = ? AND userId = ?', [guild.id, member.id]);
|
||||
});
|
||||
});
|
||||
console.log('Recompense vocal : OK')
|
||||
}, 15 * 60 * 1000);
|
||||
|
||||
setInterval(async () => {
|
||||
console.log('Bâtiment : ...')
|
||||
const team = await new Promise((resolve, reject) => {
|
||||
db.get(`SELECT * FROM teams`, (err, row) => {
|
||||
if (err) reject(err);
|
||||
@@ -60,7 +68,8 @@ module.exports = {
|
||||
});
|
||||
|
||||
if (team.location == 0) return
|
||||
db.run(`UPDATE teams SET bank = bank + ? WHERE guildId = ? AND userId = ?`, [team.location, message.guild.id, message.author.id]);
|
||||
db.run(`UPDATE teams SET bank = bank + ?`, [team.location]);
|
||||
console.log('Bâtiment : OK')
|
||||
}, 1 * 60 * 1000)
|
||||
|
||||
//AntiCrash
|
||||
@@ -68,7 +77,7 @@ module.exports = {
|
||||
if (error.code == "10064") return
|
||||
if (error.code == "10008") return
|
||||
console.log(' [antiCrash] :: Unhandled Rejection/Catch'.red);
|
||||
console.log(error);
|
||||
console.log(`${error}`.grey);
|
||||
loggE(error)
|
||||
});
|
||||
|
||||
@@ -76,7 +85,7 @@ module.exports = {
|
||||
if (error.code == "10064") return
|
||||
if (error.code == "10008") return
|
||||
console.log(' [antiCrash] :: Uncaught Exception/Catch'.red);
|
||||
console.log(error);
|
||||
console.log(`${error}`.grey);
|
||||
console.log('Information supplémentaire:', origin);
|
||||
loggE(error)
|
||||
});
|
||||
@@ -85,7 +94,7 @@ module.exports = {
|
||||
if (error.code == "10064") return
|
||||
if (error.code == "10008") return
|
||||
console.log(' [antiCrash] :: Uncaught Exception Monitor/Catch'.red);
|
||||
console.log(error);
|
||||
console.log(`${error}`.grey);
|
||||
console.log('Information supplémentaire:', origin);
|
||||
loggE(error)
|
||||
});
|
||||
@@ -95,7 +104,6 @@ module.exports = {
|
||||
if (error.code == "10008") return
|
||||
console.log(' [antiCrash] :: Before Exit'.red);
|
||||
console.log('Code de sortie:', code);
|
||||
loggE(error)
|
||||
});
|
||||
|
||||
process.on('exit', (code) => {
|
||||
@@ -103,7 +111,6 @@ module.exports = {
|
||||
if (error.code == "10008") return
|
||||
console.log(' [antiCrash] :: Exit'.red);
|
||||
console.log('Code de sortie:', code);
|
||||
loggE(error)
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user