T
T
tolik00762021-08-12 22:52:49
Java
tolik0076, 2021-08-12 22:52:49

How to send a photo to a Telegram bot user?

I am writing a telegram bot in Java. I want to implement that the user clicked on the button, and he received a picture in response. Please advise how it can be implemented. There is a lot of content for several gigs. (Can I implement it through the database?) Or how is it possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
etozhesano, 2021-08-13
@etozhesano

There is a sendPhoto method, see the docs where everything is clearly written on this topic.
Your main difficulty is of course the amount of content. I don't remember exactly how many photos you can attach in 1 message, but let's say it will be 10. Then if you have thousands of photos, you will need to send several hundred messages.
How to improve it? Don't know. As an option, come up with something else, and not upload a million photos to a cart (for example, upload to some cloud / hosting and already give links to photos / albums)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question