wiz0u / WTelegramClient

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

Is this library supposed to be run on a server? #193

Closed oliverw closed 11 months ago

oliverw commented 11 months ago

Given all the manual prompting and stuff, I have a hard time imagining how this is supposed to work when running on a server. Care to elaborate?

MrAliSalehi commented 11 months ago

yes you "can" run this on the server if you want to, you could have an API which handles auth and prompts. or even connect it to a telegram bot :D please take a look at this example

wiz0u commented 11 months ago

The simplest way to run this on a server is to setup it first on a workstation, answering the login/verification prompts. Then you can move the generated WTelegram.session file onto the server (move it, do not copy this file, it should only be used by one program at a time). And your server can use that session file to be automatically logged onto a specific user without the need to manually log-in each time. (Read the README for further info)

oliverw commented 11 months ago

The simplest way to run this on a server is to setup it first on a workstation, answering the login/verification prompts. Then you can move the generated WTelegram.session file onto the server (move it, do not copy this file, it should only be used by one program at a time). And you server can use it to be automatically logged onto a specific user without the need to manually log-in. (Read the README for further info)

Thanks for the quick reply. That's what I THOUGHT it would work like but since I have no knowledge of the key lifespans, if there are refresh tokens and other stuff involved, I wanted to make sure.

wiz0u commented 11 months ago

No refresh stuff. Once logged-in, your session should be good forever (until you log off or the user terminate that session)

oliverw commented 11 months ago

No refresh stuff. Once logged-in, your session should be good forever (until you log off or the user terminate that session)

Got it. Thanks.