From 0a4dda08ab19663a18e790e322c86c6690cd7b4b Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 2 Jan 2023 12:16:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Update=20to=20v1.2.21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagermaid/__init__.py | 2 +- pagermaid/listener.py | 9 +++++---- requirements.txt | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pagermaid/__init__.py b/pagermaid/__init__.py index 9f5aef3..1921e17 100644 --- a/pagermaid/__init__.py +++ b/pagermaid/__init__.py @@ -15,7 +15,7 @@ from pyrogram import Client from pyromod.listen.temp_fix import temp_fix -pgm_version = "1.2.20" +pgm_version = "1.2.21" CMD_LIST = {} module_dir = __path__[0] working_dir = getcwd() diff --git a/pagermaid/listener.py b/pagermaid/listener.py index f126e95..31cb942 100644 --- a/pagermaid/listener.py +++ b/pagermaid/listener.py @@ -11,7 +11,7 @@ from pyrogram.errors.exceptions.bad_request_400 import ( MessageIdInvalid, MessageNotModified, MessageEmpty, - UserNotParticipant + UserNotParticipant, PeerIdInvalid ) from pyrogram.handlers import MessageHandler, EditedMessageHandler @@ -20,7 +20,6 @@ from pagermaid.group_manager import Permission from pagermaid.inject import inject from pagermaid.single_utils import Message, AlreadyInConversationError, TimeoutConversationError, ListenerCanceled from pagermaid.utils import lang, attach_report, sudo_filter, alias_command, get_permission_name, process_exit -from pagermaid.utils import client as httpx_client from pagermaid.hook import Hook secret_generator = secrets.SystemRandom() @@ -153,8 +152,10 @@ def listener(**args): raise StopPropagation from e except KeyboardInterrupt as e: raise KeyboardInterrupt from e - except (UserNotParticipant, MessageNotModified, MessageEmpty, Flood, Forbidden): - pass + except (UserNotParticipant, MessageNotModified, MessageEmpty, Flood, Forbidden, PeerIdInvalid): + logs.warning( + "An unknown chat error occurred while processing a command.", + ) except MessageIdInvalid: logs.warning( "Please Don't Delete Commands While it's Processing.." diff --git a/requirements.txt b/requirements.txt index 436a6b6..6a9979a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pyrogram==2.0.73 +pyrogram==2.0.93 TgCrypto==1.2.5 Pillow>=8.4.0 pytz>=2021.3