mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2025-08-02 09:09:51 +00:00
✨ 消息统计新增指定用户选项
This commit is contained in:
@ -22,7 +22,7 @@ async def count_msg_by_bot_id(bot_id: str) -> int:
|
||||
return len(msg_rows)
|
||||
|
||||
|
||||
async def get_stat_msg_image(duration: int, period: int, group_id: str = None, bot_id: str = None,
|
||||
async def get_stat_msg_image(duration: int, period: int, group_id: str = None, bot_id: str = None, user_id: str = None,
|
||||
ulang: Language = Language()) -> bytes:
|
||||
"""
|
||||
获取统计消息
|
||||
@ -50,6 +50,10 @@ async def get_stat_msg_image(duration: int, period: int, group_id: str = None, b
|
||||
condition += " AND bot_id = ?"
|
||||
condition_args.append(bot_id)
|
||||
|
||||
if user_id:
|
||||
condition += " AND user_id = ?"
|
||||
condition_args.append(user_id)
|
||||
|
||||
msg_rows = msg_db.where_all(
|
||||
MessageEventModel(),
|
||||
condition,
|
||||
|
Reference in New Issue
Block a user