tdl icon indicating copy to clipboard operation
tdl copied to clipboard

How to use with many bots

Open Exlord opened this issue 5 years ago • 5 comments

Hi, I have bot management system with nodejs, I want to use this lib to increase file upload/download limit for my bots ...

I saw the multi account example but there is warning in the comments ...

So practically how many clients can I create ? whats the best way to use this with 1000+ bots?

Exlord avatar Feb 06 '20 07:02 Exlord

whats the best way to use this with 1000+ bots?

The best way would be to write a node.js addon in C++ that uses the TDLib's ClientActor API directly.

eilvelia avatar Feb 07 '20 18:02 eilvelia

whats the best way to use this with 1000+ bots?

The best way would be to write a node.js addon in C++ that uses the TDLib's ClientActor API directly.

don't really khow much c++, can I create like 5 clients and keep them connected but login/logout with each one whenever needed?

Exlord avatar Feb 08 '20 06:02 Exlord

You can create a new client when you need to login and destroy it when you need to logout

Loskir avatar Feb 24 '20 17:02 Loskir

You can create a new client when you need to login and destroy it when you need to logout

Is that ok? for performance ?? Isn't creating a new client heavy on load and resources?

Exlord avatar Mar 07 '20 08:03 Exlord

tdlib is already heavy by itself, it takes ~3 seconds for a client to be created. so it may be not ok to create a large amount of clients.

Loskir avatar Mar 07 '20 08:03 Loskir