A
A
Alexander Sankov2021-09-28 20:58:29
Python
Alexander Sankov, 2021-09-28 20:58:29

How to write a bot in VK for photo editing?

I want to write a bot that will add a picture to the picture through a pillow
. The picture that will always be ready at the bottom, but the picture that will be at the top must be sent by the user from the conversation, like "take a photo *attaches a photo*" and the bot sends the edited photo back with words on hold

I already have a code in which you insert a photo and you get what you need
and a code with a bot that, apart from saying hello to the bot hello, nothing knows how
to cross them well, in general, you need to cross them

How to write please help (((

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-09-28
@astalingrad2015

How, how - take and write!
What library do you use to work with VK chats? You open its documentation, look for message processing, learn to extract attached images. If you can't extract it as a file, then at least as a URL.
If the photo is a URL, then further, depending on which VK library you use. If the bot is synchronous - download the image via requests, if it is asynchronous - via aiohttp. One way or another, you will have the contents of the image file, and feed it to Pillow.
At the end, you again climb into the documentation for either VK, see how to attach a file to a message. You use it to give the user the processed photo.
They won’t write the code for you here anyway, so if you need details, try to write it yourself, and come with what you already wrote.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question