From 72dc3ebd0420b8357e1409ac64a0437003243ebe Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 5 Apr 2020 17:42:43 +0100 Subject: [PATCH] Bot does not have line_read()/line_send() any more --- examples/sasl.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/sasl.py b/examples/sasl.py index 0354064..a5c99d9 100644 --- a/examples/sasl.py +++ b/examples/sasl.py @@ -2,14 +2,18 @@ import asyncio from irctokens import build, Line from ircrobots import Bot as BaseBot -from ircrobots import ConnectionParams, SASLUserPass, Server +from ircrobots import Server as BaseServer +from ircrobots import ConnectionParams, SASLUserPass, Server, SASLSCRAM + +class Server(BaseServer): + async def line_read(self, line: Line): + print(f"{self.name} < {line.format()}") + async def line_send(self, line: Line): + print(f"{self.name} > {line.format()}") class Bot(BaseBot): - async def line_read(self, server: Server, line: Line): - print(f"{server.name} < {line.format()}") - - async def line_send(self, server: Server, line: Line): - print(f"{server.name} > {line.format()}") + def create_server(self, name: str): + return Server(name) async def main(): bot = Bot()