本文整理汇总了C#中Winter.WinterBot.WriteDiagnostic方法的典型用法代码示例。如果您正苦于以下问题:C# WinterBot.WriteDiagnostic方法的具体用法?C# WinterBot.WriteDiagnostic怎么用?C# WinterBot.WriteDiagnostic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Winter.WinterBot
的用法示例。
在下文中一共展示了WinterBot.WriteDiagnostic方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Kill
public void Kill(WinterBot bot, TwitchUser user, string cmd, string value)
{
bot.WriteDiagnostic(DiagnosticFacility.Info, "Bot killed by streamer.");
WinterBotSource.Log.Kill();
bot.Shutdown();
}
示例2: SetRegular
private void SetRegular(WinterBot sender, string cmd, string value, bool regular)
{
value = value.Trim();
if (!TwitchUsers.IsValidUserName(value))
{
sender.WriteDiagnostic(DiagnosticFacility.UserError, "{0}: Invalid username '{1}.", cmd, value);
return;
}
TwitchUser target = sender.Users.GetUser(value);
target.IsRegular = regular;
sender.SendResponse(Importance.Med, "{0} {1} the regular list.", target.Name, regular ? "added to " : "removed from");
}
示例3: SetRegular
private void SetRegular(WinterBot sender, string cmd, string value, bool regular)
{
value = value.Trim().ToLower();
if (!TwitchUsers.IsValidUserName(value))
{
sender.WriteDiagnostic(DiagnosticFacility.UserError, "{0}: Invalid username '{1}.", cmd, value);
return;
}
TwitchUser target = sender.Users.GetUser(value);
if (regular)
{
sender.AddRegular(target);
sender.SendResponse("{0} added to regular list.", value);
}
else
{
sender.RemoveRegular(target);
sender.SendResponse("{0} removed from regular list.", value);
}
}
示例4: WordMatch
public WordMatch(WinterBot bot, string str)
{
m_str = str.ToLower();
if (str.IsRegex())
{
try
{
m_reg = new Regex(str, RegexOptions.IgnoreCase);
}
catch (ArgumentException)
{
bot.WriteDiagnostic(DiagnosticFacility.UserError, "Invalid regex in options: " + str);
}
}
}
示例5: UrlMatch
public UrlMatch(WinterBot bot, string str)
{
if (str.StartsWith("http://", StringComparison.CurrentCultureIgnoreCase))
str = str.Substring(7);
m_str = str.ToLower();
if (str.IsRegex())
{
try
{
m_reg = new Regex(str, RegexOptions.IgnoreCase);
}
catch (ArgumentException)
{
bot.WriteDiagnostic(DiagnosticFacility.UserError, "Invalid regex in options: " + str);
}
}
}
示例6: ChangeMode
private static bool ChangeMode(WinterBot sender, TwitchUser user, string value, string type, bool curr)
{
bool result = curr;
value = value.Trim();
if (string.IsNullOrWhiteSpace(value))
{
sender.SendResponse(Importance.Med, "{0} protect is currently {1}.", type, curr ? "enabled" : "disabled");
}
else if (value.ParseBool(ref result))
{
if (curr != result)
{
string enableStr = result ? "enabled" : "disabled";
sender.SendResponse(Importance.Med, "{0} protect is now {1}.", type, enableStr);
sender.WriteDiagnostic(DiagnosticFacility.ModeChange, "{0} changed {1} mode to {2}.", user.Name, type, enableStr);
}
}
return result;
}