Bot does not have line_read()/line_send() any more
This commit is contained in:
parent
84b374f43d
commit
72dc3ebd04
1 changed files with 10 additions and 6 deletions
|
@ -2,14 +2,18 @@ import asyncio
|
||||||
|
|
||||||
from irctokens import build, Line
|
from irctokens import build, Line
|
||||||
from ircrobots import Bot as BaseBot
|
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):
|
class Bot(BaseBot):
|
||||||
async def line_read(self, server: Server, line: Line):
|
def create_server(self, name: str):
|
||||||
print(f"{server.name} < {line.format()}")
|
return Server(name)
|
||||||
|
|
||||||
async def line_send(self, server: Server, line: Line):
|
|
||||||
print(f"{server.name} > {line.format()}")
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
bot = Bot()
|
bot = Bot()
|
||||||
|
|
Loading…
Reference in a new issue