summaryrefslogtreecommitdiff
path: root/plugins/amsg.py
blob: a002b11ec2548cacf25c6f3153920fe080001c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# A simple broadcast plugin

from plugin import BasePlugin
from tabs import MucTab

class Plugin(BasePlugin):
    def init(self):
        self.add_command('amsg', self.command_amsg,
                usage='<message>',
                short='Broadcast a message',
                help='Broadcast the message to all the joined rooms.')

    def command_amsg(self, args):
        for room in self.core.tabs:
            if isinstance(room, MucTab) and room.joined:
                room.command_say(args)