Browse Source

SteamFriendlist: make add/remove accept SteamUser

pull/35/merge
Rossen Georgiev 8 years ago
parent
commit
0be0f7fa08
  1. 5
      steam/client/builtins/friends.py

5
steam/client/builtins/friends.py

@ -157,6 +157,8 @@ class SteamFriendlist(EventEmitter):
if isinstance(steamid_or_accountname_or_email, (intBase, int)):
m.body.steamid_to_add = steamid_or_accountname_or_email
elif isinstance(steamid_or_accountname_or_email, SteamUser):
m.body.steamid_to_add = steamid_or_accountname_or_email.steam_id
else:
m.body.accountname_or_email_to_add = steamid_or_accountname_or_email
@ -169,5 +171,8 @@ class SteamFriendlist(EventEmitter):
:param steamid: their steamid
:type steamid: :class:`int`, :class:`.SteamID`, :class:`.SteamUser`
"""
if isinstance(steamid, SteamUser):
steamid = steamid.steam_id
self._steam.send(MsgProto(EMsg.ClientRemoveFriend), {'friendid': steamid})

Loading…
Cancel
Save