问题
I have a server bot (made with cronjobs and PHP): if a condition is met, the bot sends a mail containing a specific message. I noticed any person receiving the mail message has a Telegram account too. What I want to do is the following: I create a bot and, instead of sending mails, the bot posts the message users generally receive by mail.
I tried the following using the command line:
curl -s -X POST https://api.telegram.org/botToken/sendMessage -d text=”hello from the bot” -d chat_id=0000000
My bot receives the message but what I don't understand well is: will this message reach ANY other bot user?
Any suggestion is appreciated.
Thanks in advance
回答1:
due to Bots FAQ in telegram website :
How can I message all of my bot's subscribers at once?
Unfortunately, at this moment we don't have methods for sending bulk messages, e.g. notifications. We may add something along these lines in the future.
回答2:
sendMessage will send a message to a user specified by unique identifier chat_id.
Keep in mind that a bot can't initiate a conversation with a user. Users must contact a bot first in order to receive any messages by the bot.
来源:https://stackoverflow.com/questions/37388414/sendmessage-to-any-bot-user