Commit 034452b
src/history/query.py
@@ -195,6 +195,7 @@ async def query_turso(client: Client, table_name: str, match_time: str, user: st
for row in rows:
row_info = {col["name"]: x["value"] for x, col in zip(row, cols, strict=True)}
url = f"https://t.me/c/{cid}/{row_info['mid']}"
- texts += f"๐ค[{row_info['fullname']}]({url}) {row_info['time']}{mtype_emoji(row_info['mtype'])}:\n{row_info['content']}\n"
+ username = row_info["fullname"] or "ๅฟๅ"
+ texts += f"๐ค[{username}]({url}) {row_info['time']}{mtype_emoji(row_info['mtype'])}:\n{row_info['content']}\n"
count += 1
return {"texts": texts.strip(), "count": count}
src/history/utils.py
@@ -149,6 +149,4 @@ def mtype_emoji(mtype: str) -> str:
"voice": "๐ค",
"web_page": "๐",
}
- if mtype in emojis:
- return "|" + emojis[mtype]
- return ""
+ return emojis.get(mtype, "")