nonebot-plugin-dialectlist 2.2.0__tar.gz → 2.2.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 (21) hide show
  1. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/PKG-INFO +19 -19
  2. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/README.md +18 -18
  3. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/__init__.py +16 -5
  4. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/config.py +2 -1
  5. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist.egg-info/PKG-INFO +19 -19
  6. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/pyproject.toml +1 -1
  7. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/MANIFEST.in +0 -0
  8. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/model.py +0 -0
  9. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/storage.py +0 -0
  10. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/template/avatar/default.jpg +0 -0
  11. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/template/avatar/master.jpg +0 -0
  12. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/template/css/style.css +0 -0
  13. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/template/rank_template.j2 +0 -0
  14. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/time.py +0 -0
  15. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/usage.py +0 -0
  16. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist/utils.py +0 -0
  17. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist.egg-info/SOURCES.txt +0 -0
  18. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist.egg-info/dependency_links.txt +0 -0
  19. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist.egg-info/requires.txt +0 -0
  20. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/nonebot_plugin_dialectlist.egg-info/top_level.txt +0 -0
  21. {nonebot_plugin_dialectlist-2.2.0 → nonebot_plugin_dialectlist-2.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-dialectlist
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: 看看你群群友有多能说
5
5
  Author-email: Chen_Xu233 <woyerpa@outlook.com>
6
6
  License: MIT
@@ -76,13 +76,14 @@ nonebot-plugin-dialectlist
76
76
  在 .env 中,可以添加以下配置项
77
77
  ```python
78
78
  dialectlist__string_format = '第{index}名:\n{nickname},{chatdatanum}条消息、n' #消息格式
79
- dialectlist__string_suffix_format = '你们的职业是水群吗?————MYX\n 计算花费时间:{timecost}秒' #消息后缀格式
80
79
  dialectlist__get_num = 10 #获取人数数量
81
80
  dialectlist__visualization = True #是否可视化
82
- dialectlist__visualization_type = '圆环图' #可视化方案
81
+ # dialectlist__visualization_type = '圆环图' #可视化方案 (不再支持)
83
82
  dialectlist__font = 'SimHei' #字体格式
84
83
  dialectlist__excluded_people = [] #排除的人的 QQ 号(或频道号?(未经测试))
85
84
  dialectlist__excluded_self = True #是否排除机器人自己 QQ
85
+ dialectlist__suffix: bool = False # 是否显示后缀
86
+ dialectlist__string_suffix: str = "统计花费时间{timecost}" # 消息格式后缀
86
87
  ```
87
88
  💭也可以不进行配置,这将会使插件按照默认配置运行
88
89
 
@@ -93,34 +94,33 @@ dialectlist__excluded_self = True #是否排除机器人自己 QQ
93
94
  ## 🗨命令
94
95
  __!!注意!!__
95
96
  新版本指令调用方式改变,改为更易理解也更好打的 B 话榜。
96
- 同时也可以用类似 `/今日废话榜` 的方式(只要改前面的就好了)(算是给[盘古之白](https://github.com/vinta/pangu.js)风格爱好者的福利吧?)
97
+ 同时也可以用类似 `/今日废话榜` 的方式(只要改前面的就好了)(算是给 [盘古之白](https://github.com/vinta/pangu.js) 风格爱好者的福利吧?)
97
98
 
98
99
  ### 🎨一般用法
99
100
 
100
- -`/B话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
101
+ -`/B 话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
101
102
 
102
- -`/今日B话榜` ————看看今天的群友发了多少消息!
103
+ -`/今日 B 话榜` ————看看今天的群友发了多少消息!
103
104
 
104
- -`/昨日B话榜` ————看看昨天的群友发了多少消息!
105
+ -`/昨日 B 话榜` ————看看昨天的群友发了多少消息!
105
106
 
106
- -`/前日B话榜` ————看看前天的群友发了多少消息!
107
+ -`/前日 B 话榜` ————看看前天的群友发了多少消息!
107
108
 
108
- -`/本周B话榜` ————看看本周的群友发了多少消息!
109
+ -`/本周 B 话榜` ————看看本周的群友发了多少消息!
109
110
 
110
- -`/上周B话榜` ————看看上周的群友发了多少消息!
111
+ -`/上周 B 话榜` ————看看上周的群友发了多少消息!
111
112
 
112
- -`/本月B话榜` ————看看这个月的群友发了多少消息!
113
+ -`/本月 B 话榜` ————看看这个月的群友发了多少消息!
113
114
 
114
- -`/年度B话榜` ————看看今年的群友发了多少消息!
115
+ -`/年度 B 话榜` ————看看今年的群友发了多少消息!
115
116
 
116
- -`/历史B话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
117
+ -`/历史 B 话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
117
118
 
118
119
  ### 🚀进阶用法
119
120
 
120
- `/{时间类型(今日|年度)?}{B话榜|废话榜} {时间类型?} {ISO8601格式时间} {群号}`
121
-
122
- 如:`/B话榜 历史 2024-01-01~2024-01-02 12345678`
121
+ `/{时间类型(今日|年度)?}{B 话榜|废话榜} {时间类型?} {ISO8601 格式时间} {群号}`
123
122
 
123
+ 如:`/B 话榜 历史 2024-01-01~2024-01-02 12345678`
124
124
 
125
125
  ## 📖版本
126
126
 
@@ -196,14 +196,14 @@ __!!注意!!__
196
196
 
197
197
  - [ ] 更好看的图片渲染
198
198
 
199
- - [ ] 提供多样化的渲染器配置(html渲染,pillow渲染,统计绘图软件渲染)
200
- - [ ] 为pillow渲染方式提供插件的加载方式(什么?插件里的插件???)
199
+ - [ ] 提供多样化的渲染器配置(html 渲染,pillow 渲染,统计绘图软件渲染)
200
+ - [ ] 为 pillow 渲染方式提供插件的加载方式(什么?插件里的插件???)
201
201
 
202
202
  - [ ] 私聊的查询(超级用户可以任意查询群聊的信息)一半完成
203
203
 
204
204
  - [ ] 查询带某关键词的消息量
205
205
 
206
- - [ ] 使用管理员权限直接获取QQ官方统计的今日消息量以优化代码运行速度
206
+ - [ ] 使用管理员权限直接获取 QQ 官方统计的今日消息量以优化代码运行速度
207
207
 
208
208
  - [ ] 特殊的储存方案优化消息统计
209
209
 
@@ -51,13 +51,14 @@ nonebot-plugin-dialectlist
51
51
  在 .env 中,可以添加以下配置项
52
52
  ```python
53
53
  dialectlist__string_format = '第{index}名:\n{nickname},{chatdatanum}条消息、n' #消息格式
54
- dialectlist__string_suffix_format = '你们的职业是水群吗?————MYX\n 计算花费时间:{timecost}秒' #消息后缀格式
55
54
  dialectlist__get_num = 10 #获取人数数量
56
55
  dialectlist__visualization = True #是否可视化
57
- dialectlist__visualization_type = '圆环图' #可视化方案
56
+ # dialectlist__visualization_type = '圆环图' #可视化方案 (不再支持)
58
57
  dialectlist__font = 'SimHei' #字体格式
59
58
  dialectlist__excluded_people = [] #排除的人的 QQ 号(或频道号?(未经测试))
60
59
  dialectlist__excluded_self = True #是否排除机器人自己 QQ
60
+ dialectlist__suffix: bool = False # 是否显示后缀
61
+ dialectlist__string_suffix: str = "统计花费时间{timecost}" # 消息格式后缀
61
62
  ```
62
63
  💭也可以不进行配置,这将会使插件按照默认配置运行
63
64
 
@@ -68,34 +69,33 @@ dialectlist__excluded_self = True #是否排除机器人自己 QQ
68
69
  ## 🗨命令
69
70
  __!!注意!!__
70
71
  新版本指令调用方式改变,改为更易理解也更好打的 B 话榜。
71
- 同时也可以用类似 `/今日废话榜` 的方式(只要改前面的就好了)(算是给[盘古之白](https://github.com/vinta/pangu.js)风格爱好者的福利吧?)
72
+ 同时也可以用类似 `/今日废话榜` 的方式(只要改前面的就好了)(算是给 [盘古之白](https://github.com/vinta/pangu.js) 风格爱好者的福利吧?)
72
73
 
73
74
  ### 🎨一般用法
74
75
 
75
- -`/B话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
76
+ -`/B 话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
76
77
 
77
- -`/今日B话榜` ————看看今天的群友发了多少消息!
78
+ -`/今日 B 话榜` ————看看今天的群友发了多少消息!
78
79
 
79
- -`/昨日B话榜` ————看看昨天的群友发了多少消息!
80
+ -`/昨日 B 话榜` ————看看昨天的群友发了多少消息!
80
81
 
81
- -`/前日B话榜` ————看看前天的群友发了多少消息!
82
+ -`/前日 B 话榜` ————看看前天的群友发了多少消息!
82
83
 
83
- -`/本周B话榜` ————看看本周的群友发了多少消息!
84
+ -`/本周 B 话榜` ————看看本周的群友发了多少消息!
84
85
 
85
- -`/上周B话榜` ————看看上周的群友发了多少消息!
86
+ -`/上周 B 话榜` ————看看上周的群友发了多少消息!
86
87
 
87
- -`/本月B话榜` ————看看这个月的群友发了多少消息!
88
+ -`/本月 B 话榜` ————看看这个月的群友发了多少消息!
88
89
 
89
- -`/年度B话榜` ————看看今年的群友发了多少消息!
90
+ -`/年度 B 话榜` ————看看今年的群友发了多少消息!
90
91
 
91
- -`/历史B话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
92
+ -`/历史 B 话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
92
93
 
93
94
  ### 🚀进阶用法
94
95
 
95
- `/{时间类型(今日|年度)?}{B话榜|废话榜} {时间类型?} {ISO8601格式时间} {群号}`
96
-
97
- 如:`/B话榜 历史 2024-01-01~2024-01-02 12345678`
96
+ `/{时间类型(今日|年度)?}{B 话榜|废话榜} {时间类型?} {ISO8601 格式时间} {群号}`
98
97
 
98
+ 如:`/B 话榜 历史 2024-01-01~2024-01-02 12345678`
99
99
 
100
100
  ## 📖版本
101
101
 
@@ -171,14 +171,14 @@ __!!注意!!__
171
171
 
172
172
  - [ ] 更好看的图片渲染
173
173
 
174
- - [ ] 提供多样化的渲染器配置(html渲染,pillow渲染,统计绘图软件渲染)
175
- - [ ] 为pillow渲染方式提供插件的加载方式(什么?插件里的插件???)
174
+ - [ ] 提供多样化的渲染器配置(html 渲染,pillow 渲染,统计绘图软件渲染)
175
+ - [ ] 为 pillow 渲染方式提供插件的加载方式(什么?插件里的插件???)
176
176
 
177
177
  - [ ] 私聊的查询(超级用户可以任意查询群聊的信息)一半完成
178
178
 
179
179
  - [ ] 查询带某关键词的消息量
180
180
 
181
- - [ ] 使用管理员权限直接获取QQ官方统计的今日消息量以优化代码运行速度
181
+ - [ ] 使用管理员权限直接获取 QQ 官方统计的今日消息量以优化代码运行速度
182
182
 
183
183
  - [ ] 特殊的储存方案优化消息统计
184
184
 
@@ -10,6 +10,7 @@ require("nonebot_plugin_cesaa")
10
10
  import re
11
11
  import os
12
12
  import cn2an
13
+ import time as t
13
14
  import nonebot_plugin_saa as saa
14
15
 
15
16
  from typing import Union, Optional, List
@@ -137,7 +138,8 @@ async def _group_message(
137
138
  time: Optional[str] = None,
138
139
  group_id: Optional[str] = None,
139
140
  ):
140
-
141
+ t1 = t.time()
142
+ state["t1"] = t1
141
143
  dt = get_datetime_now_with_timezone()
142
144
 
143
145
  if not group_id:
@@ -298,7 +300,16 @@ async def handle_rank(
298
300
  chatdatanum=rank2[i].user_bnum,
299
301
  )
300
302
  string += str_example
301
-
302
- image = await get_rank_image(rank2)
303
-
304
- await (saa.Text(string) + saa.Image(image)).finish(reply=True)
303
+
304
+ msg = saa.Text(string)
305
+
306
+ if plugin_config.visualization:
307
+ image = await get_rank_image(rank2)
308
+ msg += saa.Image(image)
309
+
310
+ if plugin_config.suffix:
311
+ timecost = t.time() - state["t1"]
312
+ suffix = saa.Text(plugin_config.string_suffix.format(timecost=timecost))
313
+ msg += suffix
314
+
315
+ await msg.finish(reply=True)
@@ -12,7 +12,8 @@ class ScopedConfig(BaseModel):
12
12
  template_path: str = "./template/rank_template.j2" # 模板路径
13
13
  visualization: bool = True # 是否可视化
14
14
  excluded_people: List[str] = [] # 排除的人的QQ号
15
- visualization_type: Literal["饼图", "圆环图", "柱状图"] = "圆环图" # 可视化方案
15
+ suffix: bool = False # 是否显示后缀
16
+ string_suffix: str = "统计花费时间:{timecost}秒" # 消息格式后缀
16
17
 
17
18
 
18
19
  class Config(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-dialectlist
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: 看看你群群友有多能说
5
5
  Author-email: Chen_Xu233 <woyerpa@outlook.com>
6
6
  License: MIT
@@ -76,13 +76,14 @@ nonebot-plugin-dialectlist
76
76
  在 .env 中,可以添加以下配置项
77
77
  ```python
78
78
  dialectlist__string_format = '第{index}名:\n{nickname},{chatdatanum}条消息、n' #消息格式
79
- dialectlist__string_suffix_format = '你们的职业是水群吗?————MYX\n 计算花费时间:{timecost}秒' #消息后缀格式
80
79
  dialectlist__get_num = 10 #获取人数数量
81
80
  dialectlist__visualization = True #是否可视化
82
- dialectlist__visualization_type = '圆环图' #可视化方案
81
+ # dialectlist__visualization_type = '圆环图' #可视化方案 (不再支持)
83
82
  dialectlist__font = 'SimHei' #字体格式
84
83
  dialectlist__excluded_people = [] #排除的人的 QQ 号(或频道号?(未经测试))
85
84
  dialectlist__excluded_self = True #是否排除机器人自己 QQ
85
+ dialectlist__suffix: bool = False # 是否显示后缀
86
+ dialectlist__string_suffix: str = "统计花费时间{timecost}" # 消息格式后缀
86
87
  ```
87
88
  💭也可以不进行配置,这将会使插件按照默认配置运行
88
89
 
@@ -93,34 +94,33 @@ dialectlist__excluded_self = True #是否排除机器人自己 QQ
93
94
  ## 🗨命令
94
95
  __!!注意!!__
95
96
  新版本指令调用方式改变,改为更易理解也更好打的 B 话榜。
96
- 同时也可以用类似 `/今日废话榜` 的方式(只要改前面的就好了)(算是给[盘古之白](https://github.com/vinta/pangu.js)风格爱好者的福利吧?)
97
+ 同时也可以用类似 `/今日废话榜` 的方式(只要改前面的就好了)(算是给 [盘古之白](https://github.com/vinta/pangu.js) 风格爱好者的福利吧?)
97
98
 
98
99
  ### 🎨一般用法
99
100
 
100
- -`/B话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
101
+ -`/B 话榜` ————看看有史以来(机器人存在以来)群友们发了多少消息! (好像没写)
101
102
 
102
- -`/今日B话榜` ————看看今天的群友发了多少消息!
103
+ -`/今日 B 话榜` ————看看今天的群友发了多少消息!
103
104
 
104
- -`/昨日B话榜` ————看看昨天的群友发了多少消息!
105
+ -`/昨日 B 话榜` ————看看昨天的群友发了多少消息!
105
106
 
106
- -`/前日B话榜` ————看看前天的群友发了多少消息!
107
+ -`/前日 B 话榜` ————看看前天的群友发了多少消息!
107
108
 
108
- -`/本周B话榜` ————看看本周的群友发了多少消息!
109
+ -`/本周 B 话榜` ————看看本周的群友发了多少消息!
109
110
 
110
- -`/上周B话榜` ————看看上周的群友发了多少消息!
111
+ -`/上周 B 话榜` ————看看上周的群友发了多少消息!
111
112
 
112
- -`/本月B话榜` ————看看这个月的群友发了多少消息!
113
+ -`/本月 B 话榜` ————看看这个月的群友发了多少消息!
113
114
 
114
- -`/年度B话榜` ————看看今年的群友发了多少消息!
115
+ -`/年度 B 话榜` ————看看今年的群友发了多少消息!
115
116
 
116
- -`/历史B话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
117
+ -`/历史 B 话榜` ————看看历史上(机器人存在以来)的群友发了多少消息!
117
118
 
118
119
  ### 🚀进阶用法
119
120
 
120
- `/{时间类型(今日|年度)?}{B话榜|废话榜} {时间类型?} {ISO8601格式时间} {群号}`
121
-
122
- 如:`/B话榜 历史 2024-01-01~2024-01-02 12345678`
121
+ `/{时间类型(今日|年度)?}{B 话榜|废话榜} {时间类型?} {ISO8601 格式时间} {群号}`
123
122
 
123
+ 如:`/B 话榜 历史 2024-01-01~2024-01-02 12345678`
124
124
 
125
125
  ## 📖版本
126
126
 
@@ -196,14 +196,14 @@ __!!注意!!__
196
196
 
197
197
  - [ ] 更好看的图片渲染
198
198
 
199
- - [ ] 提供多样化的渲染器配置(html渲染,pillow渲染,统计绘图软件渲染)
200
- - [ ] 为pillow渲染方式提供插件的加载方式(什么?插件里的插件???)
199
+ - [ ] 提供多样化的渲染器配置(html 渲染,pillow 渲染,统计绘图软件渲染)
200
+ - [ ] 为 pillow 渲染方式提供插件的加载方式(什么?插件里的插件???)
201
201
 
202
202
  - [ ] 私聊的查询(超级用户可以任意查询群聊的信息)一半完成
203
203
 
204
204
  - [ ] 查询带某关键词的消息量
205
205
 
206
- - [ ] 使用管理员权限直接获取QQ官方统计的今日消息量以优化代码运行速度
206
+ - [ ] 使用管理员权限直接获取 QQ 官方统计的今日消息量以优化代码运行速度
207
207
 
208
208
  - [ ] 特殊的储存方案优化消息统计
209
209
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nonebot-plugin-dialectlist"
3
- version = "2.2.0"
3
+ version = "2.2.1"
4
4
  description = "看看你群群友有多能说"
5
5
  authors = [
6
6
  {name = "Chen_Xu233", email = "woyerpa@outlook.com"},