所以我正在使用 Telegram API 给我的 JSON。我正在尝试将消息值转换为字符串。
这是我的Json。
{
"ok": true,
"result": [
{
"update_id": 855636291,
"message": {
"message_id": 71,
"from": {
"id": 1337,
"first_name": "*",
"last_name": "*",
"username": "*"
},
"chat": {
"id": 1337,
"first_name": "*",
"last_name": "*",
"username": "*"
},
"date": 1435987802,
"text": "Testing"
}
}
]
}
我试图用来获取价值的代码。(使用请求顺便说一句)
content = json.loads(r)
msg = content['result'][0]['message'][0]['text]
但是,它不起作用。我设法检索了update_id
withcontent['result'][0]['update_id']
但我不知道如何检索text
.
提前致谢!