/// <summary> /// 初始化 /// </summary> /// <param name="connectionGuid">服务器链接标识</param> /// <param name="eventName">事件名</param> /// <param name="privateMsgArgs">私聊消息事件参数</param> internal PrivateMessageEventArgs(Guid connectionGuid, string eventName, ApiPrivateMsgEventArgs privateMsgArgs) : base(connectionGuid, eventName, privateMsgArgs.SelfID, privateMsgArgs.Time) { this.Message = new Message(connectionGuid, privateMsgArgs.MessageId, privateMsgArgs.RawMessage, MessageParse.ParseMessageList(privateMsgArgs.MessageList), privateMsgArgs.Time, privateMsgArgs.Font); this.Sender = new User(connectionGuid, privateMsgArgs.UserId); this.SenderInfo = privateMsgArgs.SenderInfo; }
/// <summary> /// 初始化 /// </summary> /// <param name="connectionGuid">服务器链接标识</param> /// <param name="eventName">事件名</param> /// <param name="groupMsgArgs">群消息事件参数</param> internal GroupMessageEventArgs(Guid connectionGuid, string eventName, ApiGroupMsgEventArgs groupMsgArgs ) : base(connectionGuid, eventName, groupMsgArgs.SelfID, groupMsgArgs.Time) { this.IsAnonymousMessage = groupMsgArgs.Anonymous == null; this.Message = new Message(connectionGuid, groupMsgArgs.MessageId, groupMsgArgs.RawMessage, MessageParse.ParseMessageList(groupMsgArgs.MessageList), groupMsgArgs.Time, groupMsgArgs.Font); this.Sender = new User(connectionGuid, groupMsgArgs.UserId); this.SourceGroup = new Group(connectionGuid, groupMsgArgs.GroupId); this.SenderInfo = groupMsgArgs.SenderInfo; }
/// <summary> /// 处理消息节点的消息为CQCode /// </summary> public void ParseNode() { this.NodeMsgList.ForEach(node => node.CQCodeMsgList = MessageParse.ParseMessageList(node.MessageList)); }