From 685e1dc646ad2d6b019340094ea5c0a2df88ec93 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 5 Oct 2022 23:20:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E4=BD=8E?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- defs/post.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/defs/post.py b/defs/post.py index 9851a12..0e9c538 100644 --- a/defs/post.py +++ b/defs/post.py @@ -4,6 +4,7 @@ import os import re from asyncio import sleep from io import BytesIO +from typing import List, Dict from pyrogram.errors import FloodWait from pyrogram.types import Message @@ -66,7 +67,7 @@ class LofterPost: await self.upload(file) @staticmethod - def parse_data(data: list[dict]) -> list[Item]: + def parse_data(data: List[Dict]) -> List[Item]: datas = [] for i in data: if post_data := i.get("postData"): @@ -103,8 +104,8 @@ class LofterPost: )) return datas - async def get_items(self) -> list[Item]: - datas: list[LofterPost.Item] = [] + async def get_items(self) -> List[Item]: + datas: List[LofterPost.Item] = [] while True: data = await self.get_data() if not data: