Fetch partial message

This commit is contained in:
loicbersier 2020-07-11 01:24:54 +02:00
parent 0e3bd97223
commit 2a69e45284
2 changed files with 14 additions and 0 deletions

View file

@ -10,6 +10,13 @@ class messageDeleteListener extends Listener {
}
async exec(message) {
if (message.partial) {
await message.fetch()
.catch(err => {
return console.error(err);
});
}
const logStats = await LogStats.findOne({where: {guild: message.guild.id}});
if (logStats && !message.author.bot) {
const fetchedLogs = await message.guild.fetchAuditLogs({

View file

@ -10,6 +10,13 @@ class messageUpdateListener extends Listener {
}
async exec(oldMessage, newMessage) {
if (oldMessage.partial) {
await oldMessage.fetch()
.catch(err => {
return console.error(err);
});
}
const logStats = await LogStats.findOne({where: {guild: newMessage.guild.id}});
if (logStats && oldMessage.content !== newMessage.content && !oldMessage.author.bot) {
const channel = this.client.channels.resolve(await logStats.get('channel'));