forked from bot/app
✨ message 统计
This commit is contained in:
parent
041ceb81d8
commit
c90ac1d21a
@ -38,6 +38,8 @@ liteyuki-docs 轻雪文档
|
||||
group 群聊 | enable 启用 | disable 停用
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
### **插件/包管理器 `liteyuki_pacman`**
|
||||
|
||||
- 插件管理
|
||||
@ -81,6 +83,8 @@ help 帮助
|
||||
> [!warning]
|
||||
> 受限于NoneBot2钩子函数的依赖注入参数,插件停用只能阻断传入响应,对于主动推送的插件不生效,请阅读插件主页的说明。
|
||||
|
||||
***
|
||||
|
||||
### **用户管理`liteyuki_user`**
|
||||
|
||||
```shell
|
||||
|
@ -9,6 +9,8 @@ category: 使用手册
|
||||
|
||||
### **轻雪天气`liteyuki_weather`**
|
||||
|
||||
查询实时天气,支持绑定城市,支持中英文城市名,支持多个关键词查询。
|
||||
|
||||
配置项
|
||||
|
||||
```yaml
|
||||
@ -25,5 +27,33 @@ bind-city <keywords...> # 绑定查询城市,个人全局生效
|
||||
命令别名
|
||||
|
||||
```shell
|
||||
weather 天气, bind-city 绑定城市
|
||||
weather|天气
|
||||
bind-city|绑定城市
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
### **统计信息`liteyuki_statistics`**
|
||||
|
||||
统计信息
|
||||
命令
|
||||
|
||||
```shell
|
||||
statistics message --duration <duration> --period <period> --group [current|group_id] --bot [current|bot_id] # 统计Bot接收到的消息
|
||||
# duration: 统计时长,支持格式例如:1d2h3m4s
|
||||
# period: 统计周期,支持格式同上
|
||||
# group: 统计群组,支持current(当前群聊)和group_id
|
||||
# bot: 统计Bot,支持current(当前bot)和bot_id
|
||||
```
|
||||
|
||||
命令别名
|
||||
|
||||
```shell
|
||||
statistics|stat
|
||||
message|m
|
||||
--duration|-d
|
||||
--period|-p
|
||||
--group|-g
|
||||
--bot|-b
|
||||
current|c
|
||||
```
|
@ -10,7 +10,7 @@ from nonebot_plugin_alconna import UniMessage, on_alconna, Alconna, Args, Subcom
|
||||
|
||||
stat_msg = on_alconna(
|
||||
Alconna(
|
||||
"stat",
|
||||
"statistics",
|
||||
Subcommand(
|
||||
"message",
|
||||
# Args["duration", str, "2d"]["period", str, "60s"], # 默认为1天
|
||||
@ -37,7 +37,8 @@ stat_msg = on_alconna(
|
||||
alias={"msg", "m"},
|
||||
help_text="查看统计次数内的消息"
|
||||
)
|
||||
)
|
||||
),
|
||||
aliases={"stat"}
|
||||
)
|
||||
|
||||
|
||||
@ -64,5 +65,5 @@ async def _(result: Arparma, event: T_MessageEvent, bot: Bot):
|
||||
if bot_id == ["current", "c"]:
|
||||
bot_id = str(bot.self_id)
|
||||
|
||||
img = await get_stat_msg_image(duration, period, group_id, bot_id)
|
||||
img = await get_stat_msg_image(duration, period, group_id, bot_id, ulang)
|
||||
await stat_msg.send(UniMessage.image(raw=img))
|
||||
|
Loading…
Reference in New Issue
Block a user