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
|
|
|
"""
|
2012-12-18 01:08:38 +00:00
|
|
|
from plugin import BasePlugin
|
2014-04-01 21:04:10 +00:00
|
|
|
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]
|