User class

class psclient.User(name, connection)

Bases: object

Represents a user on Pokemon Showdown

Parameters:
  • name (string) – the username
  • connection (PSConnection) – the connection to access PS with
Variables:
  • name (string) – the username
  • connection (PSConnection) – the connection to access PS with
  • id (string that is an ID) – the user’s ID
PM(message)

PMs the user the given message

Parameters:message (string) – the message to PM the user
can(action, room)

Checks if the user may perform an action

Parameters:
  • action (string) – the action (one of wall or html)
  • room (Room) – the room where the action is taking place
Returns:

True if the user can do the action and False otherwise

Return type:

bool