unreal4u / telegram-api

Complete async capable Telegram bot API implementation for PHP7
https://github.com/unreal4u/telegram-api/wiki
MIT License
791 stars 174 forks source link

Bot API 6.6 Thumbnails renaming + other changes #152

Closed DJTommek closed 1 year ago

DJTommek commented 1 year ago

Bot API 6.6 Thumbnails renaming (899bcb3f7e820d1d5b121f16cbacdb2e3c452149)

Telegram API is currently (2023-09-10) backward compatible:

Other updates

unreal4u commented 1 year ago

Nice one, thank you very much!

The only doubt I'm having is https://github.com/unreal4u/telegram-api/pull/152/files#diff-95153b05bc15eeb973f900cf269174a0f71427b1936dd00cba83bb844c344c54 but if this was previously incorrect, then we can ignore and just launch it.

I can see no mention on https://core.telegram.org/bots/api#poll on this having changed so I do believe this was a typo. In that case I can just launch a minor version.

Kudos for maintaining BC with the thumb -> thumbnail renaming! Elegant solution :)

DJTommek commented 1 year ago

The only doubt I'm having is https://github.com/unreal4u/telegram-api/pull/152/files#diff-95153b05bc15eeb973f900cf269174a0f71427b1936dd00cba83bb844c344c54 but if this was previously incorrect, then we can ignore and just launch it.

I can see no mention on https://core.telegram.org/bots/api#poll on this having changed so I do believe this was a typo. In that case I can just launch a minor version.

I was wondering about that change too, but don't know if they silently changed it or we did it wrong in this library. Anyway, here is snippet how update JSON looks like now, having allows_multiple_answers so no doubt:

{
  "update_id": 123456789,
  "message": {
    "message_id": 12345,
    "from": {
      "id": 148953285,
      "is_bot": false,
      "first_name": "DJTommek",
      "last_name": "[Tomas Palider]",
      "username": "DJTommek",
      "language_code": "en"
    },
    "chat": {
      "id": -123456789,
      "title": "test group",
      "type": "group",
      "all_members_are_administrators": true
    },
    "date": 1694419154,
    "poll": {
      "id": "1234567891234567891",
      "question": "some random question",
      "options": [
        {
          "text": "answer 1",
          "voter_count": 0
        },
        {
          "text": "option 2",
          "voter_count": 0
        },
        {
          "text": "another 3",
          "voter_count": 0
        }
      ],
      "total_voter_count": 0,
      "is_closed": false,
      "is_anonymous": false,
      "type": "regular",
      "allows_multiple_answers": true
    }
  }
}