mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-10 10:55:06 +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,27 @@
|
||||
const { EmbedBuilder, Events } = require('discord.js');
|
||||
const sqlite3 = require('sqlite3').verbose();
|
||||
const db = new sqlite3.Database('myDatabase.db');
|
||||
|
||||
module.exports = {
|
||||
name: Events.ChannelCreate,
|
||||
execute(channel) {
|
||||
db.get('SELECT value FROM gestion WHERE id = ?', [channel.client.user.id], (err, row) => {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
return;
|
||||
}
|
||||
const data = row ? JSON.parse(row.value) : {};
|
||||
const logChannelId = data[channel.guild.id]?.channelog;
|
||||
if (logChannelId) {
|
||||
const logChannel = channel.guild.channels.cache.get(logChannelId);
|
||||
if (logChannel) {
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setDescription(`Un nouveau salon a été créé : ${channel.name}`)
|
||||
.setTimestamp();
|
||||
logChannel.send({ embeds: [embed] });
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user