开放电报机器人聊天无启动命令

发布于 2025-02-06 12:39:52 字数 521 浏览 0 评论 0原文

电报机器人如何在没有启动命令的情况下打开自机器人聊天,在andercallbackquery方法中响应内联按钮?

这打开了bot的聊天,但是将“/start”附加到聊天中,

https://t.me/<bot-name>?start=<start-parameter>

这是一个打开bot的聊天,而无需附加“/start”。但是在我看来,比正确的方法更像是一个错误。

https://t.me/<bot-name>?start=a:b

此其他报告url_invalid:

https://t.me/<bot-name>?start=
https://t.me/<bot-name>?start
https://t.me/<bot-name>?
https://t.me/<bot-name>
https://t.me/<bot-name>/

How can a telegram bot open self bot chat without start command, in answerCallbackQuery method, responding to inline buttons?

This opens bot's chat, but appends "/start" into chat

https://t.me/<bot-name>?start=<start-parameter>

This one opens bot's chat without appending "/start". But seems to me more of a bug than a correct way.

https://t.me/<bot-name>?start=a:b

This other ones report URL_INVALID:

https://t.me/<bot-name>?start=
https://t.me/<bot-name>?start
https://t.me/<bot-name>?
https://t.me/<bot-name>
https://t.me/<bot-name>/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

来世叙缘 2025-02-13 12:39:53

不可能使用命令而不是/start重定向到机器人的聊天。机器人URL中唯一接受的2个参数是:

  • start用于启动私人聊天中的bot,
  • startgroup startgroup 允许用户选择一个组来启动该组bot in。

还有一些需要注意的东西:它们的值将在/start之后的空间之后附加。例如,如果您的URL为t.me/yourbot?start=A,则您的机器人将获得文本/start a的消息。

It is not possible to redirect to the bot's chat with a command rather than /start. The only 2 parameters that are accepted in the bot URL are:

  • start which is for starting the bot in private chat, and
  • startgroup which lets the user choose a group to start the bot in.

And there's something to be aware of: Their values will be appended after a space after the /start. For example if your URL is t.me/yourbot?start=a, your bot will get a message with the text /start a.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文