Don't log bots

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-05-02 19:32:09 +02:00
parent 76088da799
commit 72d474f06a
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@ class messageDeleteListener extends Listener {
async exec(message) { async exec(message) {
const logStats = await LogStats.findOne({where: {guild: message.guild.id}}); const logStats = await LogStats.findOne({where: {guild: message.guild.id}});
if (logStats) { if (logStats && !message.author.bot) {
const fetchedLogs = await message.guild.fetchAuditLogs({ const fetchedLogs = await message.guild.fetchAuditLogs({
limit: 1, limit: 1,
type: 'MESSAGE_DELETE', type: 'MESSAGE_DELETE',

View file

@ -11,7 +11,7 @@ class messageUpdateListener extends Listener {
async exec(oldMessage, newMessage) { async exec(oldMessage, newMessage) {
const logStats = await LogStats.findOne({where: {guild: newMessage.guild.id}}); const logStats = await LogStats.findOne({where: {guild: newMessage.guild.id}});
if (logStats && oldMessage.content !== newMessage.content) { if (logStats && oldMessage.content !== newMessage.content && !message.author.bot) {
const channel = this.client.channels.resolve(await logStats.get('channel')); const channel = this.client.channels.resolve(await logStats.get('channel'));
let Embed = this.client.util.embed() let Embed = this.client.util.embed()
.setColor('NAVY') .setColor('NAVY')