event_library#

The collection of preexisting events.

Events are functions embedded in Transition that, when called and return a True value, trigger the transitions.

besser.bot.library.event.event_library.auto(session, event_params)[source]#

This event always returns True.

Parameters:
  • session (Session) – the current user session

  • event_params (dict) – the event parameters

Returns:

always true

Return type:

bool

besser.bot.library.event.event_library.file_received(session, event_params)[source]#

This event only returns True if a user just sent a file.

Parameters:
  • session (Session) – the current user session

  • event_params (dict) – the event parameters

Returns:

True if the user has sent a file and (if specified) the received file type corresponds to the allowed types as defined in “allowed_types”

Return type:

bool

besser.bot.library.event.event_library.intent_matched(session, event_params)[source]#

This event checks if 2 intents are the same, used for intent matching checking.

Parameters:
  • session (Session) – the current user session

  • event_params (dict) – the event parameters

Returns:

True if the 2 intents are the same, false otherwise

Return type:

bool

besser.bot.library.event.event_library.variable_matches_operation(session, event_params)[source]#

This event checks if for a specific comparison operation, using a stored session value and a given target value, returns true.

Parameters:
  • session (Session) – the current user session

  • event_params (dict) – the event parameters

Returns:

True if the comparison operation of the given values returns true

Return type:

bool