Skip to content

Commit 089d7e2

Browse files
committed
Added SendChatMessage method to IRC instance
1 parent 4db9968 commit 089d7e2

File tree

1 file changed

+14
-0
lines changed
  • Unity-Twitch-Chat/Assets/Package/Runtime

1 file changed

+14
-0
lines changed

Unity-Twitch-Chat/Assets/Package/Runtime/IRC.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,5 +276,19 @@ private void BlockingDisconnect()
276276
if (showIRCDebug)
277277
Debug.Log($"{Tags.alert} Disconnected from Twitch IRC");
278278
}
279+
280+
/// <summary>
281+
/// Sends a chat message to the channel
282+
/// </summary>
283+
/// <param name="message">The message to send</param>
284+
public void SendChatMessage(string message)
285+
{
286+
if (useAnonymousLogin)
287+
{
288+
Debug.LogWarning("Chat messages cannot be sent with anonymous login");
289+
return;
290+
}
291+
connection.SendChatMessage(message);
292+
}
279293
}
280294
}

0 commit comments

Comments
 (0)