From 089d7e2047b24cb26cfada1b28c7eed6097f1ab2 Mon Sep 17 00:00:00 2001 From: Fuzzy Date: Sun, 22 Jan 2023 13:18:07 +0100 Subject: [PATCH] Added SendChatMessage method to IRC instance --- Unity-Twitch-Chat/Assets/Package/Runtime/IRC.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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