send long message with photo on telegram with php bot
Asked Answered
T

4

8

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.

this is a sample image send to telegrem

Tapeworm answered 19/9, 2016 at 10:56 Comment(0)
A
11

You can use empty character!

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>

Copy the empty character for your own use.

Arduous answered 18/11, 2016 at 0:45 Comment(1)
It's important to note that the anchor tag must be at the very beginning of the message.Bahadur
J
6

You can send standard message with parse_mode Markdown or HTML. In text content you need send link to your image. https://core.telegram.org/bots/api#markdown-style

Some words [/start](https://www.google.ru/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png)
ok.
You will see google's logo in the bottom of message. The blue line on the left of the image indicates that it is the parsing contents of the link
Jaimie answered 20/9, 2016 at 11:25 Comment(2)
Thank you dear Dmitry I use your method before but when use /start display start word on my message I want not display it and only display image and my messageTapeworm
You can set some other characters as link text. How I can get equal message with 50% image to debug?Jaimie
A
4

You can send text message with Markdown Style or HTML Style and use inline URLs.

sample of inline URLs format:

[inline URL](http://www.example.com/)

You can use (ALT + NUMPAD characters) for hide link text.

For Example [ALT + 255] create non-breakable space which you can use this.

[ ](http://www.example.com/)

If you have many link in the text, Put your image link at the beginning of the text.

Anethole answered 9/4, 2018 at 17:35 Comment(0)
L
0

You can use (ALT + NUMPAD characters) for hide link text.

For Example [ALT + 255] create non-breakable space which you can use this.

but in this case i receved the following error

PHP Warning: : failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

Limekiln answered 8/4, 2019 at 19:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.