Presence updates should trigger GuildMemberUpdated
See original GitHub issueUp to commit 3bd920ce66d6f7ff24bdf6e7077ea24499ddb9c5 I used UserPresenceUpdated to track when someone comes online or goes offline in order to update user counter on a web widget (which is per guild). Since the merge there is no way to retrieve information about guild where that event happened from event itself since it’s passing only 2 SocketUser parameters.
Even if I resort to extensive checking in which guilds user is joined there is this problem that we now treat UserUpdated as global event but it’s in fact not. Event is fired per guild, not per user, meaning if 1 user is in 3 guilds where bot resides his single status change will result in 3 identical event executions, that can’t be intended.
public DiscordWidgetService(IDependencyMap map)
{
client.UserUpdated += Client_UserUpdated;
}
async Task Client_UserUpdated(SocketUser arg1, SocketUser arg2)
{
await Console.Out.WriteLineAsync($"UserUpdated fired for {arg2.Username}");
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Presence updates should trigger GuildMemberUpdated #588
Since the merge there is no way to retrieve information about guild where that event happened from event itself since it's passing only...
Read more >Discord.js - guildMemberUpdate not being called except ...
With the following code, the guildMemberUpdate event does not call for any user modification at all except for the bot user. What could...
Read more >guildmemberupdate event only occurs when bot gets updated ...
Coding example for the question guildmemberupdate event only occurs when bot gets updated-discord.js.
Read more >Documentation — Gateway Events
Used to trigger the initial handshake with the gateway. ... presence? update presence object, Presence structure for initial presence information, -.
Read more >Gateway - Discord Developer Portal
Guild Member Update is sent for current-user updates regardless of whether the GUILD_MEMBERS intent is set. Guild Create and Request Guild Members are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Funny since I talked to Jake 3 weeks before that and was told to do it globally. Will ask around =\
Edit: Oh… the user is global and presence isn’t? Ugh. Have I mentioned how much I hate PRESENCE_UPDATE?
Our options are limited, because of the way the Discord API is structured. We’ve discussed this issue extensively, and this is the best we can do, for now.