skip to Main Content

I need to create a Telegram bot to moderate a group and be able to ban/boot/kick users from the group.

I could not find anything in the Telegram API to boot a user from a group, how can a bot do this through the API?

2

Answers


  1. You can use banChatMember to remove a user from a group.

    The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

    Login or Signup to reply.
  2. To remove a user without banning them, use unbanChatMember.

    this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat.

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