shamefully ripped from ivar

This commit is contained in:
Morgan McMillian 2017-09-27 22:09:37 -07:00
parent c4a60419da
commit eb49ac41c5

View file

@ -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()