本文整理汇总了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);
}
}