🔖 Update to v1.3.3

This commit is contained in:
xtaodada 2023-04-30 22:28:41 +08:00
parent 9cc6fd2b19
commit 328a03b65c
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
4 changed files with 37 additions and 26 deletions

View File

@ -21,8 +21,8 @@ from pagermaid.scheduler import scheduler
import pyromod.listen
from pyrogram import Client
pgm_version = "1.3.2"
pgm_version_code = 1302
pgm_version = "1.3.3"
pgm_version_code = 1303
CMD_LIST = {}
module_dir = __path__[0]
working_dir = getcwd()

View File

@ -30,6 +30,7 @@ from pyrogram.enums import ChatType
from pagermaid.single_utils import get_sudo_list, Message
from pagermaid.scheduler import add_delete_message_job
from ..methods.get_dialogs_list import get_dialogs_list as get_dialogs_list_func
from ..methods.read_chat_history import read_chat_history as read_chat_history_func
from ..utils import patch, patchable
from ..utils.conversation import Conversation
@ -98,27 +99,7 @@ class Client:
async def read_chat_history(
self: "pyrogram.Client", chat_id: Union[int, str], max_id: int = 0
) -> bool:
peer = await self.resolve_peer(chat_id)
if isinstance(peer, pyrogram.raw.types.InputPeerChannel):
with contextlib.suppress(pyrogram.errors.BadRequest): # noqa
topics: pyrogram.raw.types.messages.ForumTopics = await self.invoke(
pyrogram.raw.functions.channels.GetForumTopics(
channel=peer, # noqa
offset_date=0,
offset_id=0,
offset_topic=0,
limit=0,
)
)
for i in topics.topics:
await self.invoke(
pyrogram.raw.functions.messages.ReadDiscussion(
peer=peer,
msg_id=i.id,
read_max_id=i.top_message,
)
)
return await self.oldread_chat_history(chat_id, max_id) # noqa
return await read_chat_history_func(self, chat_id, max_id)
@patchable
async def get_dialogs_list(self: "Client"):

View File

@ -0,0 +1,30 @@
from typing import Union
import pyrogram
async def read_chat_history(
self: "pyrogram.Client", chat_id: Union[int, str], max_id: int = 0
) -> bool:
peer = await self.resolve_peer(chat_id)
if isinstance(peer, pyrogram.raw.types.InputPeerChannel):
with contextlib.suppress(pyrogram.errors.BadRequest): # noqa
topics: pyrogram.raw.types.messages.ForumTopics = await self.invoke(
pyrogram.raw.functions.channels.GetForumTopics(
channel=peer, # noqa
offset_date=0,
offset_id=0,
offset_topic=0,
limit=0,
)
)
for i in topics.topics:
if isinstance(i, pyrogram.raw.types.ForumTopic):
await self.invoke(
pyrogram.raw.functions.messages.ReadDiscussion(
peer=peer,
msg_id=i.id,
read_max_id=i.top_message,
)
)
return await self.oldread_chat_history(chat_id, max_id) # noqa

View File

@ -1,15 +1,15 @@
pyrogram==2.0.103
pyrogram==2.0.104
TgCrypto==1.2.5
Pillow>=9.0.0
pytz>=2023.3
PyYAML>=6.0
coloredlogs>=15.0.1
psutil>=5.8.0
httpx~=0.23.3
httpx==0.24.0
apscheduler>=3.10.1
sqlitedict~=2.1.0
casbin==1.18.2
sentry-sdk==1.19.1
sentry-sdk==1.21.1
PyQRCode>=1.2.1
PyPng
fastapi==0.95.1