-
Notifications
You must be signed in to change notification settings - Fork 2
Presence Messages
The Presence Subsystem allows to add or remove presence messages which are displayed as status in the user list.
bot.presence.register(message, priority=PresencePriority.DEFAULT) registers a message. All messages with priority PresencePriority.DEFAULT (for normal plugin messages) or PresencePriority.LOW (for user definied messages) are displayed periodically, with round robin switching after a few minutes. To register a message which should be displayed instantly, the PresencePriority.HIGH can be used and is useful for registering phases for games like !werbinich.
User definied messages can also be registered and removed using the !presence command of the mod coreplugin. For debug or error handling puroposes, the debug plugin provides some presence related commands to fully control the presence subsystem and its messages (for botadmins only).
Attention: The Presence subsystem handles only the saving of LOW priority messages by itself! Messages with other priorities have to be handled by the Plugin and re-registered on Bot/Plugin startup!
The registering function returns a PresenceMessage object which represents the message and has following attributes and methods:
-
PresenceMessage.presence_id: The unique presence message id -
PresenceMessage.priority: The PresencePriority of the message -
PresenceMessage.message: The message itself which will be displayed -
PresenceMessage.deregister(): Deregisters the message that the message won't be displayed anymore
The PresenceMessage.deregister() method deregisters the message. Alternativley, bot.presence.deregister_id(id) deregisters the message with the given unique id, and bot.presence.deregister(presenceMessage) deregisters the message represented by the given PresenceMessage object. All deregistering methods return True if the message was successfully deregistered or False, if the given message or ID isn't registered.