2 changed files with 25 additions and 1 deletions
@ -1,4 +1,27 @@ |
|||
from steam.enums import EPersonaState |
|||
from steam.enums.emsg import EMsg |
|||
from steam.core.msg import MsgProto |
|||
|
|||
class User(object): |
|||
def __init__(self): |
|||
super(User, self).__init__() |
|||
|
|||
def set_persona(self, state, name=None): |
|||
""" |
|||
Set persona state and name |
|||
|
|||
:param state: persona state flag |
|||
:type state: :class:`steam.enums.common.EPersonaState` |
|||
:param name: profile name |
|||
:type name: :class:`str` |
|||
""" |
|||
if not isinstance(state, EPersonaState): |
|||
raise ValueError("Expected state to be instance of EPersonaState") |
|||
|
|||
message = MsgProto(EMsg.ClientChangeStatus) |
|||
|
|||
message.body.persona_state = state |
|||
if name: |
|||
message.body.player_name = name |
|||
|
|||
self.send(message) |
|||
|
Loading…
Reference in new issue