mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
35 lines
1,016 B
C#
35 lines
1,016 B
C#
using Content.Server.Administration;
|
|
using Content.Server.Chat.Managers;
|
|
using Content.Shared.Administration;
|
|
using Robust.Shared.Console;
|
|
|
|
namespace Content.Server.Chat.Commands
|
|
{
|
|
[AdminCommand(AdminFlags.Adminchat)]
|
|
internal sealed partial class AdminChatCommand : LocalizedCommands
|
|
{
|
|
[Dependency] private IChatManager _chatManager = default!;
|
|
|
|
public override string Command => "asay";
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
{
|
|
var player = shell.Player;
|
|
|
|
if (player == null)
|
|
{
|
|
shell.WriteError(Loc.GetString($"shell-cannot-run-command-from-server"));
|
|
return;
|
|
}
|
|
|
|
if (args.Length < 1)
|
|
return;
|
|
|
|
var message = string.Join(" ", args).Trim();
|
|
if (string.IsNullOrEmpty(message))
|
|
return;
|
|
|
|
_chatManager.TrySendOOCMessage(player, message, OOCChatType.Admin);
|
|
}
|
|
}
|
|
}
|