Plugin BasePlugin Object

The base class for all plugins.

class antispam.BasePlugin(is_pre_invoke=True)
__init__(is_pre_invoke=True) None
async classmethod load_from_dict(anti_spam_handler, data: Dict)

Loads this plugin from a saved state.

Parameters
  • anti_spam_handler (AntiSpamHandler) – The AntiSpamHandler instance

  • data (Dict) – The data to load the plugin from

async propagate(message, data: Optional[antispam.dataclasses.core.CorePayload] = None) Any

This method is called whenever the base antispam.propagate is called, adhering to self.is_pre_invoke

Parameters
  • message (Union[discord.Message, hikari.messages.Message]) – The message to run propagation on

  • data (Optional[CorePayload]) – Optional input given to after invoke plugins which is the return value from the main propagate()

Returns

A dictionary of useful data to the end user

Return type

dict

async save_to_dict() Dict

Saves the plugins state to a Dict

Returns

The current plugin state as a dictionary.

Return type

Dict