S
S
Spark72020-05-16 22:21:27
PHP
Spark7, 2020-05-16 22:21:27

How to send a message to all users from a telegram bot?

There is a telegram bot in php, you need to notify users about the change in functionality, for this you need to send a message to all users from the bot, how to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2020-05-16
@inoise

Well, you need to store a database of chats with a bot and send iteratively to each)

I
Inoyatullo, 2020-05-18
@Khaliknazar

query = Users.select()
for user in query:
     bot.send_message(chat_id=user.user_id, text='Some text')

You need to create a database and when the user clicks on start, the bot must save the user id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question