fix: added severity to bot ban command
This commit is contained in:
@@ -46,6 +46,12 @@ public sealed class PandaBanCommand : IPandaCommand
|
|||||||
var minutes = (uint) message.Duration!;
|
var minutes = (uint) message.Duration!;
|
||||||
var isGlobalBan = (bool) message.Global!;
|
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);
|
var located = await locator.LookupIdByNameOrIdAsync(target);
|
||||||
if (located == null)
|
if (located == null)
|
||||||
{
|
{
|
||||||
@@ -101,7 +107,7 @@ public sealed class PandaBanCommand : IPandaCommand
|
|||||||
roundId,
|
roundId,
|
||||||
playtime,
|
playtime,
|
||||||
reason,
|
reason,
|
||||||
NoteSeverity.High,
|
severity,
|
||||||
player,
|
player,
|
||||||
null,
|
null,
|
||||||
serverName);
|
serverName);
|
||||||
|
|||||||
@@ -141,6 +141,9 @@ public sealed class UtkaBanRequest : PandaBaseRequestEventMessage
|
|||||||
|
|
||||||
[JsonPropertyName("global")]
|
[JsonPropertyName("global")]
|
||||||
public bool? Global { get; set; }
|
public bool? Global { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("severity")]
|
||||||
|
public string? Severity { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class UtkaBanResponse : PandaBaseMessage
|
public sealed class UtkaBanResponse : PandaBaseMessage
|
||||||
|
|||||||
Reference in New Issue
Block a user