diff --git a/velascobot2/bot.py b/velascobot2/bot.py index 51ed5e3..2a997ff 100644 --- a/velascobot2/bot.py +++ b/velascobot2/bot.py @@ -383,8 +383,6 @@ class Bot: pass async def wake_up(self, exclusive: bool = False) -> None: - self.messenger.fix_all_chats() - if not self.messenger.wake_up: return if len(self.motd_list) == 0: diff --git a/velascobot2/database.py b/velascobot2/database.py index 720d10c..582495f 100644 --- a/velascobot2/database.py +++ b/velascobot2/database.py @@ -241,23 +241,6 @@ class Database: ) return count - # I made an oopsie when converting the old jsons to sqlite. I will remove this in the next commit - def fix_all_chats(self): - self.merge_and_rename_key('', ' ') - - def merge_and_rename_key(self, old_key: str, new_key: str): - with _SQLiteContextMgr(database=self.db_name) as db: - db.execute(""" - INSERT INTO vocab (chat_id, key, word, count) - SELECT chat_id, ?, word, count - FROM vocab - WHERE key = ? - ON CONFLICT(chat_id, key, word) DO UPDATE SET count = count + excluded.count - """, (new_key, old_key)) - - # delete old key entries - db.execute("DELETE FROM vocab WHERE key = ?", (old_key,)) - def get_all_chats(self) -> list[ChatData]: with _SQLiteContextMgr(database=self.db_name) as db: rows = db.execute("SELECT * FROM chats").fetchall() diff --git a/velascobot2/messenger.py b/velascobot2/messenger.py index c328d92..7298cac 100644 --- a/velascobot2/messenger.py +++ b/velascobot2/messenger.py @@ -138,7 +138,3 @@ class Messenger: def update_set_silenced(self, chat_id: str, silenced: bool): self._parrot.update_chat_set_silenced(chat_id, silenced) - - # I made an oopsie when converting the old jsons to sqlite. I will remove this in the next commit - def fix_all_chats(self): - self._parrot.fix_all_chats() diff --git a/velascobot2/parrot.py b/velascobot2/parrot.py index 02e5495..9ca139a 100644 --- a/velascobot2/parrot.py +++ b/velascobot2/parrot.py @@ -133,7 +133,3 @@ class Parrot: def update_chat_set_silenced(self, chat_id: str, silenced: bool): self.db.update_chat_set_silenced(chat_id, silenced) - - # I made an oopsie when converting the old jsons to sqlite. I will remove this in the next commit - def fix_all_chats(self): - self.db.fix_all_chats()