Skip to content

Commit d9c0341

Browse files
committed
fix: fix get_topic_slaves
1 parent f734c00 commit d9c0341

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

efb_telegram_master/db.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,9 @@ def get_topic_slaves(topic_chat_id: TelegramChatID) -> Optional[List[Tuple[EFBCh
454454
List[Tuple[EFBChannelChatIDStr, TelegramTopicID]]: A list of tuples containing slave channel UID and message thread ID
455455
"""
456456
try:
457-
return TopicAssoc.select(TopicAssoc.slave_uid, TopicAssoc.message_thread_id)\
458-
.where(TopicAssoc.topic_chat_id == topic_chat_id).order_by(TopicAssoc.id.desc()).tuples()
457+
query = TopicAssoc.select(TopicAssoc.slave_uid, TopicAssoc.message_thread_id)\
458+
.where(TopicAssoc.topic_chat_id == topic_chat_id).order_by(TopicAssoc.id.desc())
459+
return [(row.slave_uid, int(row.message_thread_id)) for row in query]
459460
except DoesNotExist:
460461
return None
461462
except AttributeError:

0 commit comments

Comments
 (0)