Skip to content

Commit bcb33eb

Browse files
committed
🐛 version 0.12.1
fix command.assign
1 parent 7b18d19 commit bcb33eb

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

arclet/entari/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@
6767
WS = WebsocketsInfo
6868
WH = WebhookInfo
6969

70-
__version__ = "0.12.0"
70+
__version__ = "0.12.1"

arclet/entari/command/plugin.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@ def assign(
4949
providers: list[Provider | type[Provider] | ProviderFactory | type[ProviderFactory]] | None = None,
5050
):
5151
assign = Assign(path, value, or_not)
52-
try:
53-
self.propagators.append(assign)
54-
return self.register(priority=priority, providers=providers)
55-
finally:
56-
self.propagators.remove(assign)
52+
wrapper = self.register(priority=priority, providers=providers)
53+
54+
def decorator(func):
55+
sub = wrapper(func)
56+
sub.propagate(assign)
57+
return sub
58+
59+
return decorator
5760

5861
def on_execute(
5962
self,

arclet/entari/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
class BasicConfig(TypedDict, total=False):
2121
network: list[dict[str, Any]]
2222
ignore_self_message: bool
23+
skip_req_missing: bool
2324
log_level: int | str
2425
prefix: list[str]
2526
cmd_count: int

arclet/entari/core.py

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def from_config(cls, config: EntariConfig | None = None):
107107
config = EntariConfig.instance
108108
ignore_self_message = config.basic.get("ignore_self_message", True)
109109
log_level = config.basic.get("log_level", "INFO")
110+
skip_req_missing = config.basic.get("skip_req_missing", False)
110111
configs = []
111112
for conf in config.basic.get("network", []):
112113
if conf["type"] in ("websocket", "websockets", "ws"):
@@ -117,16 +118,19 @@ def from_config(cls, config: EntariConfig | None = None):
117118
*configs,
118119
log_level=log_level,
119120
ignore_self_message=ignore_self_message,
121+
skip_req_missing=skip_req_missing,
120122
)
121123

122124
def __init__(
123125
self,
124126
*configs: Config,
125127
log_level: str | int = "INFO",
126128
ignore_self_message: bool = True,
129+
skip_req_missing: bool = False,
127130
):
128131
from . import __version__
129132

133+
es.global_skip_req_missing = skip_req_missing
130134
log.core.info(f"Entari <b><c>version {__version__}</c></b>")
131135
super().__init__(*configs, default_api_cls=EntariProtocol)
132136
if not hasattr(EntariConfig, "instance"):

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "arclet-entari"
3-
version = "0.12.0"
3+
version = "0.12.1"
44
description = "Simple IM Framework based on satori-python"
55
authors = [
66
{name = "RF-Tar-Railt",email = "[email protected]"},

0 commit comments

Comments
 (0)