This fixes cookie.py #11

Merged
ComputerTech merged 3 commits from Yuuki/EliteBot:master into master 2024-02-22 21:41:32 +01:00
Showing only changes of commit 4b6c768126 - Show all commits

View file

@ -135,6 +135,7 @@ class Bot:
ssl=ssl_context ssl=ssl_context
) )
await self.ircsend('CAP LS 302')
await self.ircsend(f'NICK {self.config["Connection"].get("Nick")}') await self.ircsend(f'NICK {self.config["Connection"].get("Nick")}')
await self.ircsend( await self.ircsend(
f'USER {self.config["Connection"].get("Ident")} * * :{self.config["Connection"].get("Name")}') f'USER {self.config["Connection"].get("Ident")} * * :{self.config["Connection"].get("Name")}')
@ -177,6 +178,9 @@ class Bot:
self.logger.debug(f'Received: source: {source} | command: {command} | args: {args}') self.logger.debug(f'Received: source: {source} | command: {command} | args: {args}')
match command: match command:
case 'CAP':
if args[1] == 'ACK' and 'sasl' in args[2]:
await handle_sasl(self.config, self.ircsend)
case 'PING': case 'PING':
nospoof = args[0][1:] if args[0].startswith(':') else args[0] nospoof = args[0][1:] if args[0].startswith(':') else args[0]
await self.ircsend(f'PONG :{nospoof}') await self.ircsend(f'PONG :{nospoof}')
@ -195,9 +199,6 @@ class Bot:
for plugin in self.plugins: for plugin in self.plugins:
await plugin.handle_message(source_nick, channel, message) await plugin.handle_message(source_nick, channel, message)
case 'CAP':
if args[1] == 'ACK' and 'sasl' in args[2]:
await handle_sasl(self.config, self.ircsend)
case 'AUTHENTICATE': case 'AUTHENTICATE':
await handle_authenticate(args, self.config, self.ircsend) await handle_authenticate(args, self.config, self.ircsend)
case 'INVITE': case 'INVITE':
@ -207,8 +208,9 @@ class Bot:
case 'VERSION': case 'VERSION':
await self.ircsend(f'NOTICE {source_nick} :I am a bot version 1.0.0') await self.ircsend(f'NOTICE {source_nick} :I am a bot version 1.0.0')
case '001': case '001':
for channel in self.channel_manager.get_channels(): await self.ircsend(f'JOIN #YuukiTest')
await self.ircsend(f'JOIN {channel}') # for channel in self.channel_manager.get_channels():
# await self.ircsend(f'JOIN {channel}')
case '903': case '903':
await handle_903(self.ircsend) await handle_903(self.ircsend)
case _: case _: