aboutsummaryrefslogtreecommitdiff
path: root/velascobot2
diff options
context:
space:
mode:
authorGuillermo Serrahima <dev@vylion.com>2026-02-02 15:44:19 +0100
committerGuillermo Serrahima <dev@vylion.com>2026-02-02 15:44:19 +0100
commitd2d0f2922bc7bd49718240a23bb7f9f6d9cfda18 (patch)
tree624e13b747759f39836c1638ec95369227699043 /velascobot2
parentc26453b6150eb3dad09e97c1a2b5ba796ae8af39 (diff)
downloadvelascobot2-d2d0f2922bc7bd49718240a23bb7f9f6d9cfda18.tar.xz
velascobot2-d2d0f2922bc7bd49718240a23bb7f9f6d9cfda18.zip
Fixed all chats
Diffstat (limited to 'velascobot2')
-rw-r--r--velascobot2/bot.py2
-rw-r--r--velascobot2/database.py17
-rw-r--r--velascobot2/messenger.py4
-rw-r--r--velascobot2/parrot.py4
4 files changed, 0 insertions, 27 deletions
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()