pytwitcherapi.chat.message.Message3

class pytwitcherapi.chat.message.Message3(source, target, text, tags=None)[source]

Bases: pytwitcherapi.chat.message.Message

A message which stores information from irc v3 tags

__init__(source, target, text, tags=None)[source]

Initialize a new message from source to target with the given text

Parameters:
  • source (Chatter) – The source chatter
  • target (str) – the target
  • text (str) – the content of the message
  • tags (list of Tag) – the irc v3 tags
Raises:

None

Methods

__init__(source, target, text[, tags]) Initialize a new message from source to target with the given text
from_event(event) Create a message from an event
set_tags(tags) For every known tag, set the appropriate attribute.

Attributes

emotes Return the emotes
subscriber Return whether the message was sent from a subscriber
turbo Return whether the message was sent from a turbo user
color = None

the hex representation of the user color

user_type = None

Turbo type. None for regular ones. Other user types are mod, global_mod, staff, admin.

classmethod from_event(event)[source]

Create a message from an event

Parameters:event (Event3) – the event that was received of type pubmsg or privmsg
Returns:a message that resembles the event
Return type:Message3
Raises:None
set_tags(tags)[source]

For every known tag, set the appropriate attribute.

Known tags are:

color:The user color
emotes:A list of emotes
subscriber:True, if subscriber
turbo:True, if turbo user
user_type:None, mod, staff, global_mod, admin
Parameters:tags (list of Tag | None) – a list of tags
Returns:None
Return type:None
Raises:None
emotes

Return the emotes

Returns:the emotes
Return type:list
Raises:None
subscriber

Return whether the message was sent from a subscriber

Returns:True, if subscriber
Return type:bool
Raises:None
turbo

Return whether the message was sent from a turbo user

Returns:True, if turbo
Return type:bool
Raises:None