Skip to content

Commit

Permalink
Adding Join & Leave channel
Browse files Browse the repository at this point in the history
  • Loading branch information
FGDidou committed Feb 20, 2023
1 parent b992244 commit 1fe63aa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Unity-Twitch-Chat/Assets/Package/Runtime/IRC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,25 @@ public void SendChatMessage(string message)

connection.SendChatMessage(message);
}

/// <summary>
/// Join a new channel
/// </summary>
/// <param name="channel">The channel to join</param>
public void JoinChannel(string channel)
{
if (channel != "")
connection.SendCommand("JOIN #" + channel.ToLower(), true);
}

/// <summary>
/// Leaves a channel
/// </summary>
/// <param name="channel">The channel to leave</param>
public void LeaveChannel(string channel)
{
if (channel != "")
connection.SendCommand("PART #" + channel.ToLower(), true);
}
}
}

0 comments on commit 1fe63aa

Please sign in to comment.