1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-30 11:09:54 +03:00

/userinfo: Show if the user was kicked (#242)

Closes #241 

Updates:
- Show if the user was kicked by [adding "Kicked" parameter to
MemberData](https://github.com/LabsDevelopment/Octobot/issues/241)
- Change `mctaylors-ru`'s `UserInfoBannedPermanently` string to be
different from `UserInfoBanned`
- Finally add `AppendPunishmentsInformation` method to avoid Cognitive
Complexity
- Use MemberData to check if the user was banned
- Rename variable `isMuted` to `wasMuted` to be consistent with other
variable names

---------

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2023-12-21 18:35:10 +03:00 committed by GitHub
parent 7d9a85d815
commit 285763d50d
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 58 additions and 24 deletions

View file

@ -151,7 +151,9 @@ public class KickCommandGroup : CommandGroup
return Result.FromError(kickResult.Error);
}
data.GetOrCreateMemberData(target.ID).Roles.Clear();
var memberData = data.GetOrCreateMemberData(target.ID);
memberData.Roles.Clear();
memberData.Kicked = true;
var title = string.Format(Messages.UserKicked, target.GetTag());
var description = MarkdownExtensions.BulletPoint(string.Format(Messages.DescriptionActionReason, reason));