2019-05-25 20:40:06 +00:00
|
|
|
#--depends-on commands
|
|
|
|
|
2019-04-28 12:36:25 +00:00
|
|
|
from src import ModuleManager, utils
|
|
|
|
|
|
|
|
class Module(ModuleManager.BaseModule):
|
|
|
|
@utils.hook("received.command.echo")
|
2019-11-15 11:33:52 +00:00
|
|
|
@utils.kwarg("remove_empty", False)
|
|
|
|
@utils.kwarg("help", "Echo a string back")
|
2020-01-25 22:56:06 +00:00
|
|
|
@utils.spec("!string")
|
2019-04-28 12:36:25 +00:00
|
|
|
def echo(self, event):
|
2020-01-25 11:33:38 +00:00
|
|
|
event["stdout"].write(event["spec"][0])
|
2019-09-26 11:27:20 +00:00
|
|
|
|
|
|
|
@utils.hook("received.command.action")
|
2019-11-15 11:33:52 +00:00
|
|
|
@utils.kwarg("remove_empty", False)
|
|
|
|
@utils.kwarg("help", "Make the bot send a /me")
|
2020-01-25 22:56:06 +00:00
|
|
|
@utils.spec("!string")
|
2019-09-26 11:27:20 +00:00
|
|
|
def action(self, event):
|
2020-01-25 11:33:38 +00:00
|
|
|
event["target"].send_message("\x01ACTION %s\x01" % event["spec"][0])
|
2019-09-27 15:18:49 +00:00
|
|
|
|
|
|
|
@utils.hook("received.command.msg")
|
|
|
|
@utils.kwarg("permission", "say")
|
|
|
|
@utils.kwarg("remove_empty", False)
|
|
|
|
@utils.kwarg("help", "Send a message to a target")
|
2020-01-25 22:56:06 +00:00
|
|
|
@utils.spec("!word !string")
|
2019-09-27 15:18:49 +00:00
|
|
|
def msg(self, event):
|
2020-01-25 11:33:38 +00:00
|
|
|
event["server"].send_message(event["spec"][0], event["spec"][1])
|