Fetch partial message
This commit is contained in:
parent
0e3bd97223
commit
2a69e45284
2 changed files with 14 additions and 0 deletions
|
@ -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({
|
||||
|
|
|
@ -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'));
|
||||
|
|
Loading…
Reference in a new issue