wiz0u / WTelegramClient

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

`client.LoginBotIfNeeded(ApiKey)` not work #180

Closed EgoPingvina closed 1 year ago

EgoPingvina commented 1 year ago
using var client = new WTelegram.Client();
await client.LoginBotIfNeeded(this.settings.ApiKey);

But it keeps asking me for some more hash: Enter api hash:

EgoPingvina commented 1 year ago

I tried to take it from https://my.telegram.org/apps, but now it takes me this error. image

wiz0u commented 1 year ago

If you need to control a Telegram bot, I highly recommend Telegram.Bot library (Bot API).

You can also control a bot using WTelegramClient, but it's much more complex and you will be limited to a small subset of API methods marked with [bots:✓] in Intellisense description. (same kind of limitations as through the Bot API)

In particular, you can't schedule messages with bot accounts.

API Hash/ID is required to use Client API (on WTelegram.Client constructor), even if you want to control a bot. Then, to start your bot session, call LoginBotIfNeeded with bot_token (not API hash)

github-actions[bot] commented 1 year ago

Github Issues should be used only for problems with the library itself. For questions about Telegram API usage, you can search the API official documentation or click here to ask your question on StackOverflow so the whole community can help and benefit.