简体   繁体   English

可以同时处理多个用户的电报机器人 - python

[英]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.

相关问题 在python中处理Telegram机器人的多个问题 - Handle multiple questions for Telegram bot in python 如何在电报机器人中同时管理多个用户请求? - How to manage several users requests at the same time in a telegram bot? (Python) 如何使 discord 机器人响应能够同时响应多个用户 - (Python) How to make discord bot respond able to respond to multiple users at the same time Python 电报机器人,如何为每个用户存储和显示用户数据? - Python telegram bot, how to store and show users data for each users? 如何在 python-telegram-bot 中接收来自用户的消息? - How can I receive messages from users in python-telegram-bot? 为什么带有 Webhook 的 Python 上的电报机器人不能像带有长轮询的机器人那样同时处理来自许多用户的消息? - Why telegram-bot on Python with Webhooks can't process messages from many users simultaneously unlike a bot with Long Polling? 如何实现多个用户同时使用 Telegram bot? - How to implement the simultaneous use of the Telegram bot by multiple users? 如何实现可处理多个输入步骤的Telegram机器人程序? - How to implement a Telegram bot program that could handle multiple steps of input? Python Telegram Bot 仅适用于我,不适用于其他用户 - Python Telegram Bot works only for me, not for other users python-telegram-bot 仅在命令后处理消息 - python-telegram-bot handle message only after command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM