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