From 1001750f77d4f9ec4339d2611d8d78cf3ca952a3 Mon Sep 17 00:00:00 2001 From: cdle <50124752+cdle@users.noreply.github.com> Date: Fri, 4 Feb 2022 14:34:38 +0800 Subject: [PATCH] sily_girl fix a bug (#214) Co-authored-by: Xtao_dada --- list.json | 2 +- silly_girl.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/list.json b/list.json index 6527947..cf8efb7 100644 --- a/list.json +++ b/list.json @@ -862,7 +862,7 @@ }, { "name": "silly_girl", - "version": "1.03", + "version": "1.031", "section": "chat", "maintainer": "cdle", "size": "3 kb", diff --git a/silly_girl.py b/silly_girl.py index 5b4b34f..ad2ed88 100644 --- a/silly_girl.py +++ b/silly_girl.py @@ -95,22 +95,25 @@ async def poll(data): try: replies = json.loads(req_data.text) results = [] - print(replies) for reply in replies: if reply["whiltelist"] != "": persistent_vars["sillyGirl"]['whiltelist'] = reply["whiltelist"] await persistent_vars["sillyGirl"]['context'].edit("获取白名单中...") continue if reply["delete"]: - await bot.edit_message(reply["chat_id"], reply["id"], "打错字了,呱呱~") - await bot.delete_messages(reply["chat_id"], [reply["id"]]) - continue + try: + await bot.edit_message(reply["chat_id"], reply["id"], "打错字了,呱呱~") + except Exception as e: + """""" + try: + await bot.delete_messages(reply["chat_id"], [reply["id"]]) + except Exception as e: + """""" if reply["id"] != 0: try: await bot.edit_message(reply["chat_id"], reply["id"], reply["text"]) continue except Exception as e: - print(e) continue text = reply["text"]