summaryrefslogtreecommitdiff
path: root/plugins/shuffle.py
blob: beba0769ea1a6790522401d0026e402cc90af92b (plain)
1
2
3
4
5
6
7
8
9
10
11
from plugin import BasePlugin
from random import shuffle

class Plugin(BasePlugin):
    def init(self):
        self.add_event_handler('muc_say', self.shuffle)

    def shuffle(self, msg, tab):
        split = msg['body'].split()
        shuffle(split)
        msg['body'] = ' '.join(split)