message 统计

This commit is contained in:
snowy 2024-05-13 19:37:10 +08:00
parent c90ac1d21a
commit e843d790b1
2 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ bind-city|绑定城市
命令 命令
```shell ```shell
statistics message --duration <duration> --period <period> --group [current|group_id] --bot [current|bot_id] # 统计Bot接收到的消息 statistic message --duration <duration> --period <period> --group [current|group_id] --bot [current|bot_id] # 统计Bot接收到的消息
# duration: 统计时长支持格式例如1d2h3m4s # duration: 统计时长支持格式例如1d2h3m4s
# period: 统计周期,支持格式同上 # period: 统计周期,支持格式同上
# group: 统计群组支持current(当前群聊)和group_id # group: 统计群组支持current(当前群聊)和group_id
@ -49,7 +49,7 @@ statistics message --duration <duration> --period <period> --group [current|grou
命令别名 命令别名
```shell ```shell
statistics|stat statistic|stat
message|m message|m
--duration|-d --duration|-d
--period|-p --period|-p

View File

@ -10,7 +10,7 @@ from nonebot_plugin_alconna import UniMessage, on_alconna, Alconna, Args, Subcom
stat_msg = on_alconna( stat_msg = on_alconna(
Alconna( Alconna(
"statistics", "statistic",
Subcommand( Subcommand(
"message", "message",
# Args["duration", str, "2d"]["period", str, "60s"], # 默认为1天 # Args["duration", str, "2d"]["period", str, "60s"], # 默认为1天
@ -62,7 +62,7 @@ async def _(result: Arparma, event: T_MessageEvent, bot: Bot):
if group_id in ["all", "a"]: if group_id in ["all", "a"]:
group_id = "all" group_id = "all"
if bot_id == ["current", "c"]: if bot_id in ["current", "c"]:
bot_id = str(bot.self_id) bot_id = str(bot.self_id)
img = await get_stat_msg_image(duration, period, group_id, bot_id, ulang) img = await get_stat_msg_image(duration, period, group_id, bot_id, ulang)