Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why extra call to API for getUser()? #76

Open
yarkm13 opened this issue Apr 11, 2020 · 1 comment
Open

Why extra call to API for getUser()? #76

yarkm13 opened this issue Apr 11, 2020 · 1 comment

Comments

@yarkm13
Copy link

yarkm13 commented Apr 11, 2020

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

@feralheart
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants