Skip to content

Commit

Permalink
Stop allowing positional arguments for API.update_profile_banner
Browse files Browse the repository at this point in the history
Stop allowing positional arguments besides filename for API.update_profile_banner
  • Loading branch information
Harmon758 committed Feb 19, 2021
1 parent 3dc5604 commit 1ca22be
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tweepy/api.py
Expand Up @@ -836,16 +836,15 @@ def update_profile_image(self, filename, *, file=None, **kwargs):
), files=files, **kwargs
)

def update_profile_banner(self, filename, *args, file=None, **kwargs):
def update_profile_banner(self, filename, *, file=None, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner
"""
if file is not None:
files = {'banner': (filename, file)}
else:
files = {'banner': open(filename, 'rb')}
return self.request(
'POST', 'account/update_profile_banner', *args,
endpoint_parameters=(
'POST', 'account/update_profile_banner', endpoint_parameters=(
'width', 'height', 'offset_left', 'offset_right'
), files=files, **kwargs
)
Expand Down

0 comments on commit 1ca22be

Please sign in to comment.