add help command resolves #7

This commit is contained in:
Morgan McMillian 2018-08-02 16:59:34 -07:00
parent cdac03692c
commit a54a61d576

View file

@ -11,6 +11,13 @@ from matrix_bot_api.mregex_handler import MRegexHandler
from matrix_bot_api.mcommand_handler import MCommandHandler
def help_cb(room, event):
reply = ""
reply += "`!karma` shows the karma assigned to room members\n"
reply += "`!botsnack` or `!botdrink` to give partybot some refreshment\n"
reply += "`@username ++` or `@username --` to assign karma to a room member\n"
room.send_notice(reply)
def botsnack_cb(room, event):
replies = [
"Nom nom nom.",
@ -143,6 +150,7 @@ if __name__ == "__main__":
bot.add_handler(MRegexHandler("\s!botsnack", botsnack_cb))
bot.add_handler(MCommandHandler("botdrink", botdrink_cb))
bot.add_handler(MRegexHandler("\s!botdrink", botdrink_cb))
bot.add_handler(MCommandHandler("help", help_cb))
bot.start_polling()