1

So I'm trying to build a mobile application that logs users in using telegram authentication API. They can register their channels in the app for inviting other users or they can join other users channels.

After searching for the best implementation, I came across MadelineProto Library As I'm using Laravel. I am going to use this library in the server side of my app to be able to use telegram API. I want to use my telegram account to get API ID and API HASH once and let other telegram users to log in to my app using their telegram account.

As you may have noticed, I won't need many features of the library like updates.

So, Is it a good idea to use this library for my app? or is there a better way?

By The Way, As you know, Telegram API is using Mtproto encryption Protocol and using it directly is almost impossible for me.

reza z
  • 11
  • 2

1 Answers1

0

You can definitely use MadelineProto or TelegramApiServer (MadelineProto based http micro-service) for authorising users in telegram and managing their accounts.

But session startup and initial key exchange with TG servers can take up to 30 seconds and it is CPU heavy operation.

So madelineProto start background workers. Each session is always connected and ready to serve requests. But it will consume 50+ Mb of RAM/session.

So there is two options:

  1. have huge amount of RAM and keep all sessions running;
  2. start sessions for each request and waste 5-30 seconds per request.

If you dont need real channels i suggest you to use regular bot api. So users can create "channels" and subscribe to other "users" inside your bot. And bot forward messages from users to subscribers. This is sounds like simple chat with rooms.

Xtrime
  • 1