c# - Telegram API (not Bot!): How to get chat/channel ID by link to it? -
i'm using library tlsharp on c# , writing telegram client, , @ moment got stuck.
i have link chat/channel, instance, https://t.me/joinchat/some-string, , i'd info chat/channel or join it. can having chat_id, don't know how get.
firstly thought contacts.resolveusername , passing "some-string" link. doesn't work, saying username invalid.
is there way id of group? , on purpose make complicated info groups?
thanks
well, i've found solution (partial, see end). i'm using this schema, let know.
first of need send rpc messages.checkchatinvite parameter hash set last part of link ("some-string" in case).
a response of type tlchatinvite arrives. contain primary info group: it's type (chat or channel?), participant count and, if you're lucky, vector.
(this point below problem of mine)
- call rpc messages.importchatinvite same parameter hash. returns tlupdates or tlupdatescombined object, contain vector of tlchat objects. need use first (don't forget check vector emptiness, though, in case).
however, messages.importchatinvite make current user join group. how id of group without getting joined haven't got clue. though, thing fit client.
frankly said, i'm disappointed consumed time such trivial thing.
Comments
Post a Comment