formatted with black

This commit is contained in:
A_D 2022-01-30 20:05:31 +02:00
parent 0ce3b9b0b0
commit 9b31aff951
No known key found for this signature in database
GPG key ID: 4BE9EB7DF45076C4
23 changed files with 629 additions and 469 deletions

View file

@ -5,28 +5,31 @@ from ircrobots import Bot as BaseBot
from ircrobots import Server as BaseServer
from ircrobots import ConnectionParams, SASLUserPass, 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):
def create_server(self, name: str):
return Server(self, name)
async def main():
bot = Bot()
sasl_params = SASLUserPass("myusername", "invalidpassword")
params = ConnectionParams(
"MyNickname",
host = "chat.freenode.invalid",
port = 6697,
sasl = sasl_params)
params = ConnectionParams(
"MyNickname", host="chat.freenode.invalid", port=6697, sasl=sasl_params
)
await bot.add_server("freenode", params)
await bot.run()
if __name__ == "__main__":
asyncio.run(main())