Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions mxmariadb/autodelete_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,17 @@ async def get_all(self) -> List[tuple]:
async with conn.cursor() as cur:
await cur.execute('SELECT channel_id, duration, exclude_pinned, exclude_bots FROM autodelete ORDER BY channel_id')
results = await cur.fetchall()
# Umwandlung von Dict (aus Connector) in Tuple (für Cog Kompatibilität)
return [(r['channel_id'], r['duration'], r['exclude_pinned'], r['exclude_bots']) for r in results]
# results ist bereits eine Liste von Tupeln, keine Konvertierung nötig
return results

async def get_autodelete_full(self, channel_id: int) -> Optional[tuple]:
if not await self._ensure_pool(): return None
async with self.pool.acquire() as conn:
async with conn.cursor() as cur:
await cur.execute('SELECT duration, exclude_pinned, exclude_bots FROM autodelete WHERE channel_id = %s', (channel_id,))
r = await cur.fetchone()
return (r['duration'], r['exclude_pinned'], r['exclude_bots']) if r else None
# r ist bereits ein Tupel, wir können es direkt zurückgeben
return r if r else None

async def update_stats(self, channel_id: int, deleted_count: int = 0, error_count: int = 0):
if not await self._ensure_pool(): return
Expand Down
276 changes: 268 additions & 8 deletions mxmariadb/cms_db.py

Large diffs are not rendered by default.

Loading
Loading