Slide 22
Slide 22 text
> schedule
「定期的に○ ○ をさせる」「10分後に○○させる」
をやりたいときに
from errbot import BotPlugin, botcmd, arg_botcmd
import demo
class Example(BotPlugin):
@arg_botcmd('min', type=int)
def noodle_timer(self, msg, min):
self.start_poller(min * 60, self.finished, (msg.frm, min,))
return 'Start {} mins'.format(min)
def finished(self, frm, min):
self.send(frm, 'Finished')
self.stop_poller(self.finished, (frm, min,))