Answer the question
In order to leave comments, you need to log in
How to make a code for sending a bot?
How to make a mailing function for all users of my bot and how to know how many people are connected to it?!
Answer the question
In order to leave comments, you need to log in
how to know how many people are connected to it?At the moment when the user subscribes (or whatever it is called) to the bot, you need to save his id in the database (or in a file - but this is a bicycle). Then we just get the number of records from the database, or the number of lines from the file. This will be the number of bot users. True, then the user can unsubscribe - but that's a completely different story.
How to make a mailing function for all users of my botReading user ids from a database or file and sending messages to users:
bot.send_message(id_пользователя,"Текст")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question