Skip to content

Instantly share code, notes, and snippets.

@gbin
Last active October 4, 2015 22:23
Show Gist options
  • Save gbin/c3dd34e0d2770bdf560f to your computer and use it in GitHub Desktop.
Save gbin/c3dd34e0d2770bdf560f to your computer and use it in GitHub Desktop.
Errbot recipes: templates
from errbot import BotPlugin, botcmd
from pyfiglet import Figlet
class AsciiArt(BotPlugin):
""" Ascii Art related commands. """
@botcmd(template='biginfo')
def big(self, mess, args):
""" Generates a big version of what you want to say."""
return {'small': args, 'big': Figlet(font='slant').renderText(args)}

{# This needs to be in a templates subdirectory templates/biginfo.md #}

{{big}}

Ir meant to say: {{small}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment