Users

Current User

class steampak.libsteam.resources.user.CurrentUser

Exposed methods related to a current Steam client user.

Can be accessed through api.current_user:

user = api.current_user
behind_nat

True if this users looks like they are behind a NAT device. Only valid once the user has connected to steam (i.e a SteamServersConnected_t has been issued) and may not catch all forms of NAT.

Return type:bool
level

Current user level (as shown on their profile).

Return type:int
logged_in

True if the Steam client current has a live connection to the Steam servers.

If False, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.

The Steam client will automatically be trying to recreate the connection as often as possible.

Return type:bool

User

class steampak.libsteam.resources.user.User(user_id)

Exposes methods to get user-related data.

Instance access example:

for user in api.friends():
    print(user.name)
accept_friend_invite()

Shows a dialog to accept an incoming friend invite.

add_to_friends()

Shows a dialog to add user as a friend.

get_state(as_str=False)

Returns user state. See UserState.

Parameters:as_str (bool) – Return human-friendly state name instead of an ID.
Return type:int|str
has_friends(flt=65535)

Indicated whether the user has friends, who meet the given criteria (filter).

Parameters:flt (int) – Filter value from FriendFilter. Filters can be combined with |.
Return type:bool
ignore_friend_invite()

Shows a dialog to ignore an incoming friend invite.

level

User level (as shown on profile).

Return type:int
name

User name (the same name as on the users community profile page).

Return type:str
name_history

A list of user names (as user can change those occasionally).

Return type:list
nickname

A nickname the current user has set for the user, or None if not set.

Return type:str
open_chat()

Shows overlay with chat window.

remove_from_friends()

Shows a dialog to remove user from friends.

show_achievements()

Shows overlay with user achievements.

show_profile()

Shows overlay with user profile.

show_stats()

Shows overlay with user stats.

state

User state. See .get_state().

Return type:str

User State

class steampak.libsteam.resources.user.UserState

User states enumeration.

AWAY = 3
BUSY = 2
OFFLINE = 0
ONLINE = 1
READY_TO_PLAY = 6
READY_TO_TRADE = 5
SNOOZE = 4
aliases = {0: 'offline', 1: 'online', 2: 'busy', 3: 'away', 4: 'snooze', 5: 'trade', 6: 'play'}
get_alias(item_id)

Returns item alias by ID.

Parameters:item_id (int) – Item ID.
Return type:str