使用 URL 重定向站点阻止电报链接预览 [英] Preventing Telegram Link Previews using a URL redirect site

查看:54
本文介绍了使用 URL 重定向站点阻止电报链接预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有一个输出 URL 的电报机器人,但每次机器人发送 URL 电报时都会创建一个链接预览.我想出的一个解决方案是通过 URL 重定向服务或网站传递此 URL 以中断链接预览.是否有 url 重定向服务,我可以在其中附加一个 URL 参数,它将重定向到该站点?

Currently I have a telegram bot that outputs a URL, but everytime the bot sends a URL telegram creates a link preview. One solution I came up with was pass this URL through a URL redirect service or website to break the link preview. Is there a url redirect service where I can append a URL parameter where it will redirect to that site?

我可以编写自己的 php 脚本来解析 URL 参数,但如果服务已经存在,我宁愿使用它.

I can code up my own php script that parses the URL parameter, but if a service already exists I rather use that.

推荐答案

您可以在使用 sendMessage 方法时将 disable_web_page_preview 属性设置为 true.

You can set disable_web_page_preview attribute to true when using sendMessage method.

它将禁用此消息中链接的链接预览.

It will disable link previews for links in this message.

https://core.telegram.org/bots/api#sendmessage

这篇关于使用 URL 重定向站点阻止电报链接预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆