From f99b1da52aecdeaedb75d23390c41f0865ed4b81 Mon Sep 17 00:00:00 2001 From: Florent Espanet Date: Thu, 15 Jan 2015 12:22:42 +0100 Subject: [PATCH] Add media_ids parameter to update_status. `statuses/update` now support the parameter `media_ids`. It makes it possible to update a status with an attached media. See also : [doc](https://dev.twitter.com/rest/reference/post/statuses/update) --- tweepy/api.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tweepy/api.py b/tweepy/api.py index 756839e..a103e8e 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -175,11 +175,14 @@ class API(object): allowed_param=['id'] ) - @property - def update_status(self): + def update_status(self, media_ids=None, *args, **kwargs): """ :reference: https://dev.twitter.com/rest/reference/post/statuses/update - :allowed_param:'status', 'in_reply_to_status_id', 'lat', 'long', 'source', 'place_id', 'display_coordinates' + :allowed_param:'status', 'in_reply_to_status_id', 'lat', 'long', 'source', 'place_id', 'display_coordinates', 'media_ids' """ + post_data = {} + if media_ids is not None: + post_data["media_ids"] = list_to_csv(media_ids) + return bind_api( api=self, path='/statuses/update.json', @@ -187,7 +190,7 @@ class API(object): payload_type='status', allowed_param=['status', 'in_reply_to_status_id', 'lat', 'long', 'source', 'place_id', 'display_coordinates'], require_auth=True - ) + )(post_data=post_data, *args, **kwargs) def media_upload(self, filename, *args, **kwargs): """ :reference: https://dev.twitter.com/rest/reference/post/media/upload -- 2.25.1