nonebot-plugin-cs2match 1.0.1__tar.gz → 1.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nonebot-plugin-cs2match
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: 实时追踪 Counter-Strike 2 职业赛事,开赛自动提醒、关键赛况与大比分异动推送。
5
5
  Keywords: nonebot,bot,counter-strike,cs2
6
6
  Author: StarsetNight
@@ -12,11 +12,9 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Requires-Dist: aiohttp>=3.13.5
14
14
  Requires-Dist: ayafileio>=1.4.6
15
- Requires-Dist: nonebot-adapter-onebot>=2.4.6
15
+ Requires-Dist: nonebot-adapter-onebot>=2.4.0
16
16
  Requires-Dist: nonebot-plugin-localstore>=0.7.4
17
- Requires-Dist: nonebot2>=2.4.4
18
- Requires-Dist: pydantic>=2.13.4
19
- Requires-Dist: python-dotenv>=1.2.1
17
+ Requires-Dist: nonebot2>=2.2.0
20
18
  Requires-Dist: typst>=0.15.0
21
19
  Requires-Python: >=3.10, <4.0
22
20
  Project-URL: Homepage, https://github.com/StarsetNight/nonebot-plugin-cs2match
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nonebot-plugin-cs2match"
3
- version = "1.0.1"
3
+ version = "1.0.2"
4
4
  description = "实时追踪 Counter-Strike 2 职业赛事,开赛自动提醒、关键赛况与大比分异动推送。"
5
5
  license = "MIT"
6
6
  readme = "README.md"
@@ -18,11 +18,9 @@ requires-python = ">=3.10,<4.0"
18
18
  dependencies = [
19
19
  "aiohttp>=3.13.5",
20
20
  "ayafileio>=1.4.6",
21
- "nonebot-adapter-onebot>=2.4.6",
21
+ "nonebot-adapter-onebot>=2.4.0",
22
22
  "nonebot-plugin-localstore>=0.7.4",
23
- "nonebot2>=2.4.4",
24
- "pydantic>=2.13.4",
25
- "python-dotenv>=1.2.1",
23
+ "nonebot2>=2.2.0",
26
24
  "typst>=0.15.0",
27
25
  ]
28
26
 
@@ -10,6 +10,10 @@ from nonebot.permission import SUPERUSER
10
10
  from nonebot.plugin import PluginMetadata
11
11
 
12
12
  from .config import Config
13
+ # init的配置读取必须先于其他要使用init中配置的导入模块,否则会缺配置读不了
14
+ driver = get_driver()
15
+ global_config = driver.config
16
+ config = get_plugin_config(Config) # 取自config.py中的静态配置
13
17
  from .tools import PandaScoreClient, MonitorClient, MatchParser, typst_render
14
18
  from .template import help_plain_text, help_text
15
19
  from .rule import is_enabled
@@ -18,10 +22,6 @@ from .dynamic_config import DynamicConfigSystem, PriorityMode
18
22
  require("nonebot_plugin_localstore")
19
23
  from nonebot_plugin_localstore import get_plugin_data_file
20
24
 
21
- driver = get_driver()
22
- global_config = driver.config
23
- config = get_plugin_config(Config) # 取自config.py中的静态配置
24
-
25
25
  panda_client: PandaScoreClient | None = None
26
26
  dynamic_config: DynamicConfigSystem | None = None # 取自插件内编写的DynamicConfigSystem
27
27
  monitor_client: MonitorClient | None = None
@@ -3,9 +3,7 @@
3
3
 
4
4
  import nonebot
5
5
 
6
- from .config import Config
7
-
8
- config = nonebot.get_plugin_config(Config)
6
+ from . import config
9
7
 
10
8
 
11
9
  async def is_enabled():
@@ -17,17 +17,12 @@ from ayafileio import open
17
17
  import typst
18
18
 
19
19
  from nonebot.adapters.onebot.v11 import Message, MessageSegment, Bot
20
- from nonebot import require, get_driver, get_plugin_config, logger
20
+ from nonebot import require, logger
21
21
 
22
22
  require("nonebot_plugin_localstore")
23
23
  from nonebot_plugin_localstore import get_plugin_cache_dir
24
24
 
25
- from . import template
26
- from .config import Config
27
-
28
- driver = get_driver()
29
- global_config = driver.config
30
- config = get_plugin_config(Config)
25
+ from . import template, config
31
26
 
32
27
  RENDER_CACHE_DIR = get_plugin_cache_dir() / "render_cache"
33
28
  RENDER_CACHE_DIR.mkdir(exist_ok=True)
@@ -287,7 +282,7 @@ class MatchParser:
287
282
  reverse=True
288
283
  ))
289
284
 
290
- content = typst_template.list_match
285
+ content = template.list_match
291
286
 
292
287
  for serie_name, serie_matches in sorted_series.items():
293
288
  content += f'#series_card("{serie_name}", [\n'