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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
yibuh
yibuh2y ago
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
dawnniie
dawnniie2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
dawnniie
dawnniie2y ago
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
dawnniie
dawnniie2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View