Events/myrole
< Events
Jump to navigation
Jump to search
The myrole event is called whenever someone uses the !myrole command and is playing.
Event callback
def on_myrole(event: Event, cli: IRCClient, var: module, nick: str) -> None
- prevent_default has no effect for this event
event
: The event objectcli
: The IRC connectionvar
: Reference to the src.settings modulenick
: Person using !myrole
Event data
{
"role": str,
"messages": list(str)
}
Messages is initialized to an empty list, and is useful for adding informational messages. The event handler is executed before the player is informed of their role, so using this data item ensures that messages are sent in the proper order. The role item is what role the user is told they are.