2012-02-07 00:12:21 +00:00
|
|
|
# A simple broadcast plugin
|
|
|
|
|
|
|
|
from plugin import BasePlugin
|
|
|
|
from tabs import MucTab
|
|
|
|
|
|
|
|
class Plugin(BasePlugin):
|
|
|
|
def init(self):
|
2013-03-08 21:53:35 +00:00
|
|
|
self.api.add_command('amsg', self.command_amsg,
|
2013-03-01 18:25:31 +00:00
|
|
|
usage='<message>',
|
|
|
|
short='Broadcast a message',
|
|
|
|
help='Broadcast the message to all the joined rooms.')
|
2012-02-07 00:12:21 +00:00
|
|
|
|
|
|
|
def command_amsg(self, args):
|
|
|
|
for room in self.core.tabs:
|
|
|
|
if isinstance(room, MucTab) and room.joined:
|
|
|
|
room.command_say(args)
|