Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bot.on("messageUpdate", async(oldMessage, newMessage) =>{
- if(oldMessage.content === newMessage.content){
- return;
- }
- let loggingChannel = message.guild.channels.find(ch => ch.name === "logs")
- if(!loggingChannel) return message.channel.send("I seems a message was edited but i cant find the correct channel to log it! Please make a channel called `logs` or do my configuration command to help you get started!");
- let logEmbed = new Discord.RichEmbed()
- .setAuthor(oldMessage.author.tag, oldMessage.author.avatarURL)
- .setThumbnail(oldMessage.author.avatarURL)
- .setColor("RANDOM")
- .setDescription("A message from a user was edited!")
- .addField("Before", oldMessage.content, true)
- .addField("After", newMessage.content, true)
- .setTimestamp()
- loggingChannel.send(logEmbed);
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement