Skip to content

Instantly share code, notes, and snippets.

@gbin
Last active August 30, 2015 16:20
Show Gist options
  • Save gbin/8faadcce28872fc0c395 to your computer and use it in GitHub Desktop.
Save gbin/8faadcce28872fc0c395 to your computer and use it in GitHub Desktop.
Simple sample to read a file and return the output
from errbot import BotPlugin, botcmd
from os.path import join
DAYS_PATH = 'f:/errplugins/'
class School(BotPlugin):
@botcmd
def missed_day(self, msg, args):
"""Get missed day and provide assignment summary."""
with open(join(DAYS_PATH, "summary.%s" % args), 'r') as f:
return f.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment