0

Hi I am trying to revoke an invite link but when I am providing chat_id and invite_link but still throwing an error Unhandled rejection Error: ETELEGRAM: 400 Bad Request: CHAT_ADMIN_REQUIRED

Here is the code which I used to revoke invite link bot.revokeChatInviteLink(chat_id, "https://t.me/joinchat/some_key")

Mani Kant Tiwari
  • 390
  • 2
  • 7
  • 19

1 Answers1

0

Your bot needs Admin Rights!

From the revokechatinvitelink documentation:

revokeChatInviteLink

Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the revoked invite link as ChatInviteLink object.


  • Make your bot admin of the chat
  • Add the necessary rights
0stone0
  • 34,288
  • 4
  • 39
  • 64
  • Actually I have made the bot as admin of the group. I think here I am making mistake that I have two bots and one of them is creating the invite_link and other one is revoking it. Is it something which is causing I am not sure. Bt I need two bots for these two task. Because when I was doing all this with one bot it was throwing error saying that `2 instance of same bot can not be created`. – Mani Kant Tiwari Jul 16 '21 at 12:44
  • A bot can only revoke a invite link created by the bot iteself. Another bot wont be able to revoke it. – 0stone0 Jul 16 '21 at 12:44