mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-22 07:07:52 +00:00
🐛 del command only for channel
This commit is contained in:
parent
1cd96818c5
commit
733a78e004
@ -4,7 +4,7 @@ from urllib.parse import urlparse
|
|||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from pyrogram import Client, filters, ContinuePropagation
|
from pyrogram import Client, filters, ContinuePropagation
|
||||||
from pyrogram.enums import MessageEntityType
|
from pyrogram.enums import MessageEntityType, ChatType
|
||||||
from pyrogram.types import Message
|
from pyrogram.types import Message
|
||||||
|
|
||||||
from defs.fix_twitter_api import (
|
from defs.fix_twitter_api import (
|
||||||
@ -148,7 +148,7 @@ async def twitter_share(_: Client, message: Message):
|
|||||||
# 过滤绑定频道的转发
|
# 过滤绑定频道的转发
|
||||||
return
|
return
|
||||||
mid = message.id
|
mid = message.id
|
||||||
if message.text.startswith("del"):
|
if message.text.startswith("del") and message.chat.type == ChatType.CHANNEL:
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(Exception):
|
||||||
await message.delete()
|
await message.delete()
|
||||||
mid = None
|
mid = None
|
||||||
|
Loading…
Reference in New Issue
Block a user