sily_girl fix a bug (#214)

Co-authored-by: Xtao_dada <xtao@xtaolink.cn>
This commit is contained in:
cdle 2022-02-04 14:34:38 +08:00 committed by GitHub
parent 18b55272b1
commit 1001750f77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -862,7 +862,7 @@
},
{
"name": "silly_girl",
"version": "1.03",
"version": "1.031",
"section": "chat",
"maintainer": "cdle",
"size": "3 kb",

View File

@ -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"]