mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-16 12:51:38 +00:00
🐛 修复低版本 python
This commit is contained in:
parent
d38d916b16
commit
685e1dc646
@ -4,6 +4,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
from asyncio import sleep
|
from asyncio import sleep
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
from typing import List, Dict
|
||||||
|
|
||||||
from pyrogram.errors import FloodWait
|
from pyrogram.errors import FloodWait
|
||||||
from pyrogram.types import Message
|
from pyrogram.types import Message
|
||||||
@ -66,7 +67,7 @@ class LofterPost:
|
|||||||
await self.upload(file)
|
await self.upload(file)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_data(data: list[dict]) -> list[Item]:
|
def parse_data(data: List[Dict]) -> List[Item]:
|
||||||
datas = []
|
datas = []
|
||||||
for i in data:
|
for i in data:
|
||||||
if post_data := i.get("postData"):
|
if post_data := i.get("postData"):
|
||||||
@ -103,8 +104,8 @@ class LofterPost:
|
|||||||
))
|
))
|
||||||
return datas
|
return datas
|
||||||
|
|
||||||
async def get_items(self) -> list[Item]:
|
async def get_items(self) -> List[Item]:
|
||||||
datas: list[LofterPost.Item] = []
|
datas: List[LofterPost.Item] = []
|
||||||
while True:
|
while True:
|
||||||
data = await self.get_data()
|
data = await self.get_data()
|
||||||
if not data:
|
if not data:
|
||||||
|
Loading…
Reference in New Issue
Block a user