N
N
Nazar Ivakhiv2021-03-26 13:07:27
Python
Nazar Ivakhiv, 2021-03-26 13:07:27

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

1 answer(s)
S
Sergey Karbivnichy, 2021-03-26
@hottabxp

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 bot
Reading 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 question

Ask a Question

731 491 924 answers to any question