Compare commits

..

No commits in common. "a8d67fca6a2105164452f34ba0ae4cea328b5a9c" and "1446e12b15b49e2b28eeec83c1b536627cf67935" have entirely different histories.

2 changed files with 7 additions and 9 deletions

View file

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

View file

@ -16,7 +16,7 @@ class Database:
if not inspect(self.engine).has_table(table_name):
self.meta.create_all(self.engine)
def set_user(self, user: str, values: dict):
def set(self, user: str, values: dict):
with self.engine.connect() as conn:
stmt = select(self.table).where(self.table.c.name == user)
cnt = len(conn.execute(stmt).fetchall())
@ -28,7 +28,7 @@ class Database:
))
conn.commit()
def get_user(self, user: str, index: int):
def get(self, user: str, index: int):
with self.engine.connect() as conn:
stmt = select(self.table).where(self.table.c.name == user)
cnt = len(conn.execute(stmt).fetchall())