channel-block-tg/handlers/groups/chat.py

13 lines
366 B
Python

from aiogram import types
from aiogram.dispatcher import FSMContext
from filters import IsGroup
from loader import dp
@dp.message_handler(IsGroup(), content_types=types.ContentTypes.ANY)
async def bot_echo_all(message: types.Message, state: FSMContext):
if message.sender_chat is not None and not message.is_automatic_forward:
await message.delete()