Fix incoming users not getting cached
This commit is contained in:
parent
9cfdeba8be
commit
33e893e278
1 changed files with 11 additions and 8 deletions
|
@ -31,7 +31,7 @@ namespace Noikoio.RegexBot.Module.EntityCache
|
|||
client.GuildAvailable += Client_GuildAvailable;
|
||||
client.GuildUpdated += Client_GuildUpdated;
|
||||
client.GuildMemberUpdated += Client_GuildMemberUpdated;
|
||||
// it may not be necessary to handle JoinedGuild, as GuildAvailable provides this info
|
||||
client.UserJoined += Client_UserJoined;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -42,7 +42,8 @@ namespace Noikoio.RegexBot.Module.EntityCache
|
|||
public override Task<object> ProcessConfiguration(JToken configSection) => Task.FromResult<object>(null);
|
||||
|
||||
#region Event handling
|
||||
// Guild _and_ guild member information has become available
|
||||
// Guild and guild member information has become available.
|
||||
// This is a very expensive operation, when joining larger guilds for the first time.
|
||||
private async Task Client_GuildAvailable(SocketGuild arg)
|
||||
{
|
||||
await Task.Run(async () =>
|
||||
|
@ -64,10 +65,12 @@ namespace Noikoio.RegexBot.Module.EntityCache
|
|||
{
|
||||
await Task.Run(() => UpdateGuildMember(arg2));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Table setup
|
||||
|
||||
// A new guild member has appeared
|
||||
private async Task Client_UserJoined(SocketGuildUser arg)
|
||||
{
|
||||
await UpdateGuildMember(arg);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private async Task UpdateGuild(SocketGuild g)
|
||||
|
|
Loading…
Reference in a new issue