Files
tbd-station-14/Content.Server/Chat/Commands/AdminChatCommand.cs
Kyle Tyo ca72ca1464 Command resolves and LEC conversions batch 4 (#38382)
* reeeecolllaaaaaaaa

* gonna convert these to public while I'm here for consistency sake

* requested changes.
2025-06-19 02:03:28 +02:00

36 lines
1017 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 class AdminChatCommand : LocalizedCommands
{
[Dependency] private readonly 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);
}
}
}