0

As the title says, I am trying to have my GroupMe bot post images to the group along with some text. Here is my current code:

post_params = {'bot_id': '123456789',
               'text': message,
               'attachments': [
                 {
                 'type': 'image',
                 'url': 
        'https://i.groupme.com/528x623.jpeg.9b4f8da8a4304882bcb485a06dbcc403'
                 }
                ]
               }
requests.post('https://api.groupme.com/v3/bots/post', params=post_params)

The bot posts the text but does not post the image as well.

1 Answers1

1

I had a similar problem! There's a parameter in the request body called 'picture_url' for posting images. Try:

post_data = {'text':YOUR_TEXT, 'picture_url':YOUR_PIC_URL}

requests.post('https://api.groupme.com/v3/bots/post', params = post_params, data = post_data)