public FunctionResult Progress(CQGroupMessageEventArgs e) { FunctionResult result = new FunctionResult() { Result = true, SendFlag = false, }; //检查额度限制 if (QuotaHelper.QuotaCheck(e.FromGroup, e.FromQQ) is false) { return(result); } //拉取图片,处理时间受地区与网速限制 var pic = GetLoliConPicHelper .GetSetuPic(e.Message.Text.Substring(GetOrderStr().Length), out string objectTostring); pic.SendID = e.FromGroup.Id; try { SendText text = new SendText { MsgToSend = new List <string>(), SendID = e.FromGroup, }; objectTostring.Replace("<@>", e.FromQQ.CQCode_At().ToSendString()); // 处理返回文本,替换可配置文本为结果,发送处理结果 if (!string.IsNullOrWhiteSpace(objectTostring)) { text.MsgToSend.Add(objectTostring); } result.SendObject.Add(text); result.SendFlag = true; IniConfig ini = MainSave.ConfigMain; if (pic.HandlingFlag)//是否成功处理消息 { //TODO: Improve this code //处理一番后发现, 成功发送时只有一个图片文本, 虽说不规范, 以后再说吧 var msg = e.FromGroup.SendGroupMessage(pic.MsgToSend[0]); if (PublicVariables.R18_PicRevoke)//自动撤回 { Task task = new Task(() => { Thread.Sleep(PublicVariables.R18_RevokeTime * 1000); e.CQApi.RemoveMessage(msg.Id); }); task.Start(); } } else//处理消息失败 { result.SendFlag = true; result.SendObject.Add(pic); QuotaHelper.PlusMemberQuota(e.FromGroup.Id, e.FromQQ.Id); } } catch (Exception exc) { SendText text = new SendText { MsgToSend = new List <string>(), SendID = e.FromGroup, }; text.MsgToSend.Add($"发生未知错误,错误信息:在{exc.Source}上, 发生错误: {exc.Message}"); result.SendObject.Add(text); result.SendFlag = true; } return(result); }