示例#1
0
 def parse_unknown_command(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts an "unknown command" message into a SystemMessage."""
     message = data['params'].split(' ', 2)[-1]
     
     return dataclasses.SystemMessage(
         enums.SysMessageTypes.GENERIC,
         'tmi.twitch.tv',
         message[1:],
         enums.IrcResponses.UNKNOWN_COMMAND
     )
示例#2
0
 def parse_motd_end(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts a "message of the day end" message into a SystemMessage."""
     end = data['params'].split(' ', 1)[-1]
     
     return dataclasses.SystemMessage(
         enums.SysMessageTypes.GENERIC,
         'tmi.twitch.tv',
         end[1:],
         enums.IrcResponses.MOTD_END
     )
示例#3
0
 def parse_name_end(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts a "name end" message into a SystemMessage."""
     us, channel, message = data['params'].split(' ', 2)
     
     return dataclasses.SystemMessage(
         enums.SysMessageTypes.GENERIC,
         channel[1:],
         message[1:],
         enums.IrcResponses.NAME_END
     )
示例#4
0
 def parse_motd_start(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts a "motd start" message into a SystemMessage."""
     message = data['params'].split(' ', 1)[-1]
     
     return dataclasses.SystemMessage(
         enums.SysMessageTypes.GENERIC,
         'tmi.twitch.tv',
         message[1:],
         enums.IrcResponses.MOTD_START
     )
示例#5
0
 def parse_my_info(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts a "my info" message into a SystemMessage."""
     user, message = data['params'].split(' ', 1)
     
     return dataclasses.SystemMessage(
         enums.SysMessageTypes.GENERIC,
         user,
         '',
         enums.IrcResponses.MY_INFO
     )
示例#6
0
 def parse_created(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts a "created" message into a SystemMessage."""
     message = data['params'].split(' ', 1)[-1]
     
     return dataclasses.SystemMessage(
         enums.SysMessageTypes.GENERIC,
         'tmi.twitch.tv',
         message[1:],
         enums.IrcResponses.CREATED
     )
示例#7
0
 def parse_your_host(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts a "your host" message into a SystemMessage."""
     message = data['params'].split(' ', 1)[-1]
     
     return dataclasses.SystemMessage(
         enums.SysMessageTypes.GENERIC,
         'tmi.twitch.tv',
         message[1:],
         enums.IrcResponses.YOUR_HOST
     )
示例#8
0
 def parse_welcome(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts a "welcome" message into a SystemMessage."""
     message = data['params'].split(' ', 1)[-1]
     
     return dataclasses.SystemMessage(
         enums.SysMessageTypes.GENERIC,
         data['prefix'],
         message[1:],
         enums.IrcResponses.WELCOME
     )
示例#9
0
 def parse_cap(cls, data: dict) -> dataclasses.SystemMessage:
     """Converts a "cap" message into a SystemMessage."""
     return dataclasses.SystemMessage(enums.SysMessageTypes.CAP, data['prefix'], data['params'][2:])