From f91b9210f564b9d4ad52a94ab39d700bf6378fab Mon Sep 17 00:00:00 2001 From: blank X Date: Thu, 24 Dec 2020 16:07:12 +0700 Subject: [PATCH] Fix support for pyrogram 1.1.3 --- requirements.txt | 2 +- sukuinote/plugins/log_user_joins.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index df5db02..0bf4b54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # https://github.com/ssut/py-googletrans/issues/234#issuecomment-736314530 git+https://github.com/alainrouillon/py-googletrans@feature/enhance-use-of-direct-api -pyrogram +pyrogram>=1.1.3 tgcrypto requests aiohttp>=3.7.1 diff --git a/sukuinote/plugins/log_user_joins.py b/sukuinote/plugins/log_user_joins.py index 91f5816..8fe8dd1 100644 --- a/sukuinote/plugins/log_user_joins.py +++ b/sukuinote/plugins/log_user_joins.py @@ -21,20 +21,20 @@ async def log_user_joins(client, update, users, chats): if isinstance(message, MessageService): action = message.action if isinstance(action, (MessageActionChatAddUser, MessageActionChatJoinedByLink)): - if isinstance(message.to_id, PeerChannel): - chat_id = message.to_id.channel_id + if isinstance(message.peer_id, PeerChannel): + chat_id = message.peer_id.channel_id sexy_chat_id = int('-100' + str(chat_id)) - elif isinstance(message.to_id, PeerChat): - chat_id = message.to_id.chat_id + elif isinstance(message.peer_id, PeerChat): + chat_id = message.peer_id.chat_id sexy_chat_id = -chat_id else: return peer = await client.resolve_peer(config['config']['log_chat']) - if peer == message.to_id: + if peer == message.peer_id: return is_join = isinstance(action, MessageActionChatJoinedByLink) if not is_join: - is_join = action.users == [message.from_id] + is_join = action.users == [message.from_id.user_id] if is_join and not config['config']['log_user_joins']: raise ContinuePropagation if not is_join and not config['config']['log_user_adds']: