diff --git a/telethon/sessions/sqlite.py b/telethon/sessions/sqlite.py index 82b2129d..26ed586b 100644 --- a/telethon/sessions/sqlite.py +++ b/telethon/sessions/sqlite.py @@ -201,7 +201,7 @@ class SQLiteSession(MemorySession): )) c.close() - def get_update_state(self, entity_id): + async def get_update_state(self, entity_id): row = self._execute('select pts, qts, date, seq from update_state ' 'where id = ?', entity_id) if row: @@ -210,12 +210,12 @@ class SQLiteSession(MemorySession): date, tz=datetime.timezone.utc) return types.updates.State(pts, qts, date, seq, unread_count=0) - def set_update_state(self, entity_id, state): + async def set_update_state(self, entity_id, state): self._execute('insert or replace into update_state values (?,?,?,?,?)', entity_id, state.pts, state.qts, state.date.timestamp(), state.seq) - def save(self): + async def save(self): """Saves the current session object as session_user_id.session""" # This is a no-op if there are no changes to commit, so there's # no need for us to keep track of an "unsaved changes" variable. @@ -240,7 +240,7 @@ class SQLiteSession(MemorySession): finally: c.close() - def close(self): + async def close(self): """Closes the connection unless we're working in-memory""" if self.filename != ':memory:': if self._conn is not None: @@ -248,7 +248,7 @@ class SQLiteSession(MemorySession): self._conn.close() self._conn = None - def delete(self): + async def delete(self): """Deletes the current session file""" if self.filename == ':memory:': return True @@ -268,7 +268,7 @@ class SQLiteSession(MemorySession): # Entity processing - def process_entities(self, tlo): + async def process_entities(self, tlo): """ Processes all the found entities on the given TLObject, unless .save_entities is False.