X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sid%2Fplugin.py;h=2b49bc9da22c9d3a57f1c02a6793da770a3c1221;hb=e518fc7f4c42f6e911d85ce8f662b3d21b6da757;hp=15f43ab55e52a7a4fb3280d22abbc970d61ddfbf;hpb=1207c01eef5e37ca2772da0968cb193a3267dabe;p=sid.git 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