From 733a78e004b2aa9ae905badc424b485cff8be4fb Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 10 Sep 2023 13:36:50 +0800 Subject: [PATCH] :bug: del command only for channel --- modules/twitter_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/twitter_api.py b/modules/twitter_api.py index 1615934..96ffdf3 100644 --- a/modules/twitter_api.py +++ b/modules/twitter_api.py @@ -4,7 +4,7 @@ from urllib.parse import urlparse from pydantic import BaseModel from pyrogram import Client, filters, ContinuePropagation -from pyrogram.enums import MessageEntityType +from pyrogram.enums import MessageEntityType, ChatType from pyrogram.types import Message from defs.fix_twitter_api import ( @@ -148,7 +148,7 @@ async def twitter_share(_: Client, message: Message): # 过滤绑定频道的转发 return mid = message.id - if message.text.startswith("del"): + if message.text.startswith("del") and message.chat.type == ChatType.CHANNEL: with contextlib.suppress(Exception): await message.delete() mid = None