2013-04-13 20:33:06 +00:00
|
|
|
"""
|
2014-03-27 22:45:47 +00:00
|
|
|
Reverse everything you say (``Je proteste énergiquement`` will become
|
|
|
|
``tnemeuqigrené etsetorp eJ``)
|
2013-04-13 20:33:06 +00:00
|
|
|
"""
|
2016-06-27 23:10:52 +00:00
|
|
|
from poezio.plugin import BasePlugin
|
|
|
|
from poezio import xhtml
|
2012-12-18 01:08:38 +00:00
|
|
|
|
|
|
|
class Plugin(BasePlugin):
|
|
|
|
def init(self):
|
2013-03-08 21:53:35 +00:00
|
|
|
self.api.add_event_handler('muc_say', self.revstr)
|
2013-03-18 22:08:42 +00:00
|
|
|
self.api.add_event_handler('conversation_say', self.revstr)
|
|
|
|
self.api.add_event_handler('private_say', self.revstr)
|
2012-12-18 01:08:38 +00:00
|
|
|
|
|
|
|
def revstr(self, msg, tab):
|
2014-04-01 21:04:10 +00:00
|
|
|
msg['body'] = xhtml.clean_text(msg['body'])[::-1]
|