CatStation/Content.Server/Chat/Commands/OOCCommand.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* 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
2026-05-09 03:29:58 +00:00

32 lines
922 B
C#

using Content.Server.Chat.Managers;
using Content.Shared.Administration;
using Robust.Shared.Console;
namespace Content.Server.Chat.Commands
{
[AnyCommand]
internal sealed partial class OOCCommand : LocalizedCommands
{
[Dependency] private IChatManager _chatManager = default!;
public override string Command => "ooc";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (shell.Player is not { } player)
{
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.OOC);
}
}
}