poezio/plugins/amsg.py
mathieui 9885203c67 Update the plugins to use the PluginAPI
Also:
- Add get_conversation_messages() to PluginAPI
- Make plugins_autoload colon-separated instead of space-separated
    (for consistency)
- Replace a JID() with a safeJID() in the uptime plugin
2013-03-08 22:53:35 +01:00

16 lines
504 B
Python

# A simple broadcast plugin
from plugin import BasePlugin
from tabs import MucTab
class Plugin(BasePlugin):
def init(self):
self.api.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)