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] }); } } }); }, };