MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / get_conversations

Method get_conversations

astrbot/core/db/sqlite.py:246–259  ·  view source on GitHub ↗
(self, user_id=None, platform_id=None)

Source from the content-addressed store, hash-verified

244 # ====
245
246 async def get_conversations(self, user_id=None, platform_id=None):
247 async with self.get_db() as session:
248 session: AsyncSession
249 query = select(ConversationV2)
250
251 if user_id:
252 query = query.where(ConversationV2.user_id == user_id)
253 if platform_id:
254 query = query.where(ConversationV2.platform_id == platform_id)
255 # order by
256 query = query.order_by(desc(ConversationV2.created_at))
257 result = await session.execute(query)
258
259 return result.scalars().all()
260
261 async def get_conversation_by_id(self, cid):
262 async with self.get_db() as session:

Callers

nothing calls this directly

Calls 4

allMethod · 0.80
scalarsMethod · 0.80
get_dbMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected