using Furion.Logging; using NapCatRobotClient.Core.RobotAPI.Dto.Request; namespace NapCatRobotClient.Service.Group.TextProcess { /// /// 自动做任务群触发验证消息给指定的QQ提示 /// public class VerifyMsgProcess { /// /// 处理群消息 /// /// /// public static async Task ProcessGroupRequest(string groupId, string message) { try { JObject json = JObject.Parse(message); string xx = json["user_id"]?.ToString(); if (xx != App.Configuration["QQConfig:XiaoXiaoRobotQQ"]) { return false; } string groupName = json["group_name"]?.ToString(); List text = ["请先验证", "请验证", "深色文字"]; if (text.Any(message.Contains)) { PrivateSendMessageRequest request = new() { UserId = App.Configuration["QQConfig:SendMsgQQ"], Message = new() { new MessageItem() { Type = "text", Data = new() { Text = $"{DateTime.Now}\r\n触发小小验证消息\r\n群昵称:{groupName}\r\n群号:{groupId}" } } } }; await RobotAPI.SendPrivateText(request); } } catch (Exception ex) { Log.Error($@"{DateTime.Now:yyyy-MM-dd HH:mm:ss} 自动修炼群触发验证消息 发生异常,异常信息:{ex.Message},异常堆栈:{ex.StackTrace}", true); } return await Task.FromResult(true); } } }