Events

Events will be triggered on different circumstances like, on click, on enabled, on message receive etc. Events can call/trigger actions.

With plugins you can add and call/emit your own events and define when they should be executed as well parse date within these events.


Register an Event

Within the afterInit function, the following code will add an event:

def afterInit(self):
    self.registerEvent(NameString, IdentifyerString)

Example

self.registerEvent("Example Event Name", "ExampleEventIdentifyer")

Two comma separated strings are necessary to register the event properly:

  • The first string is defining the name how a user would find the event within the menu.

  • The second one is the name of the event itself and the identifier to call it.


Emit / Call an Event

To call/emit the event, the following code is required:

Example

Whenever within your code you are calling this function, the event will be emitted/triggered.

circle-exclamation

Register an Event with a parameter

The scriptTokens= is a variable of a type List.

circle-info

The scriptToken=[""] parameter is optional.

These create/register the given parameter names within the data structure also if they will be not used from the "call" return.

If these are not set, they will be shown but empty within the data value tree.


Emit / Call an Event with a parameter


Register an Event with parameters

circle-info

The scriptToken=[""] parameter is optional.

These create/register the given parameter names within the data structure also if they will be not used from the "call" return.

If these are not set, they will be shown but empty within the data value tree.

Emit / Call an Event with parameters

or from Dict:

Last updated