cotestatnt / AsyncTelegram2

Powerful, flexible and secure Arduino Telegram BOT library. Hardware independent, it can be used with any MCU capable of handling an SSL connection.
MIT License
83 stars 25 forks source link

Support photo messages #50

Closed palmerabollo closed 2 years ago

palmerabollo commented 2 years ago

It would be great to support "photo" messages. The library currently supports "document", but it is not able to process a message such as the following one, when you send a photo to the bot. Thanks for your time building this lib, Tolentino.

{
  "ok": true,
  "result": [
    {
      "update_id": 123,
      "message": {
        "message_id": 29,
        "from": {
          "id": 123,
          "is_bot": false,
          "first_name": "XXX",
          "username": "xxx",
          "language_code": "en"
        },
        "chat": {
          "id": 1234,
          "first_name": "XXX",
          "username": "xxx",
          "type": "private"
        },
        "date": 1644678608,
        "photo": [
          {
            "file_id": "AgAredactedBA",
            "file_unique_id": "AQredactedB4",
            "file_size": 1739,
            "width": 64,
            "height": 90
          },
          {
            "file_id": "AgAredactedjBA",
            "file_unique_id": "AQredactedFB-",
            "file_size": 172225,
            "width": 909,
            "height": 1280
          }
        ]
      }
    }
  ]
}
cotestatnt commented 2 years ago

Hi @palmerabollo No, the library currently support only images. Document and other binary types is still in development.

Check the examples sendPhoto.ino or the examples specific for ESP32-CAM if you have one of this board.