L
L
lampbear2019-08-21 17:40:21
User identification
lampbear, 2019-08-21 17:40:21

How to make a link to a private channel so that it is displayed as a button in a Telegram bot?

We have a working bot, we want to identify users and, after successful completion, send a link to a private channel in a hidden form so that users cannot send it to each other.
As I understand it, this can be done by hiding the link in the bot's response inside the button, after clicking, the channel preview pops up.
Can you help me with what method to wrap the link in order to implement such functionality? Thank you)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lampbear, 2019-08-21
@lampbear

Like a switch button, as described here Only with a transition to the channel and without inline bot mode enabled

D
Danil K., 2019-08-28
@Danya_Violet

def send_responsible(tlgrm_id_responsible, title, director, d_line, id_task, t_url):
    msg = {'chat_id': tlgrm_id_responsible,
           'text': ' ' + title + '\n\n' + '✍ ' + director + '\n' + '⏰ ' + d_line + '\n' + ' '
                   + '[Задача № ' + id_task + ']' + '(' + t_url + ')', 'parse_mode': 'Markdown'}
    requests.post(const.tlgrm_url, data=msg, proxies=const.proxy)

in the message the link will be "hidden" behind the text as it would be in the tag<a href="URL">...</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question