Skip to content

Commit

Permalink
Require status parameter for API.update_with_media
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Feb 19, 2021
1 parent 75e12b0 commit 0726263
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tweepy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,16 @@ def create_media_metadata(self, media_id, alt_text, **kwargs):
)

@payload('status')
def update_with_media(self, filename, *args, file=None, **kwargs):
def update_with_media(self, filename, status, *args, file=None, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update_with_media
"""
headers, post_data = API._pack_image(filename, 3072,
form_field='media[]', f=file)
kwargs.update({'headers': headers, 'post_data': post_data})

return self.request(
'POST', 'statuses/update_with_media', *args, endpoint_parameters=(
'POST', 'statuses/update_with_media', status, *args,
endpoint_parameters=(
'status', 'possibly_sensitive', 'in_reply_to_status_id',
'lat', 'long', 'place_id', 'display_coordinates'
), **kwargs
Expand Down

0 comments on commit 0726263

Please sign in to comment.