public async System.Threading.Tasks.Task TestMethod2Async() { try { //var readResults = OperateExcel.ExcelToDataTable(@"C:\Users\changqing\Desktop\chats.xlsx", "sheet1", true); //var listResults = OperateExcel.ToDataList<Input>(readResults); //foreach (var item in listResults) //{ // await lianChatServices.Insert(new Qiushui.Lian.Bot.Models.LianChat() // { // Content = item.Chats // }); //} var t = lianKeyWordsServices.Query(t => t.Status == Status.Valid); var t1 = signUserServices.Query(t => t.Status == Status.Valid); var t2 = lianChatServices.Query(t => t.Status == Status.Valid); var t3 = signUserServices.Query(t => t.QNumber.Equals("1069430666")); signLogsServices.DeleteById(t => t.ID > 0); // await signLogsServices.DeleteById(2); //var t = await signLogsServices.Query(t => t.ID > 0); } catch (Exception c) { } }
public async ValueTask GroupRecallParse(object sender, GroupRecallEventArgs groupMessage) { try { var r = new Random().Next(5, 9); if (r is 6) { var msg = _speakerServices.Query(s => s.MsgId == groupMessage.MessageId).First(); var user = _userServices.Query(s => s.QNumber == groupMessage.MessageSender.Id.ObjToString()).First(); await groupMessage.SourceGroup.SendGroupMessage($"[有人撤回了消息,但我要说]\r\n[时间:{msg.CreateTime:HH:mm:ss}]\r\n[昵称:{user.NickName}]\r\n[ID:{user.QNumber}]\r\n以下消息正文\r\n{msg.RawText}"); } else { await groupMessage.SourceGroup.SendGroupMessage($"怀孕了就说啊,撤回干嘛,大家都会负责的"); } } catch (Exception) { await groupMessage.SourceGroup.SendGroupMessage($"我感觉他撤回的是图片,我懒得弄,下次一定"); } }