示例#1
0
        public static int OQ_Event(string micqq, int type, int lowtype, string from, string fromqq, string bqq, string msg, string MsgNum, string msgID, string teamsg, string json, int note)
        {
            int ret = 1;

            switch (type)
            {
            case 12000: ret = Event.Event_AppMain.CqStartup(); break;

            case 12001: ret = Event.Event_AppMain.CqAppEnable(); break;

            case 12002: ret = Event.Event_AppMain.CqAppDisable(); break;
            }

            if (type > 1100 && type < 1110)
            {
                CqQQStuatsChangeEventArgs e = new CqQQStuatsChangeEventArgs(Convert.ToInt64(micqq), type);
                ret = Event.Event_QQStauts.LoginSucess(e);
            }
            else if (type < 0)  //未定义事件
            {
            }
            else if (type == 1)  //好友消息
            {
                CqPrivateMessageEventArgs e = new CqPrivateMessageEventArgs(msgID, MsgNum, Convert.ToInt64(micqq), Convert.ToInt64(from), msg);
                ret = Event.Event_Private.ReceiveFriendMessage(e);
            }
            else if (type == 2)  //群消息
            {
                CqGroupMessageEventArgs e = new CqGroupMessageEventArgs("群聊消息", msgID, MsgNum, Convert.ToInt64(micqq), Convert.ToInt64(from), Convert.ToInt64(fromqq), msg);
                ret = Event.Event_Group.ReceiveGroupMessage(e);
            }
            else if (type == 4)  //群私聊消息
            {
                CqGroupPrivateMessageEventArgs e = new CqGroupPrivateMessageEventArgs(msgID, MsgNum, Convert.ToInt64(micqq), Convert.ToInt64(from), Convert.ToInt64(fromqq), msg);
                ret = Event.Event_Group.ReceiveGroupPrivateMessage(e);
            }
            else if (type == 6)  //收到转账消息
            {
                CqTransferAccountsEventArgs e = new CqTransferAccountsEventArgs(Convert.ToInt64(micqq), Convert.ToInt64(from), lowtype, msg);
                ret = Event.Event_Private.ReceiveTranceAccounts(e);
            }
            else if (type == 101)  //收到好友申请
            {
                CqAddFriendRequestEventArgs e = new CqAddFriendRequestEventArgs(DateTime.Now, Convert.ToInt64(micqq), Convert.ToInt64(from), msg, teamsg);
                ret = Event.Event_Private.ReceiveFriendAddRequest(e);
            }
            else if (type == 202)  //群成员被移除
            {
                CqGroupMemberDecreaseEventArgs e = new CqGroupMemberDecreaseEventArgs(DateTime.Now, Convert.ToInt64(from), Convert.ToInt64(micqq), Convert.ToInt64(fromqq), Convert.ToInt64(bqq));
                ret = Event.Event_Group.ReceiveGroupMemberRemove(e);
            }
            else if (type == 212)   //群成员主动进群
            {
                CqGroupMemberIncreaseEventArgs e = new CqGroupMemberIncreaseEventArgs(DateTime.Now, Convert.ToInt64(micqq), Convert.ToInt64(from), Convert.ToInt64(fromqq), Convert.ToInt64(bqq));
                ret = Event.Event_Group.ReceiveGroupMemberPass(e);
            }
            else if (type == 201)  //群成员退出群
            {
                CqGroupMemberDecreaseEventArgs e = new CqGroupMemberDecreaseEventArgs(DateTime.Now, Convert.ToInt64(from), Convert.ToInt64(micqq), Convert.ToInt64(fromqq), Convert.ToInt64(bqq));
                ret = Event.Event_Group.ReceiveGroupMemberLeave(e);
            }
            else if (type == 213)  //有人申请进群
            {
                CqAddGroupRequestEventArgs e = new CqAddGroupRequestEventArgs(DateTime.Now, Convert.ToInt64(from), Convert.ToInt64(micqq), Convert.ToInt64(fromqq), msg, teamsg);
                ret = Event.Event_Group.ReceiveAddGroupRequest(e);
            }
            else if (type == 214)  //机器人被邀请事件
            {
                CqAddGroupRequestEventArgs e = new CqAddGroupRequestEventArgs(DateTime.Now, Convert.ToInt64(from), Convert.ToInt64(micqq), Convert.ToInt64(fromqq), msg, teamsg);
                ret = Event.Event_Group.ReceiveAddGroupBeInvitee(e);
            }
            else if (type == 219)  //群成员被邀请进群
            {
                CqGroupMemberIncreaseEventArgs e = new CqGroupMemberIncreaseEventArgs(DateTime.Now, Convert.ToInt64(micqq), Convert.ToInt64(from), Convert.ToInt64(fromqq), Convert.ToInt64(bqq));
                ret = Event.Event_Group.ReceiveGroupMemberBeInvitee(e);
            }
            return(1);
        }
示例#2
0
 /// <summary>
 /// 收到转账消息
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 public static int ReceiveTranceAccounts(CqTransferAccountsEventArgs e)
 {
     return(1);
 }