Answer the question
In order to leave comments, you need to log in
How to find out the new chat_id of a private chat?
Is it possible to get the chat_id of every user that starts a chat with the bot without having to enter the chat_id manually?
Answer the question
In order to leave comments, you need to log in
It is possible, when starting the bot with the "/start" command, to add the user's chat_id to the database
. For example, in the "telebot" module, this can be implemented like this
@bot.message_handler(regexp='/start')
def start(message):
print(message.chat.id)
#Ну сюда фигаришь дальше код, куда сохранять эти chat_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question