Rename event functions

This commit is contained in:
Joscha 2018-07-29 15:26:45 +00:00
parent 46cd20ac74
commit 339d3ca516
2 changed files with 22 additions and 27 deletions

View file

@ -12,7 +12,7 @@ logging.getLogger("yaboli").setLevel(logging.DEBUG)
class ExampleBot(yaboli.Bot):
async def send(self, room, message):
async def on_send(self, room, message):
ping = "ExamplePong!"
short_help = "Example bot for the yaboli bot library"
long_help = (
@ -28,11 +28,6 @@ class ExampleBot(yaboli.Bot):
await self.botrulez_kill(room, message, text="/me dies spectacularly")
await self.botrulez_restart(room, message, text="/me restarts spectacularly")
if message.content == "!!!":
await room._connection._ws.close()
forward = send # should work without modifications for most bots
def main():
bot = ExampleBot("ExampleBot", "examplebot.cookie")
join_rooms(bot)