diff --git a/Unity-Twitch-Chat/Assets/Package/Runtime/IRC.cs b/Unity-Twitch-Chat/Assets/Package/Runtime/IRC.cs index 06272ee..0d48596 100644 --- a/Unity-Twitch-Chat/Assets/Package/Runtime/IRC.cs +++ b/Unity-Twitch-Chat/Assets/Package/Runtime/IRC.cs @@ -276,5 +276,19 @@ private void BlockingDisconnect() if (showIRCDebug) Debug.Log($"{Tags.alert} Disconnected from Twitch IRC"); } + + /// + /// Sends a chat message to the channel + /// + /// The message to send + public void SendChatMessage(string message) + { + if (useAnonymousLogin) + { + Debug.LogWarning("Chat messages cannot be sent with anonymous login"); + return; + } + connection.SendChatMessage(message); + } } } \ No newline at end of file