机器人在命令后等待消息,Telepot

时间:2021-07-12 08:17:12

标签: python telepot

我正在使用 Telepot 开发我的机器人。 机器人运行良好,但我有一个问题要问你。 有没有办法向机器人发送消息并得到答复?让我展示

这是我想要的行为,但我知道这是不正确的

if command == "/gen":
     
     bot.sendMessage(chat_id, "Please send me your link")



     link = command   #message sent after the request ("please send me link")

     sale = generate(link)   #generate is my function which creates amazon sales

好的,问题就在这里,所以在这种情况下,我只是要求提供一个链接,但如果我这样做了

link = command

我有旧命令“/gen”。

所以,至少,这是我想在我的机器人中开发的:

user :   "/start"
bot:   "Hi send me your link"
user:   "www.amazon.com"  #general product in this case)
bot:  "this is your sale -> (message with links and photos) :)

0 个答案:

没有答案