Skip to content
Innocent Bystander edited this page Feb 5, 2015 · 2 revisions

Hooks are DEPRECATED - please see plugins

Hooks allow extension of bot functionality by adding modular packages which contain class methods. These methods are called on common chat events:

  • init, called when the hook is first loaded (one-time per run)
  • on_chat_message
  • on_membership_change
  • on_rename

A fully-functional chat logger is provided as part of the repo, and can be found in hangoutsbot/hooks/chatlogger/writer.php. The chat logger logs each chat the bot is operating in inside separate text files.

Note that hooks can use config.json as a configuration source as well. In the case of the example chat logger, the following configuration is necessary:

...,
"hooks": [
{
  "module": "hooks.chatlogger.writer.logger",
  "config":
  {
    "storage_path": "<location to store chat log files>"
  }
}
],
...

# ## ###

Clone this wiki locally