Methods for adding, accepting and deleting friends#366
Open
Hodackin wants to merge 2 commits intobukson:masterfrom
Open
Methods for adding, accepting and deleting friends#366Hodackin wants to merge 2 commits intobukson:masterfrom
Hodackin wants to merge 2 commits intobukson:masterfrom
Conversation
bukson
reviewed
Feb 24, 2024
Owner
bukson
left a comment
There was a problem hiding this comment.
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 = { |
| return True if response else False | ||
|
|
||
| @login_required | ||
| def accept_friend(self, steam_id: str) -> bool: |
Owner
There was a problem hiding this comment.
what is the difference between add_friend and accept_friend? seems like the only diffrerence is checking the response
steampy/client.py
Outdated
| "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() |
Owner
There was a problem hiding this comment.
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 |
Owner
There was a problem hiding this comment.
again if request was not succesed due to error, it should be an exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added few methods for adding, accepting and deleting friends by
steam_id.