Message class

class psclient.Message(raw, connection)

Bases: object

Represents a message sent on Pokemon Showdown

Parameters:
  • raw (string) – the raw data of the message
  • connection (Connection) – the connection the message was recieved on
Variables:
  • sender (User or None) – the user who sent the message
  • room (Room or None) – the room the message was sent in
  • body (string or None) – the body of the message
  • time (string or None) – the UNIX timestamp of the message
  • type (string or None) – the type of the message (chat, pm, etc)
  • challstr (string or None) – the challstr, if the message contains one
  • senderName (string or None) – the username of the user who sent the message
  • raw (string) – the raw message
  • connection (Connection) – the connection the message was recieved on
respondHTML(html)

Responds to the message with a HTML box, in a room or in PMs

If the user cannot broadcast and the command wasn’t in PMs or it’s not a message that can be responded to, does nothing

Parameters:html (string) – the html to be sent