poezio/plugins/amsg.py

14 lines
429 B
Python
Raw Normal View History

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):
self.add_command('amsg', self.command_amsg, "Usage: /amsg <message>\nAmsg: 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)