diff options
| -rw-r--r-- | ATRI/plugins/setu/data_source.py | 26 | 
1 files changed, 11 insertions, 15 deletions
| diff --git a/ATRI/plugins/setu/data_source.py b/ATRI/plugins/setu/data_source.py index 0912e25..46cf7cb 100644 --- a/ATRI/plugins/setu/data_source.py +++ b/ATRI/plugins/setu/data_source.py @@ -14,10 +14,9 @@ SCHEDULER_FORMAT = """  class Setu(Service): -          def __init__(self):          Service.__init__(self, "涩图", "hso!", rule=is_in_service("涩图")) -     +      @staticmethod      async def random_setu() -> tuple:          """ @@ -26,13 +25,13 @@ class Setu(Service):          res = await request.get(LOLICON_URL)          data: dict = await res.json()          temp_data: dict = data.get("data", list())[0] -         -        title = temp_data.get("title", "木陰のねこ")         + +        title = temp_data.get("title", "木陰のねこ")          p_id = temp_data.get("pid", 88124144)          url = temp_data["urls"].get("original", "ignore")          setu = MessageSegment.image(url)          return setu, title, p_id -     +      @staticmethod      async def tag_setu(tag: str) -> tuple:          """ @@ -41,18 +40,18 @@ class Setu(Service):          url = LOLICON_URL + f"?tag={tag}"          res = await request.get(url)          data: dict = await res.json() -         +          temp_data: dict = data.get("data", list())[0]          if not temp_data:              is_ok = False          is_ok = True -         -        title = temp_data.get("title", "木陰のねこ")   + +        title = temp_data.get("title", "木陰のねこ")          p_id = temp_data.get("pid", 88124144)          url = temp_data["urls"].get("original", "ignore")          setu = MessageSegment.image(url)          return setu, title, p_id, is_ok -     +      @staticmethod      async def scheduler() -> str:          """ @@ -64,13 +63,10 @@ class Setu(Service):          res = await request.get(LOLICON_URL)          data: dict = await res.json()          temp_data: dict = data.get("data", list())[0] -         +          tag = choice(temp_data.get("tags", ["女孩子"])) -         +          url = temp_data["urls"].get("original", "ignore")          setu = MessageSegment.image(url) -        repo = SCHEDULER_FORMAT.format( -            tag=tag, -            setu=setu -        ) +        repo = SCHEDULER_FORMAT.format(tag=tag, setu=setu)          return repo | 
