简体   繁体   English

如何在电报机器人中看到来自 java web 应用程序的 POST 请求

[英]How can I see in telegram bot incoming POST request from java web app

I have a web application.我有一个 web 应用程序。

I'm sending some photo to telegram bot using:我正在使用以下方式向电报机器人发送一些照片:

https://api.telegram.org/<token>/sendPhoto.

By executing this command from my web app, bot receiving image.通过从我的 web 应用程序执行此命令,机器人接收图像。

How can I make bot react on this incoming events?如何让机器人对这些传入事件做出反应?

Unfortunately, you can only use query strings with the availed methods to send messages/photos from a bot to a specified user ie不幸的是,您只能使用带有可用方法的查询字符串将消息/照片从机器人发送到指定用户,即

https://api.telegram.org/bot<token>/sendMessage?chat_id=<id>&text=<string>

Hitting the endpoint below opens your bot in the telegram web app which is not helpful in your situation点击下面的端点会在电报 web 应用程序中打开您的机器人,这对您的情况没有帮助

https://telegram.me/<botNname>?start

Bottom line is that you cannot send updates to a bot using a URL,底线是您不能使用 URL 向机器人发送更新,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何回答 Java 电报机器人中的回调? - How can I answer to callback in Java telegram bot? Spring / Java Web:如何知道请求是表单发布? - Spring/Java web: how can I know a request is a form post? 如何将电报机器人从 intellij 部署到 heroku? 我使用 maven 项目中的 Java 编写代码 - How can I deploy a telegram bot from intellij to heroku? I write the code using Java from a maven project 如何在 java 中将电报消息从私人机器人重定向到我的机器人 - How to redirect telegram messages from private bot to my bot in java 在 Java 应用程序中连接到 Telegram Bot API 时如何修复 SocketException - How to fix SocketException while connecting to Telegram Bot API in Java App 在哪里可以看到Java Web Start应用程序中引发的异常? - where can I see exceptions thrown from within a java web start app? 如何使用Java为电报Bot键盘编写一组自定义的命令? - How can I code a customized set of commands for a Telegram Bot Keyboard in Java? 如何从 java 中的电报机器人获取用户的输入? - how to get an input from user from telegram bot in java? 我想要为我的 java 编码的 Telegram bot 使用粗体文本,如何? - I want Bold text for my java coded Telegram bot, how? 如何获取上一条消息(使用 JAVA 的 Telegram Bot) - How do I get the previous message(Telegram Bot using JAVA)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM