本文整理匯總了C#中Squishy.Irc.IrcChannel.Msg方法的典型用法代碼示例。如果您正苦於以下問題:C# IrcChannel.Msg方法的具體用法?C# IrcChannel.Msg怎麽用?C# IrcChannel.Msg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Squishy.Irc.IrcChannel
的用法示例。
在下文中一共展示了IrcChannel.Msg方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnText
protected override void OnText(IrcUser user, IrcChannel chan, StringStream text)
{
try
{
if (text.String.ToLower().Contains("badger"))
{
Random rand = new Random();
var randomint = rand.Next(0, 100);
if(randomint > 50)
{
chan.Msg("Ahhhh Snakkeeee its a snaakee!!!! http://www.youtube.com/watch?v=EIyixC9NsLI");
}
else
{
chan.Msg("Mushroom Mushroom Mushroom! http://www.youtube.com/watch?v=EIyixC9NsLI");
}
}
else
{
if (text.String.ToLower().Contains("snake"))
{
chan.Msg("Badger...Badger...Badger...Badger.. http://www.youtube.com/watch?v=EIyixC9NsLI");
}
else
{
if (text.String.ToLower().Contains("mushroom"))
{
chan.Msg("Badger..Badger..Badger! http://www.youtube.com/watch?v=EIyixC9NsLI");
}
}
}
if (text.String.Contains("ACTION") && text.String.ToLower().Contains("help") && text.String.ToLower().Contains("bot"))
{
if (chan != null)
Irc.CommandHandler.Describe(chan, FunCommands.ReactToAction(), chan.Args);
else
Irc.CommandHandler.Describe(user, FunCommands.ReactToAction(), user.Args);
}
#region MessagesSent
if(chan != null)
UtilityMethods.Print(string.Format("User {0} on channel {1} Sent {2}", user, chan, text), true);
#endregion
}
catch (Exception e)
{
CommandHandler.Msg("#woc", e.Message);
UtilityMethods.Print(e.StackTrace + e.Message, true);
}
}
示例2: OnText
protected override void OnText(IrcUser user, IrcChannel chan, StringStream text)
{
try
{
CommandHandler.RemoteCommandPrefix = text.String.StartsWith("~") ? "~" : "@";
if (text.String.ToLower().Contains("badger"))
{
Random rand = new Random();
var randomint = rand.Next(0, 100);
if(randomint > 50)
{
chan.Msg("Ahhhh Snakkeeee its a snaakee!!!! http://www.youtube.com/watch?v=EIyixC9NsLI");
}
else
{
chan.Msg("Mushroom Mushroom Mushroom! http://www.youtube.com/watch?v=EIyixC9NsLI");
}
}
else
{
if (text.String.ToLower().Contains("snake"))
{
chan.Msg("Badger...Badger...Badger...Badger.. http://www.youtube.com/watch?v=EIyixC9NsLI");
}
else
{
if (text.String.ToLower().Contains("mushroom"))
{
chan.Msg("Badger..Badger..Badger! http://www.youtube.com/watch?v=EIyixC9NsLI");
}
}
}
if (text.String.Contains("ACTION") && text.String.ToLower().Contains("utility") && text.String.ToLower().Contains("bot"))
{
if (chan != null)
Irc.CommandHandler.Describe(chan, FunCommands.FunCommands.ReactToAction(), chan.Args);
else
Irc.CommandHandler.Describe(user, FunCommands.FunCommands.ReactToAction(), user.Args);
}
#region MessagesSent
Console.WriteLine(string.Format("User {0} on channel {1} Sent {2}", user, chan, text));
IrcLog.WriteLine(string.Format("User {0} on channel {1} Sent {2}", user, chan, text));
#endregion
}
catch (Exception e)
{
CommandHandler.Msg("#woc", e.Message);
WriteErrorSystem.WriteError(e);
}
}