mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-05 11:49:59 +08:00
适配metadata
This commit is contained in:
@@ -37,7 +37,6 @@ class Plugins2settingsManager(StaticData):
|
||||
limit_superuser: Optional[bool] = False,
|
||||
plugin_type: Tuple[Union[str, int]] = ("normal",),
|
||||
cost_gold: int = 0,
|
||||
**kwargs
|
||||
):
|
||||
"""
|
||||
添加一个插件设置
|
||||
|
||||
+9
-2
@@ -181,13 +181,20 @@ def get_bot() -> Optional[Bot]:
|
||||
return None
|
||||
|
||||
|
||||
def get_matchers() -> List[Type[Matcher]]:
|
||||
def get_matchers(distinct: bool = False) -> List[Type[Matcher]]:
|
||||
"""
|
||||
获取所有插件
|
||||
说明:
|
||||
获取所有matcher
|
||||
参数:
|
||||
distinct: 去重
|
||||
"""
|
||||
_matchers = []
|
||||
temp = []
|
||||
for i in matchers.keys():
|
||||
for matcher in matchers[i]:
|
||||
if distinct and matcher.plugin_name in temp:
|
||||
continue
|
||||
temp.append(matcher.plugin_name)
|
||||
_matchers.append(matcher)
|
||||
return _matchers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user