当前位置: 首页>>代码示例>>C#>>正文


C# WinterBot.WriteDiagnostic方法代码示例

本文整理汇总了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();
        }
开发者ID:NitroXenon,项目名称:WinterBot,代码行数:7,代码来源:BotControl.cs

示例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");
        }
开发者ID:NitroXenon,项目名称:WinterBot,代码行数:13,代码来源:Regulars.cs

示例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);
            }
        }
开发者ID:BigAbboTT,项目名称:WinterBot,代码行数:21,代码来源:Regulars.cs

示例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);
         }
     }
 }
开发者ID:NitroXenon,项目名称:WinterBot,代码行数:15,代码来源:TimeoutController.cs

示例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);
                }
            }
        }
开发者ID:NitroXenon,项目名称:WinterBot,代码行数:18,代码来源:TimeoutController.cs

示例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;
        }
开发者ID:NitroXenon,项目名称:WinterBot,代码行数:20,代码来源:TimeoutController.cs


注:本文中的Winter.WinterBot.WriteDiagnostic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。