the same time using a bot
I first did it with only one client which I defined it globally and used it in my bot.
But now I want to have multiple clients at the same time and shouldn't be globally defined so the session file will not be overwritten.
I tried to use StringSession for that purpose but it wouldn't save any file but I want to have the files with the user id which I will add it to my clients dictionary so I can access them while the bot is working.
Does anybody know how to create the session files with different names rather than using string session?
First argument you pass to TelegramClient() is the filename
Yes I know! What I'm saying is for example I am using the bot and someone else is trying to use the bot as well so the session files should differ in their names and this should be automatic for any user that is using the bot Cuz I am authorising each user through the bot, So obviously I cannot create like 100 clients inside the code Or idk if it's possible to do that or not
Обсуждают сегодня