X-Git-Url: http://git.kaliko.me/?p=sid.git;a=blobdiff_plain;f=sid%2Fplugin.py;h=2b49bc9da22c9d3a57f1c02a6793da770a3c1221;hp=15f43ab55e52a7a4fb3280d22abbc970d61ddfbf;hb=40a4cb2e7caa70e009736ead303ce016ddac3a71;hpb=ee38f3ae1e801fd160978b2c5804d4cc056683f6 diff --git a/sid/plugin.py b/sid/plugin.py index 15f43ab..2b49bc9 100644 --- a/sid/plugin.py +++ b/sid/plugin.py @@ -23,5 +23,20 @@ class Plugin(object): 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: 'text, # 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