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.
Follow the link to your bot by clicking the link that looks like t.me/{yourBotUsername}. This is where you will receive messages.
Any file can be downloaded by calling upload. getFile.
A message can only be deleted if it was sent less than 48 hours ago. Any such recently sent outgoing message may be deleted. Additionally, if the bot is an administrator in a group chat, it can delete any message.
If privacy mode is disabled, the bot can read all messages sent in a group. If it is enabled, a bot is only receives messages aimed directly at the bot (e.g. using a command or a reply to a message from the bot).
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) );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With