Exemplo n.º 1
0
        private static void P_MessageReceived(object sender, ReceivedArgs e)
        {
            Log.Debug($"{sender}: {e.Username}   {e.Msg} ");

            // Utils.StringUtils.StripUTF(
            var logStr = "";

            if (commonModule.Config.AllDisabled > 0)
            {
                logStr = "AllDisabled";
            }
            else
            {
                List <OutgoingMsg> Msgs = new List <OutgoingMsg>();
                var reply = replyModule.GenerateReply(commonModule, Regex.Replace(e.Msg, @"\t|\n|\r", " "), Msgs);
                logStr = "Reply: " + reply.ToString();
                if (reply == ReplyStatuses.Ok)
                {
                    Msgs.ForEach(m => logStr += (",  Out: " + m.ToString() + "\n"));
                    outgoingMsgMngr.Add(Msgs);
                }
                var canceled = outgoingMsgMngr.CancelDefaultMsgs();
                if (canceled > 0)
                {
                    logStr += String.Format("  ** {0} canceled ** ", canceled);
                }
            }

            Log.Debug(logStr + "\n");
        }
Exemplo n.º 2
0
        internal static void TestDaily()
        {
            using (DailyModule dailyModule = new DailyModule(location.GetLocation(DailyModule.Filename)))
            {
                //dailyModule.Init();
                dailyModule.Config.Settings.ChanceMultiplier = 0;
                Console.WriteLine(dailyModule);

                OutgoingMsgMngr Msgs = new OutgoingMsgMngr();
                Msgs.Add(dailyModule.Generate(commonModule));
                Console.WriteLine(Msgs);
            }
        }