Answer the question
In order to leave comments, you need to log in
How to collect ID numbers in a telegram bot?
Created a cart bot and wanted to know how many people are using it.
@bot.message_handler(commands=['start'])
def start(message):
user_id = message.from_user.id
with open ('id.txt', 'a') as file:
file.write(f'ID:{user_id}\n')
Answer the question
In order to leave comments, you need to log in
As far as I understand, the problem is that on heroku, a separate Dino is created for each user, and they do not have shared files. Try using an external database.
Another option - for each /start send a message to the admin (yourself) with the hashtag #registration. And then you just count the number of messages. )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question