botlib.clock¶
timer, repeater and other clock based classes.
Exceptions
ENODATE |
date cannot be determined. |
-
class
Repeater
(sleep, func, *args, **kwargs)[source]¶ Bases:
botlib.clock.Timer
Repeat an funcion every x seconds.
>>> def func(event): event.reply("yo!")
>>> from bot.clock import Repeater >>> from bot.time import now >>> repeater = Repeater(now(), func) >>> repeater.start()[B
-
class
Timer
(sleep, func, *args, **kwargs)[source]¶ Bases:
botlib.object.Object
call a function as x seconds of sleep.