wiz0u / WTelegramClient

Telegram Client API (MTProto) library written 100% in C# and .NET
https://wiz0u.github.io/WTelegramClient/
MIT License
956 stars 156 forks source link

TL.RpcException: 400 USER_ID_INVALID #269

Closed graysuit closed 1 month ago

graysuit commented 1 month ago

I use Channels_InviteToChannel but it asks for access_hash. How do I suppose to get access_hash if I never interacted with bot before ?

Note that I'm admin of channel. Also have bot's token. I can do that manually using telegram app.

What I tried:

Dim BotFullUser = Await Client.Users_GetFullUser(New InputUser(BotId, 0)) 
'FAILS HERE
'TL.RpcException: 400 USER_ID_INVALID

Dim BotUser = New InputUser(BotId, BotFullUser.users.ElementAt(0).Value.access_hash)
Dim Ch = "{channel_id}:{channel_hash}".Split(":")
Await Client.Channels_InviteToChannel(New InputChannel(Long.Parse(Ch(0)), Long.Parse(Ch(1))), BotUser)
wiz0u commented 1 month ago

don't ask the same question both here & SO

github-actions[bot] commented 1 month ago

Please note that Github issues should be used only for problems with the library code itself.

For questions about Telegram API usage, you can search the API official documentation and the full list of methods. WTelegramClient covers 100% of the API and let you do anything you can do in an official client.

If the above links didn't answer your problem, click here to ask your question on StackOverflow so the whole community can help and benefit.

graysuit commented 1 month ago

Sorry for creating duplicate

Issue solved. Thank you!

Linking, might be helpful for others: https://stackoverflow.com/a/78788121