skip to Main Content

I can’t find a way to ban or kick a user from a group chat using the pyTelegramBotAPI library

2

Answers


  1. If I were you, I would create a blacklist. I would enter the user.id I want to block there. Then I would check "if the message is sent by a user who is on the blacklist, then this message should be deleted." Simply and without external means…

    Login or Signup to reply.
  2. bot.kick_chat_member(
        chat_id="-1001572091573", 
        user_id='123456789',
    ) # 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search