In the section of telegram InputMediaDocument I am not getting how can I upload file using multipart? At what palce should I place the blob of my file? The parameters go as follows:
type:String,
media:String,
thunb:Input File/String,
.
.
.
and so on...
How can I upload my file at media as String? In the description it says
Pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. What is the meaning of <file_attach_name>?
Update: I found out that it was very easy! Structurize your data as:
const data = [
{type':document,'media':'attach://file1'},
{type:'document',media:'attach://file2',caption:"This is file 2"},
{type:'jpg',media:'attach://photo',caption:"This is a photo"},
{type:'video',media:'attach://video',caption:"This is a Video"}
];
const postData = {
method: "sendMediaGroup",
chat_id: String(chat_id),
media: JSON.stringify(data),
file1:blob,
file2:blob1,
photo:blob3,
video:blob4
}
Try this and you'll get the results!