python - Bot 在命令后等待消息,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) :)
解决方案
推荐阅读
- android - 使用 dagger hilt for android 解决在 BroadcastReceiver 中注入的上下文的问题
- firefox - 如何从终端访问 Firefox 插件
- node.js - 无法使用 GraphQLNonNull“[用户]!” 从另一个模块或领域
- wpf - 如何使用通用枚举填充 WPF 组合框以列出
功能 - python - buildozer docker容器无法编译sdl2(cpufeatures)
- git - git delete/prune 远程上的死提交
- c - 缺少新的环境变量
- django - Django模板>点击按钮检查条件
- java - intellij ulltimate 2020.2 无法识别基本注释?
- python - 如何拆分,然后在 0 和第 N 个值之间附加 Array,然后在下一组中重复相同的步骤?