1
0

OOCCommand.cs 960 B

1234567891011121314151617181920212223242526272829303132
  1. using Content.Server.Chat.Managers;
  2. using Content.Shared.Administration;
  3. using Robust.Shared.Console;
  4. namespace Content.Server.Chat.Commands
  5. {
  6. [AnyCommand]
  7. internal sealed class OOCCommand : IConsoleCommand
  8. {
  9. public string Command => "ooc";
  10. public string Description => "Send Out Of Character chat messages.";
  11. public string Help => "ooc <text>";
  12. public void Execute(IConsoleShell shell, string argStr, string[] args)
  13. {
  14. if (shell.Player is not { } player)
  15. {
  16. shell.WriteError("This command cannot be run from the server.");
  17. return;
  18. }
  19. if (args.Length < 1)
  20. return;
  21. var message = string.Join(" ", args).Trim();
  22. if (string.IsNullOrEmpty(message))
  23. return;
  24. IoCManager.Resolve<IChatManager>().TrySendOOCMessage(player, message, OOCChatType.OOC);
  25. }
  26. }
  27. }