I'm working in Telegram bot with a handler. where I need to get the user's name or users id once they use the command.
MY CODE
import telebot #Telegram Bot API
bot = telebot.TeleBot(<BotToken>)
@bot.message_handler(commands=['info'])
def send_welcome(message):
name = bot.get_me()
print(name)
bot.reply_to(message, "Welcome")
bot.polling()
However, I get only info about the bot. I can't retrieve info about the user who used handler.
OUTPUT
{'first_name': 'SPIOTSYSTEMS', 'id': 581614234, 'username': 'spiotsystems_bot', 'is_bot': True, 'last_name': None, 'language_code': None}
How do I get the user id or name of the person who uses info
command?
which method i shall use? please advise.
NOTE:
My bot is linked with the Telegram group. and I've removed the Telegram TOKEN from my MVC for security reasons.