Detect user profile picture update
As the title says, is it possible to detect a user profile picture update?
Would the Client#userUpdate event trigger when this happens and would I be able to compare the old state and the new state?
7 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
because of the event not triggering always?
I am wondering if Client#userUpdate only triggers for cached users too or if it isn't necessary for the user to be in the bot's cache
yeah it only works for cached users
because it's based on the guild member update and presence update events and will emit if there are changes between the cached user and updated user in those objects
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
well you could cache all of your members on startup but I really wouldn't recommend that because it can take quite a while and it's a bit spammy
on your second point that's definitely possible, you can bulk request members by id for a specific guild
both of those are done with this https://discord.js.org/#/docs/discord.js/main/class/GuildMemberManager?scrollTo=fetch if you take a look at the examples
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View