fix: added severity to bot ban command

This commit is contained in:
EnefFlow
2024-02-20 16:11:09 +03:00
parent 1a832a5200
commit 9d6770aa20
2 changed files with 10 additions and 1 deletions

View File

@@ -46,6 +46,12 @@ public sealed class PandaBanCommand : IPandaCommand
var minutes = (uint) message.Duration!;
var isGlobalBan = (bool) message.Global!;
if (Enum.TryParse(message.Severity!, ignoreCase: true, out NoteSeverity severity))
{
UtkaSendResponse(context, false);
return;
}
var located = await locator.LookupIdByNameOrIdAsync(target);
if (located == null)
{
@@ -101,7 +107,7 @@ public sealed class PandaBanCommand : IPandaCommand
roundId,
playtime,
reason,
NoteSeverity.High,
severity,
player,
null,
serverName);

View File

@@ -141,6 +141,9 @@ public sealed class UtkaBanRequest : PandaBaseRequestEventMessage
[JsonPropertyName("global")]
public bool? Global { get; set; }
[JsonPropertyName("severity")]
public string? Severity { get; set; }
}
public sealed class UtkaBanResponse : PandaBaseMessage