Search code examples
pythonbotstelegrampython-telegram-bot

how to find out the list of chats in which the telegram bot is a member python-telegram-bot


I am a telegram bot for administering channels, how can I get a list of all channels in which the bot is or is an administrator using the bot? I use python-telegram-bot v20

So far, it turns out only to get the id of the channel in which the correspondence is directly received


Solution

  • There is no method to request that information from the Telegram Bot API. You will have to keep track manually. For this you can use Update.my_chat_member as showcased here.


    Disclaimer: I'm currently the maintainer of python-telegram-bot.