From 4e5c3d0bd160698f2bf4a6dc83db07dd17712c7f Mon Sep 17 00:00:00 2001 From: cdle <50124752+cdle@users.noreply.github.com> Date: Tue, 30 Aug 2022 15:38:55 +0800 Subject: [PATCH] =?UTF-8?q?silly=5Fgirl=20=E9=81=BF=E5=85=8D=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E9=A2=91=E7=B9=81=EF=BC=8C=E6=8F=90=E9=AB=98=E7=A8=B3?= =?UTF-8?q?=E5=AE=9A=E6=80=A7=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com> --- list.json | 2 +- silly_girl.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/list.json b/list.json index 046bad5..190012c 100644 --- a/list.json +++ b/list.json @@ -852,7 +852,7 @@ }, { "name": "silly_girl", - "version": "1.04", + "version": "1.041", "section": "chat", "maintainer": "cdle", "size": "3 kb", diff --git a/silly_girl.py b/silly_girl.py index 9f508b1..581b876 100644 --- a/silly_girl.py +++ b/silly_girl.py @@ -1,3 +1,4 @@ +from asyncio import sleep from pagermaid.listener import listener from pagermaid import persistent_vars, bot from pagermaid.utils import client, alias_command @@ -88,8 +89,10 @@ async def poll(data): init = "&init=true" req_data = await client.post(persistent_vars["sillyGirl"]['url']+"/pgm?token="+persistent_vars["sillyGirl"]['token']+init, json=data) except Exception as e: + await sleep(1) return if not req_data.status_code == 200: + await sleep(1) return try: replies = json.loads(req_data.text) @@ -137,5 +140,5 @@ async def poll(data): await persistent_vars["sillyGirl"]['context'].edit("傻妞连接成功,愉快玩耍吧。") await persistent_vars["sillyGirl"]['context'].delete() except Exception as e: - + await sleep(1) return