使用php bot在电报上发送带有照片的长消息 [英] send long message with photo on telegram with php bot

查看:41
本文介绍了使用php bot在电报上发送带有照片的长消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将带有照片的长文本发送到电报,但电报图像标题有 200 个字符的限制.如何使用php和bot发送带照片的长文本?sendPhoto 方法有 200 个字符的限制.我看到一个电报机器人,它会发送长文本和照片,请参阅我的示例照片.

I need send to telegram long text with photo but telegram image caption has 200 character limit. How can send long text with photo using php and bot? sendPhoto method has 200 character limit. I see a telegram bot it's send long text and photo see my sample photo.

推荐答案

可以使用空字符!

只需在 sendMessage 方法中将 parse_mode 字段设置为 HTML ,然后在 text 字段中将图片的 URL 插入到 href

Just set parse_mode Field to HTML in sendMessage method , then in text Field insert the URL of the image into href

当您使用空字符时,将看不到超链接:

The hyperlink will not be seen when you use empty character :

<a href="https://www.nafasbekesh.ir/wp-content/uploads/2016/10/img1.jpg">
⁠</a>

复制空字符供自己使用.

这篇关于使用php bot在电报上发送带有照片的长消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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