2
我編程bot
電報。如何從發送的郵件中獲取Message_id By BOT Telegram?
我想得到message_id
通過Bot,當我發送消息給Group。
我的代碼是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));
這是怎麼回事?
最好的方面。
分享您的部分代碼並指定您正在使用的庫。 – tashakori
我改變了我的答案。 –
我不是php專家,但請按照下列步驟操作: $ response = file_get_contents(「https://api.telegram.org/bot$token/sendMessage?」。http_build_query($ data)); echo $ response; 現在你知道了json響應的結構,然後編寫一個代碼來解析json結果並提取messageID。 – tashakori