Skip to content

Commit

Permalink
feat: support guild avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Oct 5, 2021
1 parent 62f2725 commit 2357ffa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion detector/detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = async (client, message, database, edited) => {
{ name: 'Content', value: message.content }
],
thumbnail: {
url: message.author.displayAvatarURL({ dynamic: true })
url: message.member.displayAvatarURL({ dynamic: true })
}
}]
});
Expand Down
2 changes: 1 addition & 1 deletion events/guildMemberUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
{ name: 'Nickname', value: newMember.nickname }
],
thumbnail: {
url: newMember.user.displayAvatarURL({ dynamic: true })
url: newMember.displayAvatarURL({ dynamic: true })
}
}]
});
Expand Down
3 changes: 2 additions & 1 deletion events/messageReactionAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {

const logs = client.db.prepare('SELECT logs FROM guilds WHERE id = ?').get(reaction.message.guildId)?.logs;
const channel = reaction.message.guild.channels.cache.get(logs);
const member = await reaction.message.guild.members.fetch(user);

if (!channel?.permissionsFor(client.user).has('SEND_MESSAGES') || !channel.viewable) {
return;
Expand All @@ -37,7 +38,7 @@ module.exports = {
{ name: 'Reaction', value: `${reaction.emoji}` }
],
thumbnail: {
url: user.displayAvatarURL({ dynamic: true })
url: member.displayAvatarURL({ dynamic: true })
}
}]
});
Expand Down

0 comments on commit 2357ffa

Please sign in to comment.