I have a Telegram Bot on aiogram, and I want to be notified when my bot is added or removed from channels. But my code only works on groups. What needs to be done to work on channels as well?
And here is the code:
import logging
from aiogram import Bot, Dispatcher, executor, types
from config import API_TOKEN
logging.basicConfig(level=logging.INFO)
bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)
@dp.message_handler(content_types=[types.ContentType.NEW_CHAT_MEMBERS, types.ContentType.LEFT_CHAT_MEMBER])
async def check_channel(message: types.Message):
print(message)
if __name__ == "__main__":
executor.start_polling(dp, skip_updates=True)