skip to Main Content

I am using python to send photos and images to telegram and when i send 1 image or video everything works fine. i have tried to send 2 and more videos/images. but telegram returns bad request: can't parse media JSON object. Parsed data:

{
    'chat_id': 123456781, 
    'caption': 'test', 
    'media': [
           {
                'type': 'video', 
                'media': 'attach://video0'
           }, 
           {
                'type': 'video', 
                'media': 'attach://video0'
            }
    ]
}

what is wrong with json?

2

Answers


  1. Chosen as BEST ANSWER

    Found what was the problem, problem was with attached files. added file url instead 'media': 'attach://video0' like 'media': 'fileurl'


  2. I had the same error on editMessageMedia method. It turned out that this method accepts media not as object, but as serialised string.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search