Hook Functions#

iamai provides same hook functions that can be used as decorators. Here’s how to use them:

from iamai import Bot

bot = Bot()

@bot.bot_run_hook
async def hook_func(_bot: Bot):
   pass 

if __name__ == "__main__":
   bot.run()

::: tip Note If you are not sure what you are doing, please do not add hook functions. :::

Event PostProcessing#


@bot.event_postprocessor_hook
async def hook_func(_event: "T_Event"):
   pass