nonebot-plugin-werewolf 1.0.3__tar.gz → 1.0.4__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.1
2
2
  Name: nonebot-plugin-werewolf
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: Default template for PDM package
5
5
  Author-Email: wyf7685 <wyf7685@163.com>
6
6
  License: MIT
@@ -171,7 +171,7 @@ werewolf__override_preset='
171
171
  <details>
172
172
  <summary>更新日志</summary>
173
173
 
174
- - 2024.09.01 v1.0.3
174
+ - 2024.09.01 v1.0.4
175
175
 
176
176
  - 优化玩家交互体验
177
177
 
@@ -158,7 +158,7 @@ werewolf__override_preset='
158
158
  <details>
159
159
  <summary>更新日志</summary>
160
160
 
161
- - 2024.09.01 v1.0.3
161
+ - 2024.09.01 v1.0.4
162
162
 
163
163
  - 优化玩家交互体验
164
164
 
@@ -8,7 +8,7 @@ require("nonebot_plugin_waiter")
8
8
  from . import matchers as matchers
9
9
  from .config import Config
10
10
 
11
- __version__ = "1.0.3"
11
+ __version__ = "1.0.4"
12
12
  __plugin_meta__ = PluginMetadata(
13
13
  name="狼人杀",
14
14
  description="适用于 Nonebot2 的狼人杀插件",
@@ -9,7 +9,7 @@ from nonebot.rule import to_me
9
9
  from nonebot_plugin_alconna import MsgTarget, UniMessage, UniMsg
10
10
  from nonebot_plugin_userinfo import EventUserInfo, UserInfo
11
11
 
12
- from .game import player_preset, running_games
12
+ from .game import player_preset
13
13
 
14
14
 
15
15
  def check_index(text: str, arrlen: int) -> int | None:
@@ -42,6 +42,8 @@ class InputStore:
42
42
 
43
43
 
44
44
  def user_in_game(user_id: str, group_id: str | None) -> bool:
45
+ from .game import running_games
46
+
45
47
  if group_id is not None and group_id not in running_games:
46
48
  return False
47
49
  games = running_games.values() if group_id is None else [running_games[group_id]]
@@ -51,6 +53,8 @@ def user_in_game(user_id: str, group_id: str | None) -> bool:
51
53
 
52
54
 
53
55
  async def rule_in_game(event: Event, target: MsgTarget) -> bool:
56
+ from .game import running_games
57
+
54
58
  if not running_games:
55
59
  return False
56
60
  if target.private:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nonebot-plugin-werewolf"
3
- version = "1.0.3"
3
+ version = "1.0.4"
4
4
  description = "Default template for PDM package"
5
5
  authors = [
6
6
  { name = "wyf7685", email = "wyf7685@163.com" },