/// <summary> /// 将消息内GUID表示的图片下载到指定路径下 并返回保存的路径 /// </summary> /// <param name="robotQQ">机器人QQ</param> /// <param name="dir"></param> /// <param name="type">群2 好友1</param> /// <returns></returns> public IEnumerator <string> SaveImages(string robotQQ, string dir, int type, XQGroup group) { var matches = Regex.Matches(Text, @"\[pic=(.*?)\]"); foreach (Match item in matches) { var url = XQDLL.Api_GetPicLink(robotQQ, type, group.Id, item.Value); new WebClient().DownloadFile(url, Path.Combine(dir, $"{item.Groups[0].Value}")); yield return(Path.Combine(dir, $"{item.Groups[0].Value}")); } }
/// <summary> /// 发送群消息 /// </summary> /// <param name="groupid"></param> /// <param name="msg"></param> public void SendGroupMessage(XQGroup group, string msg) { group.SendMessage(RobotQQ, msg); }
/// <summary> /// 撤回消息 /// </summary> /// <param name="robotQQ"></param> /// <param name="group">XQGroup实体</param> public void Withdraw(string robotQQ, XQGroup group) { XQDLL.Api_WithdrawMsg(robotQQ, group.Id, MsgIndex, MsdId); }
public XQMessage(string text, string msgIndex, string msdId, XQGroup fromGroup) { Text = text; MsgIndex = msgIndex; MsdId = msdId; }