Skip to content

goodbot: Real time events

qedk edited this page Jun 29, 2020 · 1 revision

The bot relies on the real-time events endpoint of the Zulip REST API, the most important of which is the call_on_each_message() function. This endpoint allows us to process each message in real-time the way we want to.

goodbot.py instantiates a Zulip client inside the goodbot object with:

bot = goodbot(config_file="~/zuliprc")

We can then use the real-time events queue to process each message with our defined bot.process() function:

bot.client.call_on_each_message(bot.process)