Add bot ping message setting

This commit is contained in:
Joscha 2017-09-07 22:34:05 +00:00
parent 9c4f5e4372
commit 41d7e5b0dc

View file

@ -34,6 +34,7 @@ class Bot(Controller):
self.kill_message = "/me *poof*" # how to respond to !kill, whether killable or not self.kill_message = "/me *poof*" # how to respond to !kill, whether killable or not
self.restartable = True self.restartable = True
self.restart_message = "/me temporary *poof*" # how to respond to !restart, whether restartable or not self.restart_message = "/me temporary *poof*" # how to respond to !restart, whether restartable or not
self.ping_message = "Pong!" # as specified by the botrulez
def register_callback(self, event, callback, specific=True): def register_callback(self, event, callback, specific=True):
self._callbacks.add((event, specific), callback) self._callbacks.add((event, specific), callback)
@ -186,7 +187,8 @@ class Bot(Controller):
@noargs @noargs
async def command_ping(self, message): async def command_ping(self, message):
await self.room.send("Pong!", message.message_id) if self.ping_message:
await self.room.send(self.ping_message, message.message_id)
@noargs # TODO: specific command help (!help @bot ping) @noargs # TODO: specific command help (!help @bot ping)
async def command_help(self, message): async def command_help(self, message):