skip to Main Content

Am writing my first telegram bot for group chats with python-telegram-bot package. And faced an issue.

Bot with exactly same rights (all of them, incl. adding new admins)

  1. in my test groups (few users) – can promote new admins and change their custom title, no problem, but

  2. in larger group chat (300+ users) – fails to promote new admins & assign custom titles, and gets telegram.error.BadRequest: Chat_admin_required and telegram.error.BadRequest: Not enough rights to change custom title of the user errors.

Using bot.promoteChatMember to promote new admins, and bot.set_chat_administrator_custom_title to set custom titles.

Same bot, same rights, all looks same.

What can be an issue?

Thanks a lot

2

Answers


  1. This problem is that:
    400 CHAT_ADMIN_REQUIRED You must be an admin in this chat to do this

    Login or Signup to reply.
  2. To change custom title, user has to be promoted by the bot itself. Bot can not change titles for users promoted by others.

    Check get_chat_administrators method. For each user it will return can_be_edited flat which indicates whenever is bot capable for modifying this user.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search