[英]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:我正在尝试使用 ""python-telegram-bot"" 创建一个电报机器人,以帮助用户在以下步骤中重置一些密码:
user send "/start" to start the bot用户发送“/start”来启动机器人
bot replies with "enter username"机器人回复“输入用户名”
user enters their username用户输入他们的用户名
bot asks for user id机器人询问用户 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..该机器人无法同时处理多个用户,这意味着,如果用户输入他的姓名“A”然后输入他的用户 ID,如果另一个用户“B”启动机器人并输入他的姓名,它将发生冲突并询问用户“A”又要他的身份证了。。
how can i handle this我该如何处理
Helo when you do action to Func downloader updater.dispatcher.add_handler(MessageHandler(Filters.document, downloader))当您对 Func 下载器 updater.dispatcher.add_handler(MessageHandler(Filters.document, downloader)) 执行操作时,Helo
like this one do another Fuc def() inside downloader像这样在下载器中执行另一个 Fuc def()
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))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.