Skip to content

Instantly share code, notes, and snippets.

@gbin
Created October 4, 2015 22:34
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/70e891e6c2de12b7ea08 to your computer and use it in GitHub Desktop.
Save gbin/70e891e6c2de12b7ea08 to your computer and use it in GitHub Desktop.
Errbot recipes: Async messages
import random, time
from errbot import BotPlugin, botcmd
from pyfiglet import Figlet, FigletFont
class AsciiArt(BotPlugin):
""" Ascii Art related commands. """
@botcmd
def big(self, mess, args):
""" Generates 3 big versions with a random font."""
for font in random.sample(FigletFont.getFonts(), 3)
time.sleep(2)
yield '```\n' + Figlet(font=font).renderText(message) + '\n```'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment