Created
October 4, 2015 22:38
-
-
Save gbin/bfee0484c29393b44753 to your computer and use it in GitHub Desktop.
Errbot recipes: Create a poller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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