dev: Some minor renaming to match the strings

add: audit logs for several commands
docs: Updated changelog
fix: xp card user avatar wasn't showing for some users
This commit is contained in:
Kwoth
2024-05-08 01:13:58 +00:00
parent bbc277f4b9
commit 4f0692db59
12 changed files with 73 additions and 52 deletions

View File

@@ -103,7 +103,10 @@ public sealed class ReactionRolesService : IReadyExecutor, INService, IReactionR
{
if (user.RoleIds.Contains(role.Id))
{
await user.RemoveRoleAsync(role.Id);
await user.RemoveRoleAsync(role.Id, new RequestOptions()
{
AuditLogReason = $"Reaction role"
});
}
}
finally
@@ -176,11 +179,22 @@ public sealed class ReactionRolesService : IReadyExecutor, INService, IReactionR
var exclusive = reros
.Where(x => x.Group == rero.Group && x.RoleId != role.Id)
.Select(x => x.RoleId)
.Distinct();
.Distinct()
.ToArray();
try { await user.RemoveRolesAsync(exclusive); }
catch { }
if (exclusive.Any())
{
try
{
await user.RemoveRolesAsync(exclusive,
new RequestOptions()
{
AuditLogReason = "Reaction role exclusive group"
});
}
catch { }
}
// remove user's previous reaction
try
@@ -203,7 +217,10 @@ public sealed class ReactionRolesService : IReadyExecutor, INService, IReactionR
}
}
await user.AddRoleAsync(role.Id);
await user.AddRoleAsync(role.Id, new()
{
AuditLogReason = "Reaction role"
});
}
}
finally