Exemplo n.º 1
0
        public static GroupMessage ParseGroupMessage(JsonValue jsonValue)
        {
            GroupMessage groupMessage = new GroupMessage();

            JsonValue item = jsonValue["value"];

            groupMessage.TrueGroupUin = item["info_seq"];
            groupMessage.GroupUin = item["from_uin"];
            groupMessage.SenderUin = item["send_uin"];
            groupMessage.SentTime = WebQQUtil.GetLocalTimeByLong(item["time"]);
            groupMessage.Order = item["seq"];

            groupMessage.FontStyle = item["content"][0].ToString();
            groupMessage.Message = item["content"].ToString().Replace(groupMessage.FontStyle, "");
            return groupMessage;
        }
Exemplo n.º 2
0
        void communication_OnQunMessageEvent(GroupMessage groupMessage)
        {
            Console.WriteLine("Group {5}({4})=>{0}({1}) {2} :\n\t{3}",
                groupMessage.TrueSenderUin,
                webqq.CurrentUser.GetGroupmate(
                    groupMessage.GroupUin,
                    groupMessage.SenderUin
                    ).DisplayName,
                groupMessage.SentTime,
                groupMessage.Message,
                groupMessage.TrueGroupUin,
                groupMessage.GroupEntity.GroupName
                );

            db.GroupMessages.Add(groupMessage);
            db.Submit();
        }