public void ProcessGroupMessage(GroupMessageReceivedContext context) { // 只上报#开头的晚安式消息 string message = context.Message; message = message.Trim(); if (message.StartsWith("#")) { ulong from_qq = Convert.ToUInt64(context.FromQq); ulong from_group = Convert.ToUInt64(context.FromGroup); ulong add_time = Convert.ToUInt64(UnixTimestamp.GetTimeStampLong()); string nick_name = string.Empty; try { nick_name = _mahuaApi.GetGroupMemberInfo(context.FromGroup, context.FromQq).NickName; } catch { nick_name = from_qq.ToString(); } AutoGoodNightLogCache cache = new AutoGoodNightLogCache(); cache.Init(dbConnString); try { string localPath = AppDomain.CurrentDomain.BaseDirectory; localPath = Path.Combine(localPath, "data", "image"); // 图片酷Q码的转换 message = _replaceMsg(localPath, message); // Emojid酷Q码的转换,暂时调整到获取的时候在转换 // message = CqpEmoji.EmojiStringToNormalString(message); cache.InsertLog(from_qq, from_group, message, add_time, nick_name); } catch (Exception e) { ILog Logger = Newbe.Mahua.Logging.LogProvider.For <string>(); Logger.Debug(e.StackTrace); } } }