本文整理汇总了C#中Meebey.SmartIrc4net.IrcClient.RfcPrivmsg方法的典型用法代码示例。如果您正苦于以下问题:C# IrcClient.RfcPrivmsg方法的具体用法?C# IrcClient.RfcPrivmsg怎么用?C# IrcClient.RfcPrivmsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Meebey.SmartIrc4net.IrcClient
的用法示例。
在下文中一共展示了IrcClient.RfcPrivmsg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Connect
public void Connect()
{
while (true)
{
_irc = new IrcClient();
Logger.InfoFormat("Connecting to: {0}:{1}", _settings.Server, _settings.Port);
try
{
_irc.Encoding = System.Text.Encoding.UTF8;
_irc.SendDelay = 500;
_irc.ActiveChannelSyncing = true;
_irc.AutoReconnect = false;
_irc.AutoRejoinOnKick = true;
_irc.AutoRetry = true;
_irc.AutoRetryDelay = 10000;
_irc.OnQueryMessage += OnQueryMessage;
_irc.OnQueryNotice += OnQueryMessage;
_irc.OnError += OnError;
_irc.OnChannelMessage += OnChannelMessage;
//_irc.OnRawMessage += (x, e) => Logger.Info(e.Data.RawMessage);
_irc.Connect(_settings.Server, _settings.Port);
}
catch (Exception e)
{
// Log this shit
Logger.Error(e.ToString());
}
Logger.Info("Connected! Joining channels");
try
{
_irc.Login(_settings.Nickname, "Name");
if (!String.IsNullOrWhiteSpace(_settings.Password))
{
_irc.RfcPrivmsg("NickServ", "identify " + _settings.Password);
}
foreach (var channel in _settings.GetAllChannels())
{
_irc.RfcJoin(channel);
}
_checkTimer.Change(TimeSpan.Zero, _settings.Period);
}
catch (Exception e)
{
Logger.Error(e.ToString());
}
try
{
_irc.Listen();
Logger.Error("Lost connection to IRC (Automatically reconnecting in 10 seconds)");
Thread.Sleep(10000);
if (_irc.IsConnected)
{
_irc.Disconnect();
}
}
catch (Exception e)
{
Logger.Error(e.ToString());
}
}
}