+ def reply(self, rcv, msg):
+ """Smart reply to message received.
+
+ Replies ``msg`` in private or on the muc depending on ``rcv``
+
+ :param rcv: The received message (slixmpp object)
+ :param dict,str msg: The message to reply, refer to :py:obj:`sid.plugin.Plugin.send` for ``msg`` format
+ """
+ to = rcv['from']
+ if rcv['type'] == 'groupchat':
+ to = rcv['mucroom']
+ self.send(to, msg, mtype=rcv['type'])
+
+ async def ban(self, jid, reason):
+ """Coroutine to ban a jid from the room
+
+ :param str jid: JID to ban
+ :param str reason: Reason
+ """
+ room = self.bot.room
+ try:
+ await self.bot['xep_0045'].set_affiliation(room,
+ jid=jid, affiliation='outcast', reason=reason)
+ except XMPPError as error:
+ self.log.error(error)
+