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
run(*args, **kwargs)[source]
class Timer(sleep, func, *args, **kwargs)[source]

Bases: botlib.object.Object

call a function as x seconds of sleep.

exit()[source]

cancel the timer.

run(*args, **kwargs)[source]

run the registered function.

start()[source]

start the timer.

init(event)[source]