Events/exchange_roles
< Events
Jump to navigation
Jump to search
The exchange_roles event is called whenever someone swaps roles (usually due to an exchange totem).
Event callback
def on_exchange_roles(event: Event, cli: IRCClient, var: module, actor: str, nick: str, actor_role: str, nick_role: str) -> None
- prevent_default has no effect for this event
event
: The event objectcli
: The IRC connectionvar
: Reference to the src.settings moduleactor
: Person that triggered the exchangenick
: Person that is being exchanged withactor_role
: actor's rolenick_role
: nick's role
Event data
{
"actor_messages": list(str),
"nick_messages": list(str)
}
The actor_messages and nick_messages data keys are initialized to an empty list. Adding strings to this will cause those strings to be sent to the actor or nick respectively after they are informed that their role has been swapped. It is preferable to make use of these lists as opposed to directly calling pm
yourself, as the event is run before the players are informed that their roles have swapped.