0

I am using:

https://api.telegram.org/[bot_id]/getUpdates

to retrieve the recent updates. It returns a message object, however it does not include the "text" field of the message.

"message": {
        "message_id": 5,
        "from": {
          "id": 26002823,
          "first_name": "Johnny",
          "last_name": "Appleseed",
          "username": "username"
        },

Why is it not returning the "text" value so I can see what the message said?

1 Answers1

0

here is telegram different objects , maybe the message is sticker or document file.

{
    "ok": true,
    "result": [{
        "update_id": 513400512,
        "message": {
            "message_id": 3,
            "from": {
                "id": 86853848,
                "first_name": "Mojtaba",
                "last_name": "Yeganeh",
                "username": "mojtabye"
            },
            "chat": {
                "id": 86853848,
                "first_name": "Mojtaba",
                "last_name": "Yeganeh",
                "username": "mojtabye",
                "type": "private"
            },
            "date": 1484944898,
            "text": "hi"
        }
    }, {
        "update_id": 513400513,
        "message": {
            "message_id": 4,
            "from": {
                "id": 86853848,
                "first_name": "Mojtaba",
                "last_name": "Yeganeh",
                "username": "mojtabye"
            },
            "chat": {
                "id": 86853848,
                "first_name": "Mojtaba",
                "last_name": "Yeganeh",
                "username": "mojtabye",
                "type": "private"
            },
            "date": 1484944975,
            "sticker": {
                "width": 512,
                "height": 512,
                "emoji": "\ud83d\ude0d",
                "thumb": {
                    "file_id": "AAQEABMr6HIwAAT9WnLtRCT6KIgiAAIC",
                    "file_size": 2828,
                    "width": 128,
                    "height": 128
                },
                "file_id": "BQADBAADrwgAAjn8EwY1EPt_ycp8OwI",
                "file_size": 14102
            }
        }
    }, {
        "update_id": 513400515,
        "message": {
            "message_id": 6,
            "from": {
                "id": 86853848,
                "first_name": "Mojtaba",
                "last_name": "Yeganeh",
                "username": "mojtabye"
            },
            "chat": {
                "id": 86853848,
                "first_name": "Mojtaba",
                "last_name": "Yeganeh",
                "username": "mojtabye",
                "type": "private"
            },
            "date": 1484944986,
            "text": "\ud83d\ude0d"
        }
    }, {
        "update_id": 513400516,
        "message": {
            "message_id": 7,
            "from": {
                "id": 86853848,
                "first_name": "Mojtaba",
                "last_name": "Yeganeh",
                "username": "mojtabye"
            },
            "chat": {
                "id": 86853848,
                "first_name": "Mojtaba",
                "last_name": "Yeganeh",
                "username": "mojtabye",
                "type": "private"
            },
            "date": 1484945102,
            "document": {
                "mime_type": "video/mp4",
                "thumb": {
                    "file_id": "AAQEABN_NmAZAAScKVXd0kYiFiM4AAIC",
                    "file_size": 1681,
                    "width": 67,
                    "height": 90
                },
                "file_id": "BQADBAADRwQAAhvmtwXM4rikxEvd7QI",
                "file_size": 835339
            }
        }
    }]
} 
Mojtaba Yeganeh
  • 2,788
  • 1
  • 30
  • 49