28 lines
693 B
Python
28 lines
693 B
Python
#!/usr/bin/env python3
|
|
|
|
from plugins.plugin import Plugin
|
|
|
|
|
|
class Say(Plugin):
|
|
def activate(self):
|
|
super(Say, self).activate()
|
|
|
|
def deactivate(self):
|
|
super(Say, self).deactivate()
|
|
|
|
@Plugin.command()
|
|
def say(self, room, event, args):
|
|
"""Make glados say something => !say SOMETHING"""
|
|
if len(args) < 1:
|
|
return Say.say.__doc__
|
|
|
|
room.send_text(' '.join(args[0:]))
|
|
|
|
@Plugin.command()
|
|
def rsay(self, room, event, args):
|
|
"""Make glados say something on a given room => !say ROOM_JID SOMETHING"""
|
|
if len(args) < 2:
|
|
return Say.say.__doc__
|
|
|
|
return {'to': args[0], 'msg': ' '.join(args[1:])}
|