Код: Выделить всё
import aiogram
import asyncio
bot = aiogram.Bot(token=token)
dp = aiogram.Dispatcher()
from_chanel = from_chanel
to_chanel = to_chanel
class IsSourceFilter(aiogram.filters.BaseFilter):
async def __call__(self, message: aiogram.types.Message) -> bool:
return message.chat.id == from_chanel
@dp.message(IsSourceFilter())
async def forward(message: aiogram.types.Message):
await bot.send_message(chat_id=to_chanel, text=message.text)
async def main():
await dp.start_polling(bot)
if __name__ == "__main__":
asyncio.run(main())
Подробнее здесь: https://stackoverflow.com/questions/793 ... arsing-bot
Мобильная версия