#_client.GuildMemberUpdated event not firing.

1 messages · Page 1 of 1 (latest)

polar galleon
#

I'm trying to capture when a user's role is updated but even with Server Member's Intent and for good measure Presence Intent` enabled on the developer's page, and my client's GatewayIntent set to GuildMembers, the following code to just check that the event will fire, never hits the breakpoint I've got set. When looking at the console with Debug LogLevel I can see the GUILD_MEMBER_UPDATED events fire. Is there anything I may be missing?

private async Task MainAsync() {
    _client = new DiscordSocketClient(new DiscordSocketConfig {
        GatewayIntents = GatewayIntents.GuildMembers,
        AlwaysDownloadUsers = true,
        LogLevel = LogSeverity.Debug
    });
            
    _services = new ServiceCollection()
                .AddSingleton(_client)
                .BuildServiceProvider();

    _client.Log += LoggerEventHandler.Log;
    _client.GuildMemberUpdated += async (olduser, newuser) => {
        var test = "";
    };
            
    await _client.LoginAsync(TokenType.Bot, await BotSettings.Instance.GetToken());
    await _client.StartAsync();

    await Task.Delay(-1);
}
#

Update: Setting GatewayIntents to All got it firing now. I'm at a loss as to why GuildMembers would capture the event in the console, but fail to fire the event in code

limber lichen
#

if you're using the v3 version of the API you should be using PresenceUpdated instead lf GuildMemeberUpdated iirc

polar galleon
#

That answer didn't work. PresenceUpdated looks to be more for if a user is active on a device or not.