def __init__(self, bot):
self.bot = bot
+ self.log = bot.log
+
+ def send(self, msg):
+ """
+ Send msg to the current groupchat defined in self.bot.room
+ msg = {
+ mbody: 'text',
+ mhtml: '<b>text</b>, # optional'
+ }
+ """
+ if isinstance(msg, str):
+ msg = {'mbody':msg}
+ msg.setdefault('mhtml', None)
+ self.bot.send_message(mto=self.bot.room,
+ mtype='groupchat',
+ **msg)
def shutdown(self):
pass