gpt4 book ai didi

c# - Telegram bot - 向/启动命令添加唯一键

转载 作者:行者123 更新时间:2023-11-30 17:31:18 25 4
gpt4 key购买 nike

我试图通过添加到 /start 命令的一些唯一 key 来识别每个用户。对于每个用户,我将生成一些 key ,并向用户显示 URL。这在官方文档中一步步描述https://core.telegram.org/bots#deep-linking

用户链接的格式为:

https://telegram.me/ExampleBot?start=uniqueKey

它在 Telegram 应用程序中完美运行。问题是,在浏览器中打开时,只有“开始”按钮可见。当用户点击时,uniqueKey 不会发送给机器人。

如何将 uniqueKey 添加到/start 命令以使其在 Telegram 网络应用程序中也能正常工作?生成的 URL 应该是什么样子? 这样用户就可以直接点击,而不需要编写代码?

最佳答案

将你的 uniqueKey 设为 Base64 并再次测试......

Based on Telegram documents it is recommended to using base64url to encode parameters with binary and other types of content.

关于c# - Telegram bot - 向/启动命令添加唯一键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48126811/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com