简体   繁体   中英

telegram bot that can handle multiple users at the same time - python

I'm trying to create a telegram bot using ""python-telegram-bot"" that help user to reset some passwords in the below steps:
user send "/start" to start the bot
bot replies with "enter username"
user enters their username
bot asks for user id
after verfication
bot asks user to enter his pass
and change the password for this user,
HOWEVER

the bot cannot handle multiple users at the same time, means, if user enters his name "A" and then enter his user id, if another user "B" started the bot and entered his name it will conflicts and ask user "A" for his id again..

how can i handle this

Helo when you do action to Func downloader updater.dispatcher.add_handler(MessageHandler(Filters.document, downloader))

like this one do another Fuc def() inside downloader

def downloader(var,var):
        def again_def(var,var):

           return blabla

        t2 = threading.Thread(target=again_def,args=(var, var))
        t2.start()

if __name__ =="__main__"
      updater.dispatcher.add_handler(MessageHandler(Filters.document, downloader))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM