13. Scheduling

13.1. Calling a function at a regular interval

It's possible to automatically call functions at regular intervals, using the start_poller() and stop_poller() methods.

For example, you could schedule a callback to be executed once every minute when your plugin gets activated:

 from errbot import BotPlugin

 class PluginExample(BotPlugin):
     def my_callback(self):
         self.log.debug('I am called every minute')

     def activate(self):
         self.start_poller(60, self.my_callback)