driver-telegram icon indicating copy to clipboard operation
driver-telegram copied to clipboard

Why extra call to API for getUser()?

Open yarkm13 opened this issue 5 years ago • 1 comments

Method getUser() in TelegramDriver issue getChatMember telegram API call. Why fire 'expensive' by time API call while Telegram provides from entry in each call which is enought in most cases?

    "from": {
        "id": 000000,
        "is_bot": false,
        "first_name": "fname",
        "last_name": "lname",
        "username": "username",
        "language_code": "en"
    },

I think it must extract that information and may be implement in BotMan\Drivers\Telegram\Extensions\User getters for additional data, provided by getChatMember and call API only if one of additional fields is requested

yarkm13 avatar Apr 11 '20 17:04 yarkm13

Because the from is an optional param. It's empty when the message comes from a channel.

As I see the driver only uses the 'user' entry of the getChatMember result what's the same User object as the message's from entry, so yes it would be an enchancement in the driver if someone adds this functionality.

feralheart avatar May 19 '20 08:05 feralheart