mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-30 11:09:54 +03:00
Backfill member data when a guild is loaded or a new member joins it (#77)
This PR backfills member data when a guild is loaded or a new member joins it. The reason for that is some actions that happen on member tick (default role grant, nickname filtering) would only occur if a member had data related to them (due to being banned or setting a reminder). In addition, the `.editorconfig` was updated with new inspections provided by a new release of Rider, 2023.2 See explanations for some changes in comments. --------- Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
d023033ed4
commit
e9f7825e4a
10 changed files with 61 additions and 35 deletions
|
@ -171,7 +171,7 @@ public class BanCommandGroup : CommandGroup
|
|||
return Result.FromError(banResult.Error);
|
||||
}
|
||||
|
||||
var memberData = data.GetMemberData(target.ID);
|
||||
var memberData = data.GetOrCreateMemberData(target.ID);
|
||||
memberData.BannedUntil
|
||||
= duration is not null ? DateTimeOffset.UtcNow.Add(duration.Value) : DateTimeOffset.MaxValue;
|
||||
memberData.Roles.Clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue