aboutsummaryrefslogtreecommitdiff
path: root/events/messageUpdate.js
diff options
context:
space:
mode:
Diffstat (limited to 'events/messageUpdate.js')
-rw-r--r--events/messageUpdate.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/events/messageUpdate.js b/events/messageUpdate.js
index 43a6a67..c694255 100644
--- a/events/messageUpdate.js
+++ b/events/messageUpdate.js
@@ -8,8 +8,10 @@
* *************************************/
module.exports = async (bot, oldMsg, newMsg) => {
- const { RichEmbed } = require('discord.js');
- if (oldMsg.content == newMsg.content) return;
+ const {RichEmbed} = require('discord.js');
+ if (oldMsg.content == newMsg.content) {
+ return;
+ }
try {
const embed = new RichEmbed()
.setColor(0x00ae86)
@@ -20,12 +22,15 @@ module.exports = async (bot, oldMsg, newMsg) => {
.setTimestamp()
.setFooter(`Edited message originally created by: ${oldMsg.author.tag}`, oldMsg.author.avatarURL);
const logChannel = await bot.plugins.settings.getStr('logs', oldMsg.guild.id);
- if (!logChannel) return;
+ if (!logChannel) {
+ return;
+ }
const channelObj = bot.channels.find('id', logChannel);
- if (!channelObj) return;
- channelObj.send({ embed });
- }
- catch (err) {
+ if (!channelObj) {
+ return;
+ }
+ channelObj.send({embed});
+ } catch (err) {
console.error(err.stack);
}
};