From 448a0f929671d8bac87b97aea9a14129b67af93d Mon Sep 17 00:00:00 2001 From: Kieran Date: Sat, 22 Oct 2022 18:48:40 +0100 Subject: [PATCH] fix: Add image to paid member embed --- src/commands/embeds/paidmember.js | 6 +++++- src/events/guildMemberUpdate.js | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/events/guildMemberUpdate.js diff --git a/src/commands/embeds/paidmember.js b/src/commands/embeds/paidmember.js index dc37343..c9a6030 100644 --- a/src/commands/embeds/paidmember.js +++ b/src/commands/embeds/paidmember.js @@ -42,7 +42,11 @@ module.exports = { 'This is a manual process, executive members need to verify that you have paid your membership and then manually give you the role. **There is no notification of you receiving the role!**' ) .addField('Pay for a membership', 'Press the grey button below!') - .setThumbnail('https://i.imgur.com/ww6wKwJ.png'); + .setThumbnail('https://i.imgur.com/ww6wKwJ.png') + .setImage( + `https://i.imgur.com/ro0U7LG.png?2048` + ); + const row = new MessageActionRow() .addComponents( diff --git a/src/events/guildMemberUpdate.js b/src/events/guildMemberUpdate.js new file mode 100644 index 0000000..1e5dd6f --- /dev/null +++ b/src/events/guildMemberUpdate.js @@ -0,0 +1,24 @@ +const client = require('../index'); + +client.on('guildMemberUpdate', async (oldMember, newMember) => { + console.log('Event fired'); + + + const rolesAdded = newMember.roles.cache.filter(x => !oldMember.roles.cache.get(x.id)); + const rolesRemoved = oldMember.roles.cache.filter(x => !newMember.roles.cache.get(x.id)); + + if (rolesAdded.size != 0 || rolesRemoved.size != 0) { + const roleAddedString = []; + for (const role of [...rolesAdded.values()]) { + roleAddedString.push(role.toString()); + } + + const roleRemovedString = []; + for (const role of [...rolesRemoved.values()]) { + roleRemovedString.push(role.toString()); + } + + console.log(roleAddedString) + + } +}); \ No newline at end of file