mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-12 08:14:34 +02:00
grand commit que tutur attend ( marche pas le raidmode en dev)
sinon il y a pleins de truc comme les anti raid , des coorectif ect
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
const { EmbedBuilder, Events } = require('discord.js');
|
||||
const sqlite3 = require('sqlite3').verbose();
|
||||
const db = new sqlite3.Database('myDatabase.db');
|
||||
|
||||
module.exports = {
|
||||
name: Events.ChannelUpdate,
|
||||
execute(oldChannel, newChannel) {
|
||||
db.get('SELECT value FROM gestion WHERE id = ?', [newChannel.client.user.id], (err, row) => {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
return;
|
||||
}
|
||||
const data = row ? JSON.parse(row.value) : {};
|
||||
const logChannelId = data[newChannel.guild.id]?.channelog;
|
||||
if (logChannelId) {
|
||||
const logChannel = newChannel.guild.channels.cache.get(logChannelId);
|
||||
if (logChannel) {
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setTitle('Salon modifié')
|
||||
.setDescription(`Le salon ${oldChannel.name} a été modifié.`)
|
||||
.setTimestamp();
|
||||
|
||||
logChannel.send({ embeds: [embed] });
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user