Example #1
0
 private void Events_PrivateMessageEvent(BotShell bot, PrivateMessageArgs e)
 {
     if (e.Self)
     {
         return;
     }
     if (!this._sendTell)
     {
         return;
     }
     if (string.IsNullOrEmpty(this._message))
     {
         return;
     }
     if (this.ReceivedMessage(e.Sender))
     {
         return;
     }
     if (this._skipOne)
     {
         this._skipOne = false;
         return;
     }
     if (!bot.Users.Authorized(e.Sender, bot.Commands.GetRight("motd", CommandType.Tell)))
     {
         return;
     }
     bot.SendPrivateMessage(e.SenderID, bot.ColorHighlight + "Message of the day: " + bot.ColorNormal + this._message);
     this._database.ExecuteNonQuery(string.Format("INSERT INTO motd VALUES ('{0}')", e.Sender));
 }
Example #2
0
 internal void OnPrivateMessage(BotShell bot, PrivateMessageArgs e)
 {
     if (this.PrivateMessageEvent != null)
     {
         try { this.PrivateMessageEvent(bot, e); }
         catch { }
     }
 }
Example #3
0
 internal void OnPrivateMessage(BotShell sender, SlaveArgs slave, PrivateMessageArgs e)
 {
     if (this.PrivateMessageEvent != null)
     {
         try { this.PrivateMessageEvent(sender, slave, e); }
         catch { }
     }
 }
Example #4
0
        private void SlaveEvents_PrivateMessageEvent(BotShell bot, SlaveArgs slave, PrivateMessageArgs e)
        {
            string prepend = string.Empty;

            if (e.Self)
            {
                prepend = "To ";
            }
            this.Output("Tells", String.Format("{0}[{1}]: {2}", prepend, e.Sender, HTML.UnescapeString(HTML.StripTags(e.Message))));
        }
Example #5
0
        private void OnPrivateMessageEvent(BotShell bot, PrivateMessageArgs e)
        {
            if (!this._enabled)
            {
                return;
            }
            if (bot.Users.Authorized(e.Sender, UserLevel.Member))
            {
                return;
            }
            WhoisResult whois = e.SenderWhois;

            if (whois == null || !whois.Success)
            {
                return;
            }

            if (this._factions.Count > 0 && !this._factions.Contains(whois.Stats.Faction))
            {
                return;
            }
            if (this._levels.Count > 0 && !this._levels.Contains(whois.Stats.Level))
            {
                return;
            }
            if (this._defenderRanks.Count > 0 && !this._defenderRanks.Contains(whois.Stats.DefenderLevel))
            {
                return;
            }
            if (this._professions.Count > 0 && !this._professions.Contains(whois.Stats.Profession))
            {
                return;
            }
            if (this._breeds.Count > 0 && !this._breeds.Contains(whois.Stats.Breed))
            {
                return;
            }
            if (this._genders.Count > 0 && !this._genders.Contains(whois.Stats.Gender))
            {
                return;
            }

            bot.Users.AddUser(e.Sender, UserLevel.Member);
            if (this._guestlist)
            {
                bot.FriendList.Add("guestlist", e.Sender);
            }
            bot.SendPrivateMessage(e.SenderID, bot.ColorHighlight + "You have been automatically added as member of this bot");
        }
Example #6
0
        public static int onFriendMsg(int ptr)
        {
            IntPtr p = new IntPtr(ptr);
            GroupPrivateMessage data = new GroupPrivateMessage();

            data = (GroupPrivateMessage)Marshal.PtrToStructure(p, typeof(GroupPrivateMessage)); //161群私聊,166好友
            if (data.msgType == (int)PrivateMessageTypeEnum.Temp)                               //临时消息
            {
            }
            else if (data.msgType == (int)PrivateMessageTypeEnum.Friend)  //好友普通消息
            {
                PrivateMessageArgs e = new PrivateMessageArgs(data.RobotQQ, data.FromQQ, data.fromReq, data.fromSql, data.RecvTime, data.SendTime, data.message_content, 0);
                Task t = new Task(() => Core.Event.Event_Private.FriendMessage(e));
                t.Start();
            }
            else if (data.msgType == (int)PrivateMessageTypeEnum.Voice)  //好友语音
            {
            }
            else if (data.msgType == (int)PrivateMessageTypeEnum.File)  //临时语音/好友文件
            {
            }
            return(1);
        }
Example #7
0
 /// <summary>
 /// 好友普通消息
 /// </summary>
 /// <param name="e"></param>
 public static void FriendMessage(PrivateMessageArgs e)
 {
 }
Example #8
0
 public virtual void PrivateMessage(PrivateMessageArgs e)
 {
 }