Merge pull request #87 from RockyTV/master

Add support for channel keys
This commit is contained in:
Drew DeVault 2017-10-05 18:51:22 -04:00 committed by GitHub
commit 68822768ca
1 changed files with 8 additions and 3 deletions

View File

@ -74,11 +74,16 @@ namespace ChatSharp
/// <summary>
/// Joins the specified channel.
/// </summary>
public void JoinChannel(string channel)
public void JoinChannel(string channel, string key = null)
{
if (Channels.Contains(channel))
throw new InvalidOperationException("Client is not already present in channel.");
SendRawMessage("JOIN {0}", channel);
throw new InvalidOperationException("Client is already present in channel.");
string joinCmd = string.Format("JOIN {0}", channel);
if (!string.IsNullOrEmpty(key))
joinCmd += string.Format(" {0}", key);
SendRawMessage(joinCmd, channel);
}
/// <summary>