0
votes

I have a very simple bot in python that runs this code:

def get_chat(chat_id=None):
    data = {
        'chat_id': str(chat_id)
    }
    resp = urllib2.urlopen(BASE_URL + 'getChat?'+urllib.urlencode(data)).read()
        return resp

My bot is an admin of the chat

It should receive the object chat as said here https://core.telegram.org/bots/api#getchat with the chat link inside of the object but the only thing i can receive is this:

{"ok":true,"result":{"id":#####,"title":"####","type":"supergroup"}}

why?

2
Have you tried this? - Ali Momen Sani

2 Answers

0
votes

Try using exportChatInviteLink method. (documentation)

Also note that any previously generated link is revoked.

1
votes

https://core.telegram.org/bots/api#chat

invite_link: String, Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat.