M
M
Marat_RD2017-03-25 19:14:41
Python
Marat_RD, 2017-03-25 19:14:41

How to get a telegram user's nickname programmatically?

Hello!
There is a task to get a telegram username for a bot. I write in Python. I use telebot.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Krymtsev, 2017-03-25
@Marat_RD

message.from_user.id
message.from_user.first_name
message.from_user.last_name
message.from_user.username

A
Alexander Trakhimenok, 2017-03-25
@astec

According to the documentation, the username and nickname come with every incoming message: https://core.telegram.org/bots/api#user
In my debt tracking bot https://t.me/DebtsTrackerRuBot , this definitely works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question