diff --git a/partybot-matrix.py b/partybot-matrix.py index 4a0e764..3f46954 100644 --- a/partybot-matrix.py +++ b/partybot-matrix.py @@ -4,12 +4,29 @@ import time import re import redis import datetime +import random from matrix_bot_api.matrix_bot_api import MatrixBotAPI from matrix_bot_api.mregex_handler import MRegexHandler from matrix_bot_api.mcommand_handler import MCommandHandler +def botsnack_cb(room, event): + replies = [ + "Nom nom nom.", + "Ooooh", + "Yummi!", + "Delightful.", + "That makes me happy", + "How kind!", + "Sweet.", + "Sorry, but I can't handle more right now.", + "*burp*", + "Ah.. Hiccup!" + ] + room.send_notice(random.choice(replies)) + + def show_karma_cb(room, event): allkkeys = rs.keys("partybot:k_" + event['room_id'] + "@*") @@ -100,6 +117,7 @@ if __name__ == "__main__": bot.add_handler(MRegexHandler("([\w]+)(\-\-|\+\+)", karma_cb)) bot.add_handler(MCommandHandler("karma", show_karma_cb)) + bot.add_handler(MCommandHandler("botsnack", botsnack_cb)) bot.start_polling()