@idiokit.stream
    def reply(self, own_jid):
        while True:
            element = yield idiokit.next()

            sender = jid.JID(element.get_attr("from"))
            if sender == own_jid:
                continue

            for message in element.named("message"):
                text = get_message_text(message)
                if text is None:
                    continue

                pieces = text.split(None, 1)
                if len(pieces) < 2 or pieces[0].lower() not in (u"/repr", u"!repr"):
                    continue

                try:
                    event = events.Event.from_unicode(pieces[1].strip())
                except ValueError:
                    continue

                yield idiokit.send(event)
dataset/ETHPy150Open abusesa/abusehelper/abusehelper/bots/reprbot/reprbot.py/ReprBot.reply/original