Skip to content

Instantly share code, notes, and snippets.

@gbin
Created October 4, 2015 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbin/bfee0484c29393b44753 to your computer and use it in GitHub Desktop.
Save gbin/bfee0484c29393b44753 to your computer and use it in GitHub Desktop.
Errbot recipes: Create a poller
from datetime import datetime
from errbot import BotPlugin, botcmd
from pyfiglet import Figlet, FigletFont
class AsciiArt(BotPlugin):
""" Ascii Art related commands. """
def activate(self):
super().activate()
self.start_poller(60, self.talking_clock) # callbacks every minute
def talking_clock(self):
msg = datetime.now().time().strftime('%H:%M:%S')
self.send('gbin', '```\n' + Figlet(font='banner4').renderTime(msg) + '\n```')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment