mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-16 11:42:16 +00:00
🔖 Update to v1.3.3
This commit is contained in:
parent
9cc6fd2b19
commit
328a03b65c
@ -21,8 +21,8 @@ from pagermaid.scheduler import scheduler
|
|||||||
import pyromod.listen
|
import pyromod.listen
|
||||||
from pyrogram import Client
|
from pyrogram import Client
|
||||||
|
|
||||||
pgm_version = "1.3.2"
|
pgm_version = "1.3.3"
|
||||||
pgm_version_code = 1302
|
pgm_version_code = 1303
|
||||||
CMD_LIST = {}
|
CMD_LIST = {}
|
||||||
module_dir = __path__[0]
|
module_dir = __path__[0]
|
||||||
working_dir = getcwd()
|
working_dir = getcwd()
|
||||||
|
@ -30,6 +30,7 @@ from pyrogram.enums import ChatType
|
|||||||
from pagermaid.single_utils import get_sudo_list, Message
|
from pagermaid.single_utils import get_sudo_list, Message
|
||||||
from pagermaid.scheduler import add_delete_message_job
|
from pagermaid.scheduler import add_delete_message_job
|
||||||
from ..methods.get_dialogs_list import get_dialogs_list as get_dialogs_list_func
|
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 import patch, patchable
|
||||||
from ..utils.conversation import Conversation
|
from ..utils.conversation import Conversation
|
||||||
@ -98,27 +99,7 @@ class Client:
|
|||||||
async def read_chat_history(
|
async def read_chat_history(
|
||||||
self: "pyrogram.Client", chat_id: Union[int, str], max_id: int = 0
|
self: "pyrogram.Client", chat_id: Union[int, str], max_id: int = 0
|
||||||
) -> bool:
|
) -> bool:
|
||||||
peer = await self.resolve_peer(chat_id)
|
return await read_chat_history_func(self, chat_id, max_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
|
|
||||||
|
|
||||||
@patchable
|
@patchable
|
||||||
async def get_dialogs_list(self: "Client"):
|
async def get_dialogs_list(self: "Client"):
|
||||||
|
30
pyromod/methods/read_chat_history.py
Normal file
30
pyromod/methods/read_chat_history.py
Normal 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
|
@ -1,15 +1,15 @@
|
|||||||
pyrogram==2.0.103
|
pyrogram==2.0.104
|
||||||
TgCrypto==1.2.5
|
TgCrypto==1.2.5
|
||||||
Pillow>=9.0.0
|
Pillow>=9.0.0
|
||||||
pytz>=2023.3
|
pytz>=2023.3
|
||||||
PyYAML>=6.0
|
PyYAML>=6.0
|
||||||
coloredlogs>=15.0.1
|
coloredlogs>=15.0.1
|
||||||
psutil>=5.8.0
|
psutil>=5.8.0
|
||||||
httpx~=0.23.3
|
httpx==0.24.0
|
||||||
apscheduler>=3.10.1
|
apscheduler>=3.10.1
|
||||||
sqlitedict~=2.1.0
|
sqlitedict~=2.1.0
|
||||||
casbin==1.18.2
|
casbin==1.18.2
|
||||||
sentry-sdk==1.19.1
|
sentry-sdk==1.21.1
|
||||||
PyQRCode>=1.2.1
|
PyQRCode>=1.2.1
|
||||||
PyPng
|
PyPng
|
||||||
fastapi==0.95.1
|
fastapi==0.95.1
|
||||||
|
Loading…
Reference in New Issue
Block a user