我正在开发一个 telegram 机器人,并设置一个 webhook 将用户的聊天 id 存储到我的 laravel 应用程序的数据库中。
我之前得到了聊天 ID,但今天,我得到了 NULL。
我正在使用 ngok for https 来与 webhooks 配合使用。
当 webhook 被删除并且我使用/getUpdates
telegram api上的方法,当时我正在获取聊天id,但我需要使用webhook,这是我的项目的要求。
array (
'update_id' => 995486499,
'message' =>
array (
'message_id' => 3,
'from' =>
array (
'id' => NULL, <----------- This message.from.id is NULL in webhook response
'is_bot' => false,
'first_name' => 'XXXX',
'last_name' => 'XXXX',
'username' => 'XXXX',
'language_code' => 'en',
),
'chat' =>
array (
'id' => NULL, <----------- This chat.id is NULL in webhook response
'first_name' => 'XXXX',
'last_name' => 'XXXX',
'username' => 'XXXX',
'type' => 'private',
),
'date' => 1629195470,
'text' => 'hello world',
),
)