processor#

class besser.bot.core.processors.processor.Processor(bot, user_messages=False, bot_messages=False)[source]#

Bases: ABC

The processor abstract class.

A processor defines the processing a user or bot message goes through.

This class serves as a template to implement processors.

Parameters:
  • bot (Bot) – The bot the processor belongs to

  • user_messages (bool) – whether the processor should be applied to user messages

  • bot_messages (bool) – whether the processor should be applied to bot messages

bot#

The bot the processor belongs to

Type:

Bot

user_messages#

whether the processor should be applied to user messages

Type:

bool

bot_messages#

whether the processor should be applied to bot messages

Type:

bool

_abc_impl = <_abc._abc_data object>#
abstract process(session, message)[source]#

Abstract method to process a message.

Parameters:
  • session (Session) – the current session

  • message (Any) – the message to be processed

Returns:

the processed message

Return type:

Any