Class Chat
- Namespace
- AO
- Assembly
- CoreAssembly.dll
Chat is a core engine system to work with the in game chat.
public static class Chat
- Inheritance
-
Chat
- Inherited Members
Methods
RegisterChatCommandHandler(Action<Player, string>)
Register a chat command handler. This is only supported on the server. Invoked when a player sends a message that starts with a '/'.
public static extern void RegisterChatCommandHandler(Action<Player, string> handler)
Parameters
Examples
Chat.RegisterChatCommandHandler((Player player, string message) => {
if (message == "hello") {
Chat.SendMessage("Hello, " + player.Name, player);
}
});
SendMessage(Player, string)
Send a message to a player. This is only supported on the server. Pass null as the player to broadcast the chat message to all players.
public static void SendMessage(Player player, string message)
Parameters
SetChatMode(Mode)
public static void SetChatMode(Chat.Mode mode)