Send to telegram multiple photos

Hello everyone, please help me with accepting multiply files in telegram bot, i send 8-10 files at once, then i need this files to be pairs, first file with second, second with third and so on, then all pairs tiil last should be sended to Ai, to create video from this photos, then all created videos should be sended to telegram with approve all of them, if yes → remains, if button no → remake and resend.

I developed project like this but without media group, with sending 1 photo, one by one.

I dont ask help me with all bot, but at less for one part of it.

God bless you.

my client developes stands in photoshop, and wants that stand to be video 360*, for this reason he opens kling.ai and put photos there for make video, also sorry for my language im not native speaker), and so, he wants me to develope telegram bot, where he will send 9-10 files with stand and all files will go to AI, and should be covered to video, but how? imagine you have 2 photo of your head, from 2 sides, you put them to AI, and AI should make smooth fly of your head, so our stand is same.

What we need is when i send to telegram bot 10 files, it accept it like mediagroupid, not like every file separetely, we need bot to accept all 10 files in best rezolution and send them in pairs, first photo with second should be sended to AI, second photo with third should be sended to AI, for what? for developing fly of ALL of sides of stand, i exactly need to send all files at once, then they should be organized in pairs as I said at the top, first file with second, second with third and so - on, i have a trouble with accepting massive with files, i could develope such bot, but with 1 file sending. help please

if you my brother have questions, ask please.

Hey @shoma757 !

Here you can find a free template that deals with the media_group_id and multiple types of files… is a great example !

In essence, you have to store somewhere (in any DB , even Data Tables) , the media_group_id and the files, then download and process.

Anyway, there are several ways to get your flow done.

Check here this great info(i am not the author) :

Copy and play with that!

Cheers!

Wow, this workflow is so big, thank you a lot Parintele, as i got you have different ways to solve my problem, could you share or explain all ways? thank you bro

1 Like

I meant more “nodes/ways” to accomplish …

But the principle is the same, store the media_group_id and the relevant files ids, then download, and send them to AI.

Try, and if you get stucked… some of us may jump and help you.

But i consider that the workflowi shared, is more than enouch to get it done.

:slight_smile: Cheers!

im not a senior in n8n, so i didnt get workflow, i need send to telegram bot 10 files with a numbers, like 1,2,3,4,5,6,7,8,9,10 it should be separeted into pairs, first photo should be taken and go to kling ai to become in a video, second with third and so on. but mediagroup id doesnt give me to do this. i have managers that will work with my bot, 5-10 persons, they should send files as i said and video should come to them, if manager liked video, he can tap good under video, if not, this exactly video should be processed again and should be resended, im russian so i wish you got me.

Hey!

Then the workflow example I sharedrd with you is exactly what you need.

Let me explain you so you can understand:

“media_group_id” will hold all the images that 1 user is sending at once!

So, your workflow will run 10 times(assuming is sending 10 images), if there are multiple users, you can multiply to understand the amount of times your trigger has to run.

With every execution, you will get Media_group_id/file_id/file_path (this you have to save in DB), after you can take 2 by 2 from that DB, and send to KLing.

If you don’t understand this crucial things, then I suggest to start building, and ask for help, otherwise this is more a job, since is not just 5-6 nodes, there is a lot of logic behind and concurrency (as example Google Sheet will fails with som many requests as Trlegram sends if 10 users send in the same time 10 images, would be 100 executions in a very short time)… And this is just only one aspect.

Will try when I reach my PC to make a starting point for you, but there no “plug & play” workflow for you outhere.

Cheers!

oh bro, you are one of the rare ones who really wants to help

buuut, even your statement that it is the very thing i need, i couldnt understand how mediagroup id could extract files if it is doesnt contanin files, but contains id.

when i send my files to bot, telegram trigger retrieves this:

[
{
“update_id”: 908452590,
“message”: {
“message_id”: 1577,
“from”: {
“id”: 7620660514,
“is_bot”: false,
“first_name”: “Шамиль”,
“username”: “Shoma757”,
“language_code”: “ru”
},
“chat”: {
“id”: 7620660514,
“first_name”: “Шамиль”,
“username”: “Shoma757”,
“type”: “private”
},
“date”: 1765709165,
“media_group_id”: “14125673319873554”,
“document”: {
“file_name”: “3.png”,
“mime_type”: “image/png”,
“thumbnail”: {
“file_id”: “AAMCAgADGQEAAgYpaT6VbLUjkt08-vbEQ5APNgoVOz0AAt2OAAJKFPFJSofBhJyFhdMBAAdtAAM2BA”,
“file_unique_id”: “AQAD3Y4AAkoU8Uly”,
“file_size”: 9455,
“width”: 320,
“height”: 180
},
“thumb”: {
“file_id”: “AAMCAgADGQEAAgYpaT6VbLUjkt08-vbEQ5APNgoVOz0AAt2OAAJKFPFJSofBhJyFhdMBAAdtAAM2BA”,
“file_unique_id”: “AQAD3Y4AAkoU8Uly”,
“file_size”: 9455,
“width”: 320,
“height”: 180
},
“file_id”: “BQACAgIAAxkBAAIGKWk-lWy1I5LdPPr2xEOQDzYKFTs9AALdjgACShTxSUqHwYSchYXTNgQ”,
“file_unique_id”: “AgAD3Y4AAkoU8Uk”,
“file_size”: 221525
}
}
}
]

and here only one file, not all files i sent, so if i put mediagroip id to data table, it is not give me any benefit. i can even pay you))

Exactly! It contains the media_group_id and the file_id for each file(since one execution, one file with several versions).

Save the media_group_id and file_id in any DB as references for later use (when you build the URL for the AI Image .

Contact me in DM, so I can follow messages and not topics where I am not mentioned.

I am in migration process at the moment, and my instances are not working. But I will help you get trough this, Don t worry.

:slight_smile:

Broo) thank you, write me to telegram @Shoma757 or insta @shamilbadalashvili or whatsapp +77021210540

or give me your contacts)