Command resolve mega pr batch 5 (#38389)
* commit progress * requested changes
This commit is contained in:
@@ -5,13 +5,13 @@ using Robust.Shared.Console;
|
||||
namespace Content.Server.Administration.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Ban)]
|
||||
public sealed class RoleUnbanCommand : IConsoleCommand
|
||||
public sealed class RoleUnbanCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "roleunban";
|
||||
public string Description => Loc.GetString("cmd-roleunban-desc");
|
||||
public string Help => Loc.GetString("cmd-roleunban-help");
|
||||
[Dependency] private readonly IBanManager _banManager = default!;
|
||||
|
||||
public async void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "roleunban";
|
||||
|
||||
public override async void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -21,16 +21,15 @@ public sealed class RoleUnbanCommand : IConsoleCommand
|
||||
|
||||
if (!int.TryParse(args[0], out var banId))
|
||||
{
|
||||
shell.WriteLine($"Unable to parse {args[0]} as a ban id integer.\n{Help}");
|
||||
shell.WriteLine(Loc.GetString($"cmd-roleunban-unable-to-parse-id", ("id", args[0]), ("help", Help)));
|
||||
return;
|
||||
}
|
||||
|
||||
var banManager = IoCManager.Resolve<IBanManager>();
|
||||
var response = await banManager.PardonRoleBan(banId, shell.Player?.UserId, DateTimeOffset.Now);
|
||||
var response = await _banManager.PardonRoleBan(banId, shell.Player?.UserId, DateTimeOffset.Now);
|
||||
shell.WriteLine(response);
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
{
|
||||
// Can't think of good way to do hint options for this
|
||||
return args.Length switch
|
||||
|
||||
Reference in New Issue
Block a user