當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。