From 7f52a260742e2180ff9d9ae828d01b48fb33e6a4 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 10 Sep 2023 13:02:37 +0800 Subject: [PATCH] :zap: Ignore forward_from_chat --- modules/twitter_api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/twitter_api.py b/modules/twitter_api.py index 56c4830..9e7fb0b 100644 --- a/modules/twitter_api.py +++ b/modules/twitter_api.py @@ -116,6 +116,13 @@ async def process_url(url: str, message: Message): async def twitter_share(_: Client, message: Message): if not message.text: return + if ( + message.sender_chat + and message.forward_from_chat + and message.sender_chat.id == message.forward_from_chat.id + ): + # 过滤绑定频道的转发 + return for num in range(len(message.entities)): entity = message.entities[num] if entity.type == MessageEntityType.URL: