This should get us back on track (tested on ARCH Linux)

This commit is contained in:
Cedric
2023-07-27 18:07:02 +02:00
parent 5c158cf8a8
commit e4586a5834
23 changed files with 836 additions and 76 deletions
@@ -38,12 +38,14 @@ class CharacterInfoController:
def pre_start(self):
self.bot.register_packet_handler(CharacterName.id, self.character_name_update)
self.db.shared.exec("CREATE TABLE IF NOT EXISTS name_history ("
"char_id INT NOT NULL, "
"name VARCHAR(20) NOT NULL, "
"created_at INT NOT NULL, "
"PRIMARY KEY (char_id, name))")
def start(self):
self.db.exec("CREATE TABLE IF NOT EXISTS name_history ("
"char_id INT NOT NULL, "
"name VARCHAR(20) NOT NULL, "
"created_at INT NOT NULL, "
"PRIMARY KEY (char_id, name))")
self.db.create_view("name_history")
self.command_alias_service.add_alias("w", "whois")
self.command_alias_service.add_alias("lookup", "whois")
@@ -155,7 +157,7 @@ class CharacterInfoController:
with self.db.pool.get_connection() as conn:
with conn.cursor() as cur:
cur.executemany("INSERT IGNORE INTO name_history (char_id, name, created_at) "
"VALUES (?, ?, ?)",
"VALUES (%s, %s, %s)",
self.name_history)
self.name_history = []