Skip to content

Commit

Permalink
Merge pull request #14 from FGDidou/main
Browse files Browse the repository at this point in the history
Adding Join & Leave channel
  • Loading branch information
lexonegit authored Feb 20, 2023
2 parents b992244 + 1fe63aa commit 20bb446
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 20bb446

Please sign in to comment.