Skip to content

Conversation

@Hodackin
Copy link

Added few methods for adding, accepting and deleting friends by steam_id.

Copy link
Owner

@bukson bukson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check and review my remarks, thanks

def accept_friend(self, steam_id: str) -> bool:
return self._friend_ajax_request(steam_id, accept=1)

_headers = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why put it here

return True if response else False

@login_required
def accept_friend(self, steam_id: str) -> bool:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between add_friend and accept_friend? seems like the only diffrerence is checking the response

"accept_invite": accept
}
# returns True or json object if request was succes, otherwise False
return self._session.post(url, data=data, headers=self._headers).json()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should raise exception if something was wrong, otherwise return datatype should be specified not bool or dict

"steamid": steam_id
}
# returns True if request was succes, otherwise False
# returns True even if `steam_id` has never been a friend
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again if request was not succesed due to error, it should be an exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants