Reputation: 1002
I program the bot
telegram.
I want Get message_id
By Bot ,when I sent a message to Group.
My Code is PHP
.
$token = "MY_BOT's_TOKEN";
$data = [
'text' => 'my message here',
'chat_id' => 'the_chat_id_here'
];
file_get_contents("https://api.telegram.org/bot$token/sendMessage?" . http_build_query($data) );
How Do it?
best regard.
Upvotes: 8
Views: 9427
Reputation: 2441
Your file_get_contents call returns a result containing status code and messageId.
$result = file_get_contents("https://api.telegram.org/bot$token/sendMessage?" . http_build_query($data) );
Upvotes: 8