Check for guild
Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
parent
176967b9fd
commit
53faf523d1
2 changed files with 4 additions and 0 deletions
|
@ -17,6 +17,8 @@ class messageDeleteListener extends Listener {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!message.guild) return;
|
||||||
|
|
||||||
const logStats = await LogStats.findOne({where: {guild: message.guild.id}});
|
const logStats = await LogStats.findOne({where: {guild: message.guild.id}});
|
||||||
if (logStats && !message.author.bot) {
|
if (logStats && !message.author.bot) {
|
||||||
const fetchedLogs = await message.guild.fetchAuditLogs({
|
const fetchedLogs = await message.guild.fetchAuditLogs({
|
||||||
|
|
|
@ -17,6 +17,8 @@ class messageUpdateListener extends Listener {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!oldMessage.guild) return;
|
||||||
|
|
||||||
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 && !oldMessage.author.bot) {
|
if (logStats && oldMessage.content !== newMessage.content && !oldMessage.author.bot) {
|
||||||
const channel = this.client.channels.resolve(await logStats.get('channel'));
|
const channel = this.client.channels.resolve(await logStats.get('channel'));
|
||||||
|
|
Loading…
Reference in a new issue