From 0be0f7fa089e32e69e95cdd1242796a9eb4e7c6d Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Thu, 9 Feb 2017 21:07:11 +0200 Subject: [PATCH] SteamFriendlist: make add/remove accept SteamUser --- steam/client/builtins/friends.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/steam/client/builtins/friends.py b/steam/client/builtins/friends.py index 0fea7ad..144cdaf 100644 --- a/steam/client/builtins/friends.py +++ b/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})