Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
dairkoos
const Discord = require("discord.js"); const Enmap = require("enmap"); const fs = require("fs"); const client = new Discord.Client(); const config = require("./config.json"); client.config = config; client.on('messageDelete', async message => { var embed = new Discord.MessageEmbed().setColor(`${config.embedColor}`).setAuthor('Message Supprimé', message.guild.iconURL).addField('Membre :', message.author.tag).addField('Message', message.content).addField('Salon', message.channel).setTimestamp() if (message.author == client.user.id) return; else client.channels.cache.get(config.channelLogs).send(embed); }); client.on("messageUpdate", function(oldMessage, newMessage) { var embed = new Discord.MessageEmbed().setColor(`${config.embedColor}`).setAuthor(`Message Modifié`).setDescription(`**Membre :** \n${oldMessage.author.tag}\n\n**Ancien Message :** \n${oldMessage.content}\n\n**Nouveau Message :** \n${newMessage.content}`).addField('Salon', `${oldMessage.channel}`).setTimestamp() if (oldMessage.author == client.user.id) return; else client.channels.cache.get(config.channelLogs).send(embed); }); fs.readdir("./events/", (err, files) => { if (err) return console.error(err); files.forEach(file => { const event = require(`./events/${file}`); let eventName = file.split(".")[0]; console.log(`Attempting to load event ${eventName}`); client.on(eventName, event.bind(null, client)); }); }); client.login(config.token);
run
|
edit
|
history
|
help
-1
Enumerate an enum?
test
jahs
Coding Exercise
12
OBJ Good Start
Nan
ch.murali krishna
Generate Secure GUID
Selection sort