nonebot-plugin-dialectlist 2.7.0__tar.gz → 3.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {nonebot_plugin_dialectlist-2.7.0/nonebot_plugin_dialectlist.egg-info → nonebot_plugin_dialectlist-3.0.1}/PKG-INFO +75 -68
  2. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/README.md +70 -63
  3. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist/__init__.py +17 -37
  4. nonebot_plugin_dialectlist-3.0.1/nonebot_plugin_dialectlist/config.py +30 -0
  5. nonebot_plugin_dialectlist-3.0.1/nonebot_plugin_dialectlist/schema.py +11 -0
  6. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist/usage.py +2 -2
  7. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist/utils.py +59 -53
  8. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1/nonebot_plugin_dialectlist.egg-info}/PKG-INFO +75 -68
  9. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist.egg-info/SOURCES.txt +1 -3
  10. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist.egg-info/requires.txt +4 -4
  11. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/pyproject.toml +5 -5
  12. nonebot_plugin_dialectlist-2.7.0/nonebot_plugin_dialectlist/config.py +0 -29
  13. nonebot_plugin_dialectlist-2.7.0/nonebot_plugin_dialectlist/migrations/fb88e4d27eb8_update_dialectlist.py +0 -47
  14. nonebot_plugin_dialectlist-2.7.0/nonebot_plugin_dialectlist/model.py +0 -23
  15. nonebot_plugin_dialectlist-2.7.0/nonebot_plugin_dialectlist/storage.py +0 -133
  16. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/LICENSE +0 -0
  17. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/MANIFEST.in +0 -0
  18. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist/template/avatar/default.jpg +0 -0
  19. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist/template/css/style.css +0 -0
  20. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist/template/rank_template.j2 +0 -0
  21. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist/time.py +0 -0
  22. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist.egg-info/dependency_links.txt +0 -0
  23. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/nonebot_plugin_dialectlist.egg-info/top_level.txt +0 -0
  24. {nonebot_plugin_dialectlist-2.7.0 → nonebot_plugin_dialectlist-3.0.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nonebot-plugin-dialectlist
3
- Version: 2.7.0
3
+ Version: 3.0.1
4
4
  Summary: 看看你群群友有多能说
5
5
  Author-email: Chen_Xu233 <woyerpa@outlook.com>
6
6
  License: MIT
@@ -15,13 +15,13 @@ Requires-Dist: nonebot-plugin-cesaa>=0.4.0
15
15
  Requires-Dist: nonebot-plugin-userinfo>=0.2.6
16
16
  Requires-Dist: nonebot-plugin-htmlrender>=0.3.3
17
17
  Requires-Dist: nonebot2>=2.3.2
18
- Requires-Dist: pillow>=10.4.0
18
+ Requires-Dist: pillow>=11.3.0
19
19
  Requires-Dist: nonebot-plugin-uninfo>=0.1.1
20
20
  Provides-Extra: dev
21
21
  Requires-Dist: ruff>=0.5.5; extra == "dev"
22
- Requires-Dist: setuptools>=71.1.0; extra == "dev"
23
- Requires-Dist: twine>=5.1.0; extra == "dev"
24
- Requires-Dist: nb-cli>=0.7.6; extra == "dev"
22
+ Requires-Dist: setuptools>=80.9.0; extra == "dev"
23
+ Requires-Dist: twine>=6.2.0; extra == "dev"
24
+ Requires-Dist: nb-cli>=1.4.2; extra == "dev"
25
25
  Requires-Dist: py-spy>=0.3.14; extra == "dev"
26
26
  Provides-Extra: test
27
27
  Requires-Dist: nonebot-adapter-onebot>=2.4.4; extra == "test"
@@ -35,14 +35,15 @@ Dynamic: license-file
35
35
 
36
36
  <div align="center">
37
37
 
38
- # 📃话痨排行榜
38
+ # 📃 话痨排行榜
39
+
39
40
  nonebot-plugin-dialectlist
40
41
 
41
42
  <p align="center">
42
43
  <a href="https://pypi.python.org/pypi/nonebot-plugin-dialectlist">
43
44
  <img src="https://img.shields.io/pypi/v/nonebot-plugin-dialectlist.svg" alt="pypi">
44
45
  </a>
45
-
46
+
46
47
  <img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="python">
47
48
 
48
49
  <a href="https://qm.qq.com/q/Yty2yc9Bee">
@@ -50,22 +51,28 @@ nonebot-plugin-dialectlist
50
51
  </a>
51
52
  </p>
52
53
 
54
+ [![wakatime](https://wakatime.com/badge/user/114aee90-a5f9-49aa-b441-9eca7eebfda3/project/68aaa2a1-fb8a-4b00-bb66-ee67e8a3f3b0.svg)](https://wakatime.com/badge/user/114aee90-a5f9-49aa-b441-9eca7eebfda3/project/68aaa2a1-fb8a-4b00-bb66-ee67e8a3f3b0)
55
+
53
56
  \>💬**看看群友们这些天在群里水了多少话**💬<
57
+
54
58
  </div>
55
59
 
56
60
  ## 💿 安装
57
61
 
58
62
  通过`pip`或`nb`安装:
63
+
59
64
  - 通过 pip 安装
65
+
60
66
  ```bash
61
67
  pip install nonebot-plugin-dialectlist
62
68
  ```
69
+
63
70
  - 通过 nb-cli 安装
71
+
64
72
  ```bash
65
73
  nb plugin install nonebot-plugin-dialectlist
66
74
  ```
67
75
 
68
-
69
76
  ### ✅ 插件依赖于
70
77
 
71
78
  1. [nonebot-plugin-datastore](https://github.com/he0119/nonebot-plugin-datastore) ————本地化储存
@@ -75,13 +82,14 @@ nb plugin install nonebot-plugin-dialectlist
75
82
  5. [nonebot-plugin-chatrecorder](https://github.com/noneplugin/nonebot-plugin-chatrecorder) ————实现消息储存
76
83
  6. [nonebot-plugin-cesaa](https://github.com/MountainDash/nonebot-plugin-send-anything-anywhere) ————实现多平台
77
84
 
78
- **⚠注意** 若先前没有安装过```nonebot-plugin-chatrecorder```或者```nonebot-plugin-orm```,则会在启动时报错,请按报错的提示安装数据库!
79
-
85
+ **⚠ 注意** 若先前没有安装过`nonebot-plugin-chatrecorder`或者`nonebot-plugin-orm`,则会在启动时报错,请按报错的提示安装数据库!
86
+
80
87
  ## ⚙ 配置
81
88
 
82
89
  需要**提前配置**本插件所**依赖的插件**!
83
90
 
84
91
  在 .env 中,可以添加以下配置项
92
+
85
93
  ```python
86
94
  dialectlist__get_num: int = 5 # 获取人数数量
87
95
  dialectlist__font: str = "SimHei" # 字体格式
@@ -89,73 +97,74 @@ dialectlist__suffix: bool = True # 是否显示后缀
89
97
  dialectlist__excluded_self: bool = True # 是否排除自己
90
98
  dialectlist__visualization: bool = True # 是否可视化
91
99
  dialectlist__show_text_rank: bool = True # 是否显示文本排名
92
- dialectlist__counting_cache: bool = False # 计数缓存(能够提高回复速度)
93
- dialectlist__excluded_people: List[str] = [] # 排除的人的QQ号
100
+ dialectlist__excluded_people: List[str] = [] # 排除的人的 QQ 号
94
101
  dialectlist__use_user_info_cache: bool = False # 是否使用用户信息缓存
95
102
  dialectlist__aggregate_transmission: bool = False # 是否聚合转发消息
96
103
  dialectlist__timezone: Optional[str] = "Asia/Shanghai" # 时区,影响统计时间
97
- dialectlist__string_suffix: str = "统计花费时间:{timecost}秒" # 消息格式后缀
104
+ dialectlist__string_suffix: str = "统计花费时间:{timecost}秒" # 消息格式后缀
98
105
  dialectlist__template_path: str = "./template/rank_template.j2" # 模板路径
99
- dialectlist__string_format: str = "第{index}名:\n{nickname},{chatdatanum}条消息\n" # 消息格式
106
+ dialectlist__string_format: str = "第{index}名:\n{nickname},{chatdatanum}条消息、n" # 消息格式
100
107
  ```
101
- 💭也可以不进行配置,这将会使插件按照默认配置运行
102
108
 
103
- ### ⚠ 注意!!
109
+ 💭 也可以不进行配置,这将会使插件按照默认配置运行
110
+
111
+ ### ⚠ 注意!!
104
112
 
105
113
  > 在旧版插件(2.0.0 以下)中,dialectlist 与后面的配置项只隔了一个下划线,若更新到新版本以后需要俩个下划线。
106
114
 
107
- > 由于插件依赖chatrecord多次引入爆炸性修改,建议在遇到问题后优先尝试降级chatrecord插件
115
+ > 由于插件依赖 chatrecord 多次引入爆炸性修改,建议在遇到问题后优先尝试降级 chatrecord 插件
108
116
 
109
- ## 🗨命令
110
- __!!注意!!__
117
+ ## 🗨 命令
118
+
119
+ **!!注意!!**
111
120
  新版本指令调用方式改变,改为更易理解也更好打的 B 话榜。
112
121
  同时也可以用类似 `/今日废话榜` 的方式(只要改前面的就好了)(算是给 [盘古之白](https://github.com/vinta/pangu.js) 风格爱好者的福利吧?)
113
122
 
114
- ### 🎨一般用法
123
+ ### 🎨 一般用法
115
124
 
116
- #### B话榜
125
+ #### B 话榜
117
126
 
118
- -`/B话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
127
+ -`/B 话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
119
128
 
120
- -`/今日B话榜` ————看看今天的群友发了多少消息!
129
+ -`/今日 B 话榜` ————看看今天的群友发了多少消息!
121
130
 
122
- -`/昨日B话榜` ————看看昨天的群友发了多少消息!
131
+ -`/昨日 B 话榜` ————看看昨天的群友发了多少消息!
123
132
 
124
- -`/前日B话榜` ————看看前天的群友发了多少消息!
133
+ -`/前日 B 话榜` ————看看前天的群友发了多少消息!
125
134
 
126
- -`/本周B话榜` ————看看本周的群友发了多少消息!
127
-
128
- -`/上周B话榜` ————看看上周的群友发了多少消息!
135
+ -`/本周 B 话榜` ————看看本周的群友发了多少消息!
129
136
 
130
- -`/本月B话榜` ————看看这个月的群友发了多少消息!
137
+ -`/上周 B 话榜` ————看看上周的群友发了多少消息!
131
138
 
132
- -`/年度B话榜` ————看看今年的群友发了多少消息!
139
+ -`/本月 B 话榜` ————看看这个月的群友发了多少消息!
133
140
 
134
- -`/历史B话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
141
+ -`/年度 B 话榜` ————看看今年的群友发了多少消息!
135
142
 
136
- #### 看看B话(kkb)
143
+ -`/历史 B 话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
137
144
 
138
- -`/看看B话 [@某人|QQ号]` ————看看这个b人在这个b群发了多少b话!
145
+ #### 看看 B 话(kkb)
139
146
 
140
- ### 🚀进阶用法
147
+ -`/看看 B 话 [@某人|QQ 号]` ————看看这个 b 人在这个 b 群发了多少 b 话!
141
148
 
142
- #### B话榜
149
+ ### 🚀 进阶用法
143
150
 
144
- `/{时间类型(今日|年度)?}{B话榜|废话榜} {时间类型?} {ISO8601 格式时间 ?} {群号} {关键词}`
151
+ #### B 话榜
145
152
 
146
- 如:`/B话榜 历史 2024-01-01~2024-01-02 12345678 女装`
153
+ `/{时间类型(今日|年度)?}{B 话榜|废话榜} {时间类型?} {ISO8601 格式时间 ?} {群号} {关键词}`
147
154
 
148
- 也可以 `/{时间类型(今日|年度)?}{B话榜|废话榜} {时间类型?} {ISO8601 格式时间 ?} -g {群号} -k {关键词}`
155
+ 如:`/B 话榜 历史 2024-01-01~2024-01-02 12345678 女装`
156
+
157
+ 也可以 `/{时间类型(今日|年度)?}{B 话榜|废话榜} {时间类型?} {ISO8601 格式时间 ?} -g {群号} -k {关键词}`
149
158
 
150
159
  以下调用方法均合法:
151
160
 
152
- `/今日B话榜 -g 12345678 -k 女装`
153
- `/昨日B话榜 -k 女装`
154
- `/本周B话榜 -g 12345678`
161
+ `/今日 B 话榜 -g 12345678 -k 女装`
162
+ `/昨日 B 话榜 -k 女装`
163
+ `/本周 B 话榜 -g 12345678`
155
164
 
156
- #### 看看B话
165
+ #### 看看 B 话
157
166
 
158
- `/看看B话 {@|QQ号} {群号?} {关键词?}`
167
+ `/看看 B 话 {@|QQ 号} {群号?} {关键词?}`
159
168
 
160
169
  以下调用方法均合法:
161
170
 
@@ -167,28 +176,28 @@ __!!注意!!__
167
176
 
168
177
  ## 💪 目前支持的平台
169
178
 
170
- | 平台 | 是否经过测试 | 是否能够正常工作 | 测试环境 |
171
- |:-----:|:----:|:----:| :----: |
172
- | Onebot | ✅ | ✅ | NapCat + Window11|
173
- | 飞书 | ❌ | ❓ | 🤔 |
174
- | Red | ❌ | ❓ | 🤔 |
175
- | DoDo | ❌ | ❓ | 🤔 |
176
- | Mirai | ❌ | ❓ | 🤔 |
177
- | 开黑啦 | ❌ | ❓ | 🤔 |
178
- | Kritor | ❌ | ❓ | 🤔 |
179
- | Ntchat | ❌ | ❓ | 🤔 |
180
- | Satori | ❌ | ❓ | 🤔 |
181
- | Telegram | ❌ | ❓ | 🤔 |
182
- | Discord | ❌ | ❓ | 🤔 |
183
- | Tailchat | ❌ | ❓ | 🤔 |
184
- | QQ 官方接口 | ❌ | ❓ | 🤔 |
185
- | Rocket.Chat | ❌ | ❓ | 🤔 |
179
+ | 平台 | 是否经过测试 | 是否能够正常工作 | 测试环境 |
180
+ | :---------: | :----------: | :--------------: | :---------------: |
181
+ | Onebot | ✅ | ✅ | NapCat + Window11 |
182
+ | 飞书 | ❌ | ❓ | 🤔 |
183
+ | Red | ❌ | ❓ | 🤔 |
184
+ | DoDo | ❌ | ❓ | 🤔 |
185
+ | Mirai | ❌ | ❓ | 🤔 |
186
+ | 开黑啦 | ❌ | ❓ | 🤔 |
187
+ | Kritor | ❌ | ❓ | 🤔 |
188
+ | Ntchat | ❌ | ❓ | 🤔 |
189
+ | Satori | ❌ | ❓ | 🤔 |
190
+ | Telegram | ❌ | ❓ | 🤔 |
191
+ | Discord | ❌ | ❓ | 🤔 |
192
+ | Tailchat | ❌ | ❓ | 🤔 |
193
+ | QQ 官方接口 | ❌ | ❓ | 🤔 |
194
+ | Rocket.Chat | ❌ | ❓ | 🤔 |
186
195
 
187
196
  - 如果你测试过能够使用,请在 Issue 中指出
188
197
 
189
- ## 📦另外
198
+ ## 📦 另外
190
199
 
191
- ### 😳加入作者的 BUG 反馈群 ~~(🥵女装粉丝群)~~
200
+ ### 😳 加入作者的 BUG 反馈群 ~~(🥵 女装粉丝群)~~
192
201
 
193
202
  [群连接](https://qm.qq.com/q/Yty2yc9Bee)
194
203
 
@@ -201,10 +210,9 @@ __!!注意!!__
201
210
 
202
211
  ![9c149e99ca747c13892be3f9fbeedf31](https://github.com/user-attachments/assets/d02d108c-1ab3-4ad1-9123-c1a98862e627)
203
212
 
213
+ ### 💕 感谢
204
214
 
205
- ### 💕感谢
206
-
207
- 本插件的__init__.py 中的处理函数参考了词云中的方法 ~~(其实大部分都是 Ctrl+C Ctr+V)~~
215
+ 本插件的**init**.py 中的处理函数参考了词云中的方法 ~~(其实大部分都是 Ctrl+C Ctr+V)~~
208
216
 
209
217
  [nonebot-plugin-wordcloud](https://github.com/he0119/nonebot-plugin-wordcloud)
210
218
 
@@ -221,7 +229,6 @@ __!!注意!!__
221
229
  - [x] 更好看的图片渲染
222
230
 
223
231
  - [x] 添加一些全新的可配置项
224
-
225
232
  - [x] 尝试利用 jinja2 模板引擎制作可视化图片
226
233
 
227
234
  - [x] 私聊的查询(超级用户可以任意查询群聊的信息)一半完成
@@ -231,9 +238,9 @@ __!!注意!!__
231
238
  - [x] 查询带某关键词的消息量
232
239
 
233
240
  - [x] 合并转发
234
-
235
- 待补充。.....
236
241
 
242
+ 待补充。.....
243
+
244
+ ### 👾 题外话
237
245
 
238
- ### 👾题外话
239
246
  ~~整个项目快被我写成屎山了~~
@@ -6,14 +6,15 @@
6
6
 
7
7
  <div align="center">
8
8
 
9
- # 📃话痨排行榜
9
+ # 📃 话痨排行榜
10
+
10
11
  nonebot-plugin-dialectlist
11
12
 
12
13
  <p align="center">
13
14
  <a href="https://pypi.python.org/pypi/nonebot-plugin-dialectlist">
14
15
  <img src="https://img.shields.io/pypi/v/nonebot-plugin-dialectlist.svg" alt="pypi">
15
16
  </a>
16
-
17
+
17
18
  <img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="python">
18
19
 
19
20
  <a href="https://qm.qq.com/q/Yty2yc9Bee">
@@ -21,22 +22,28 @@ nonebot-plugin-dialectlist
21
22
  </a>
22
23
  </p>
23
24
 
25
+ [![wakatime](https://wakatime.com/badge/user/114aee90-a5f9-49aa-b441-9eca7eebfda3/project/68aaa2a1-fb8a-4b00-bb66-ee67e8a3f3b0.svg)](https://wakatime.com/badge/user/114aee90-a5f9-49aa-b441-9eca7eebfda3/project/68aaa2a1-fb8a-4b00-bb66-ee67e8a3f3b0)
26
+
24
27
  \>💬**看看群友们这些天在群里水了多少话**💬<
28
+
25
29
  </div>
26
30
 
27
31
  ## 💿 安装
28
32
 
29
33
  通过`pip`或`nb`安装:
34
+
30
35
  - 通过 pip 安装
36
+
31
37
  ```bash
32
38
  pip install nonebot-plugin-dialectlist
33
39
  ```
40
+
34
41
  - 通过 nb-cli 安装
42
+
35
43
  ```bash
36
44
  nb plugin install nonebot-plugin-dialectlist
37
45
  ```
38
46
 
39
-
40
47
  ### ✅ 插件依赖于
41
48
 
42
49
  1. [nonebot-plugin-datastore](https://github.com/he0119/nonebot-plugin-datastore) ————本地化储存
@@ -46,13 +53,14 @@ nb plugin install nonebot-plugin-dialectlist
46
53
  5. [nonebot-plugin-chatrecorder](https://github.com/noneplugin/nonebot-plugin-chatrecorder) ————实现消息储存
47
54
  6. [nonebot-plugin-cesaa](https://github.com/MountainDash/nonebot-plugin-send-anything-anywhere) ————实现多平台
48
55
 
49
- **⚠注意** 若先前没有安装过```nonebot-plugin-chatrecorder```或者```nonebot-plugin-orm```,则会在启动时报错,请按报错的提示安装数据库!
50
-
56
+ **⚠ 注意** 若先前没有安装过`nonebot-plugin-chatrecorder`或者`nonebot-plugin-orm`,则会在启动时报错,请按报错的提示安装数据库!
57
+
51
58
  ## ⚙ 配置
52
59
 
53
60
  需要**提前配置**本插件所**依赖的插件**!
54
61
 
55
62
  在 .env 中,可以添加以下配置项
63
+
56
64
  ```python
57
65
  dialectlist__get_num: int = 5 # 获取人数数量
58
66
  dialectlist__font: str = "SimHei" # 字体格式
@@ -60,73 +68,74 @@ dialectlist__suffix: bool = True # 是否显示后缀
60
68
  dialectlist__excluded_self: bool = True # 是否排除自己
61
69
  dialectlist__visualization: bool = True # 是否可视化
62
70
  dialectlist__show_text_rank: bool = True # 是否显示文本排名
63
- dialectlist__counting_cache: bool = False # 计数缓存(能够提高回复速度)
64
- dialectlist__excluded_people: List[str] = [] # 排除的人的QQ号
71
+ dialectlist__excluded_people: List[str] = [] # 排除的人的 QQ 号
65
72
  dialectlist__use_user_info_cache: bool = False # 是否使用用户信息缓存
66
73
  dialectlist__aggregate_transmission: bool = False # 是否聚合转发消息
67
74
  dialectlist__timezone: Optional[str] = "Asia/Shanghai" # 时区,影响统计时间
68
- dialectlist__string_suffix: str = "统计花费时间:{timecost}秒" # 消息格式后缀
75
+ dialectlist__string_suffix: str = "统计花费时间:{timecost}秒" # 消息格式后缀
69
76
  dialectlist__template_path: str = "./template/rank_template.j2" # 模板路径
70
- dialectlist__string_format: str = "第{index}名:\n{nickname},{chatdatanum}条消息\n" # 消息格式
77
+ dialectlist__string_format: str = "第{index}名:\n{nickname},{chatdatanum}条消息、n" # 消息格式
71
78
  ```
72
- 💭也可以不进行配置,这将会使插件按照默认配置运行
73
79
 
74
- ### ⚠ 注意!!
80
+ 💭 也可以不进行配置,这将会使插件按照默认配置运行
81
+
82
+ ### ⚠ 注意!!
75
83
 
76
84
  > 在旧版插件(2.0.0 以下)中,dialectlist 与后面的配置项只隔了一个下划线,若更新到新版本以后需要俩个下划线。
77
85
 
78
- > 由于插件依赖chatrecord多次引入爆炸性修改,建议在遇到问题后优先尝试降级chatrecord插件
86
+ > 由于插件依赖 chatrecord 多次引入爆炸性修改,建议在遇到问题后优先尝试降级 chatrecord 插件
79
87
 
80
- ## 🗨命令
81
- __!!注意!!__
88
+ ## 🗨 命令
89
+
90
+ **!!注意!!**
82
91
  新版本指令调用方式改变,改为更易理解也更好打的 B 话榜。
83
92
  同时也可以用类似 `/今日废话榜` 的方式(只要改前面的就好了)(算是给 [盘古之白](https://github.com/vinta/pangu.js) 风格爱好者的福利吧?)
84
93
 
85
- ### 🎨一般用法
94
+ ### 🎨 一般用法
86
95
 
87
- #### B话榜
96
+ #### B 话榜
88
97
 
89
- -`/B话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
98
+ -`/B 话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
90
99
 
91
- -`/今日B话榜` ————看看今天的群友发了多少消息!
100
+ -`/今日 B 话榜` ————看看今天的群友发了多少消息!
92
101
 
93
- -`/昨日B话榜` ————看看昨天的群友发了多少消息!
102
+ -`/昨日 B 话榜` ————看看昨天的群友发了多少消息!
94
103
 
95
- -`/前日B话榜` ————看看前天的群友发了多少消息!
104
+ -`/前日 B 话榜` ————看看前天的群友发了多少消息!
96
105
 
97
- -`/本周B话榜` ————看看本周的群友发了多少消息!
98
-
99
- -`/上周B话榜` ————看看上周的群友发了多少消息!
106
+ -`/本周 B 话榜` ————看看本周的群友发了多少消息!
100
107
 
101
- -`/本月B话榜` ————看看这个月的群友发了多少消息!
108
+ -`/上周 B 话榜` ————看看上周的群友发了多少消息!
102
109
 
103
- -`/年度B话榜` ————看看今年的群友发了多少消息!
110
+ -`/本月 B 话榜` ————看看这个月的群友发了多少消息!
104
111
 
105
- -`/历史B话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
112
+ -`/年度 B 话榜` ————看看今年的群友发了多少消息!
106
113
 
107
- #### 看看B话(kkb)
114
+ -`/历史 B 话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
108
115
 
109
- -`/看看B话 [@某人|QQ号]` ————看看这个b人在这个b群发了多少b话!
116
+ #### 看看 B 话(kkb)
110
117
 
111
- ### 🚀进阶用法
118
+ -`/看看 B 话 [@某人|QQ 号]` ————看看这个 b 人在这个 b 群发了多少 b 话!
112
119
 
113
- #### B话榜
120
+ ### 🚀 进阶用法
114
121
 
115
- `/{时间类型(今日|年度)?}{B话榜|废话榜} {时间类型?} {ISO8601 格式时间 ?} {群号} {关键词}`
122
+ #### B 话榜
116
123
 
117
- 如:`/B话榜 历史 2024-01-01~2024-01-02 12345678 女装`
124
+ `/{时间类型(今日|年度)?}{B 话榜|废话榜} {时间类型?} {ISO8601 格式时间 ?} {群号} {关键词}`
118
125
 
119
- 也可以 `/{时间类型(今日|年度)?}{B话榜|废话榜} {时间类型?} {ISO8601 格式时间 ?} -g {群号} -k {关键词}`
126
+ 如:`/B 话榜 历史 2024-01-01~2024-01-02 12345678 女装`
127
+
128
+ 也可以 `/{时间类型(今日|年度)?}{B 话榜|废话榜} {时间类型?} {ISO8601 格式时间 ?} -g {群号} -k {关键词}`
120
129
 
121
130
  以下调用方法均合法:
122
131
 
123
- `/今日B话榜 -g 12345678 -k 女装`
124
- `/昨日B话榜 -k 女装`
125
- `/本周B话榜 -g 12345678`
132
+ `/今日 B 话榜 -g 12345678 -k 女装`
133
+ `/昨日 B 话榜 -k 女装`
134
+ `/本周 B 话榜 -g 12345678`
126
135
 
127
- #### 看看B话
136
+ #### 看看 B 话
128
137
 
129
- `/看看B话 {@|QQ号} {群号?} {关键词?}`
138
+ `/看看 B 话 {@|QQ 号} {群号?} {关键词?}`
130
139
 
131
140
  以下调用方法均合法:
132
141
 
@@ -138,28 +147,28 @@ __!!注意!!__
138
147
 
139
148
  ## 💪 目前支持的平台
140
149
 
141
- | 平台 | 是否经过测试 | 是否能够正常工作 | 测试环境 |
142
- |:-----:|:----:|:----:| :----: |
143
- | Onebot | ✅ | ✅ | NapCat + Window11|
144
- | 飞书 | ❌ | ❓ | 🤔 |
145
- | Red | ❌ | ❓ | 🤔 |
146
- | DoDo | ❌ | ❓ | 🤔 |
147
- | Mirai | ❌ | ❓ | 🤔 |
148
- | 开黑啦 | ❌ | ❓ | 🤔 |
149
- | Kritor | ❌ | ❓ | 🤔 |
150
- | Ntchat | ❌ | ❓ | 🤔 |
151
- | Satori | ❌ | ❓ | 🤔 |
152
- | Telegram | ❌ | ❓ | 🤔 |
153
- | Discord | ❌ | ❓ | 🤔 |
154
- | Tailchat | ❌ | ❓ | 🤔 |
155
- | QQ 官方接口 | ❌ | ❓ | 🤔 |
156
- | Rocket.Chat | ❌ | ❓ | 🤔 |
150
+ | 平台 | 是否经过测试 | 是否能够正常工作 | 测试环境 |
151
+ | :---------: | :----------: | :--------------: | :---------------: |
152
+ | Onebot | ✅ | ✅ | NapCat + Window11 |
153
+ | 飞书 | ❌ | ❓ | 🤔 |
154
+ | Red | ❌ | ❓ | 🤔 |
155
+ | DoDo | ❌ | ❓ | 🤔 |
156
+ | Mirai | ❌ | ❓ | 🤔 |
157
+ | 开黑啦 | ❌ | ❓ | 🤔 |
158
+ | Kritor | ❌ | ❓ | 🤔 |
159
+ | Ntchat | ❌ | ❓ | 🤔 |
160
+ | Satori | ❌ | ❓ | 🤔 |
161
+ | Telegram | ❌ | ❓ | 🤔 |
162
+ | Discord | ❌ | ❓ | 🤔 |
163
+ | Tailchat | ❌ | ❓ | 🤔 |
164
+ | QQ 官方接口 | ❌ | ❓ | 🤔 |
165
+ | Rocket.Chat | ❌ | ❓ | 🤔 |
157
166
 
158
167
  - 如果你测试过能够使用,请在 Issue 中指出
159
168
 
160
- ## 📦另外
169
+ ## 📦 另外
161
170
 
162
- ### 😳加入作者的 BUG 反馈群 ~~(🥵女装粉丝群)~~
171
+ ### 😳 加入作者的 BUG 反馈群 ~~(🥵 女装粉丝群)~~
163
172
 
164
173
  [群连接](https://qm.qq.com/q/Yty2yc9Bee)
165
174
 
@@ -172,10 +181,9 @@ __!!注意!!__
172
181
 
173
182
  ![9c149e99ca747c13892be3f9fbeedf31](https://github.com/user-attachments/assets/d02d108c-1ab3-4ad1-9123-c1a98862e627)
174
183
 
184
+ ### 💕 感谢
175
185
 
176
- ### 💕感谢
177
-
178
- 本插件的__init__.py 中的处理函数参考了词云中的方法 ~~(其实大部分都是 Ctrl+C Ctr+V)~~
186
+ 本插件的**init**.py 中的处理函数参考了词云中的方法 ~~(其实大部分都是 Ctrl+C Ctr+V)~~
179
187
 
180
188
  [nonebot-plugin-wordcloud](https://github.com/he0119/nonebot-plugin-wordcloud)
181
189
 
@@ -192,7 +200,6 @@ __!!注意!!__
192
200
  - [x] 更好看的图片渲染
193
201
 
194
202
  - [x] 添加一些全新的可配置项
195
-
196
203
  - [x] 尝试利用 jinja2 模板引擎制作可视化图片
197
204
 
198
205
  - [x] 私聊的查询(超级用户可以任意查询群聊的信息)一半完成
@@ -202,9 +209,9 @@ __!!注意!!__
202
209
  - [x] 查询带某关键词的消息量
203
210
 
204
211
  - [x] 合并转发
205
-
206
- 待补充。.....
207
212
 
213
+ 待补充。.....
214
+
215
+ ### 👾 题外话
208
216
 
209
- ### 👾题外话
210
217
  ~~整个项目快被我写成屎山了~~
@@ -16,7 +16,6 @@ from typing import Optional, Union
16
16
  import nonebot_plugin_saa as saa
17
17
  from arclet.alconna import ArparmaBehavior
18
18
  from arclet.alconna.arparma import Arparma
19
- from nonebot import on_command
20
19
  from nonebot.adapters import Bot, Event
21
20
  from nonebot.log import logger
22
21
  from nonebot.params import Arg, Depends
@@ -31,11 +30,11 @@ from nonebot_plugin_alconna import (
31
30
  Option,
32
31
  on_alconna,
33
32
  )
34
- from nonebot_plugin_chatrecorder import get_message_records
35
33
  from nonebot_plugin_uninfo import Session, Uninfo, get_session
36
34
 
37
35
  from .config import Config, plugin_config
38
- from .storage import build_cache, get_cache
36
+
37
+ # from .storage import build_cache, get_cache
39
38
  from .time import (
40
39
  get_datetime_fromisoformat_with_timezone,
41
40
  get_datetime_now_with_timezone,
@@ -46,8 +45,8 @@ from .utils import (
46
45
  get_rank_image,
47
46
  get_user_infos,
48
47
  got_rank,
49
- msg_counter,
50
48
  persist_id2user_id,
49
+ get_user_message_counts,
51
50
  )
52
51
 
53
52
  __plugin_meta__ = PluginMetadata(
@@ -80,16 +79,6 @@ def wrapper(slot: Union[int, str], content: Optional[str], context) -> str:
80
79
  return '' # pragma: no cover
81
80
 
82
81
 
83
- build_cache_cmd = on_command('build_cache', aliases={'重建缓存'}, block=True)
84
-
85
-
86
- @build_cache_cmd.handle()
87
- async def _build_cache(bot: Bot, event: Event):
88
- await saa.Text('正在重建缓存,请稍等。').send(reply=True)
89
- await build_cache()
90
- await saa.Text('重建缓存完成。').send(reply=True)
91
-
92
-
93
82
  b_cmd = on_alconna(
94
83
  Alconna(
95
84
  '看看B话',
@@ -121,18 +110,16 @@ async def handle_b_cmd(
121
110
  if not gid:
122
111
  await b_cmd.finish('请指定群号。')
123
112
 
124
- if keyword.available:
125
- keywords = keyword.result
126
- else:
127
- keywords = None
113
+ _keyword = keyword.result
128
114
 
129
- messages = await get_message_records(
115
+ d = await get_user_message_counts(
116
+ keyword=_keyword,
130
117
  scene_ids=[gid],
131
118
  user_ids=[id],
132
119
  types=['message'], # 排除机器人自己发的消息
133
120
  exclude_user_ids=plugin_config.excluded_people,
134
121
  )
135
- d = msg_counter(messages, keywords)
122
+
136
123
  rank = got_rank(d)
137
124
  if not rank:
138
125
  await b_cmd.finish(
@@ -301,23 +288,16 @@ async def handle_rank(
301
288
 
302
289
  keyword = state['keyword']
303
290
 
304
- if plugin_config.counting_cache:
305
- if keyword:
306
- await saa.Text('已开启缓存~缓存不支持关键词查询哦').finish()
307
- t1 = t.time()
308
- raw_rank = await get_cache(start, stop, id)
309
- logger.debug(f'获取计数消息花费时间:{t.time() - t1}')
310
- else:
311
- t1 = t.time()
312
- messages = await get_message_records(
313
- scene_ids=[id],
314
- types=['message'], # 排除机器人自己发的消息
315
- time_start=start,
316
- time_stop=stop,
317
- exclude_user_ids=plugin_config.excluded_people,
318
- )
319
- raw_rank = msg_counter(messages, keyword)
320
- logger.debug(f'获取计数消息花费时间:{t.time() - t1}')
291
+ t1 = t.time()
292
+ raw_rank = await get_user_message_counts(
293
+ keyword=keyword,
294
+ scene_ids=[id],
295
+ types=['message'], # 排除机器人自己发的消息
296
+ time_start=start,
297
+ time_stop=stop,
298
+ exclude_user_ids=plugin_config.excluded_people,
299
+ )
300
+ logger.debug(f'获取计数消息花费时间:{t.time() - t1}')
321
301
 
322
302
  if not raw_rank:
323
303
  await saa.Text(