Bot does not have line_read()/line_send() any more

This commit is contained in:
jesopo 2020-04-05 17:42:43 +01:00
parent 84b374f43d
commit 72dc3ebd04

View file

@ -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()