Arman92 / go-tdlib

Golang Telegram TdLib JSON bindings
GNU General Public License v3.0
436 stars 100 forks source link

How to call high-level methods? #12

Closed munknex closed 5 years ago

munknex commented 5 years ago

Is it possible to call high-level methods?

Like contacts.getStatuses.

munknex commented 5 years ago

@Arman92 As far as I can see, code is generated only for td_api.tl and not for telegram_api.tl.

Is there any workaround to call a method from telegram_api?

Arman92 commented 5 years ago

As far as I know, you can only call methods from tdlib api, not the legacy telegram api (i.e. mtproto protocol).

Why would you want to use the legacy methods? Telegram Tdlib has a complete set of methods for every use case.

zelenin commented 5 years ago

all wrong. tdlib is high-level wrapper over low-level mtproto. So mtproto is not legacy.

Arman92 commented 5 years ago

all wrong. tdlib is high-level wrapper over low-level mtproto. So mtproto is not legacy.

Ok, I misunderstood. but I don't think you can call low level mtproto methods over tdlib.

zelenin commented 5 years ago

Ok, I misunderstood. but I don't think you can call low level mtproto methods over tdlib.

sure

munknex commented 5 years ago

@Arman92, @zelenin Please take a look at tdlib's GetContactsStatusesQuery class. It is used to get statuses by tdlib's ContactsManager using contacts.getStatuses method from telegram_api.tl.

tdlib automatically generate code from both td_api.tl and telegram_api.tl. Generated code can be found in your ./td/generate/auto/td/telegram/.

So I think it should be possible to use this api too. Any thoughts?

zelenin commented 5 years ago

So I think it should be possible to use this api too.

Why do you think so?

Arman92 commented 5 years ago

Tdlib json bindings library offers only the methods it declares in td_api.tl.

I'm closing this issue, if you think otherwise please do share with us.