示例#1
0
文件: Status.cs 项目: rjt011000/NBot
 public void HandleStatusChange(Message message, IMessageClient client, IBrain brain, string query)
 {
     string time = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
     //string result = "wut";
     var userName = client.GetUser(message.UserId).Name;
     if (query.ToLower().StartsWith("in"))
     {
         //result = "i recognize " + message.UserId + " checked in at " + time;
         brain.SetValue(LastCheckinKey(userName), time);
         brain.RemoveKey(LastCheckoutKey(userName));
     }
     else if (query.ToLower().StartsWith("out"))
     {
         //result = "i recognize " + message.UserId + " checked out at " + time;
         brain.SetValue(LastCheckoutKey(userName), time);
         brain.RemoveKey(LastCheckinKey(userName));
     }
     //client.ReplyTo(message, result);
 }
示例#2
0
文件: Status.cs 项目: NBot/NBot
        public void HandleStatusChange(Message message, IMessageClient client, IBrain brain, string query)
        {
            string time = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
            //string result = "wut";
            var userName = client.GetUser(message.UserId).Name;

            if (query.ToLower().StartsWith("in"))
            {
                //result = "i recognize " + message.UserId + " checked in at " + time;
                brain.SetValue(LastCheckinKey(userName), time);
                brain.RemoveKey(LastCheckoutKey(userName));
            }
            else if (query.ToLower().StartsWith("out"))
            {
                //result = "i recognize " + message.UserId + " checked out at " + time;
                brain.SetValue(LastCheckoutKey(userName), time);
                brain.RemoveKey(LastCheckinKey(userName));
            }
            //client.ReplyTo(message, result);
        }