调整变量
This commit is contained in:
@@ -13,6 +13,10 @@ from wechat_ipad import WechatAPIClient
|
|||||||
class PluginManagerPlugin(MessagePluginInterface):
|
class PluginManagerPlugin(MessagePluginInterface):
|
||||||
"""插件管理插件"""
|
"""插件管理插件"""
|
||||||
|
|
||||||
|
# 功能权限常量
|
||||||
|
FEATURE_KEY = "PLUGIN_MANAGER"
|
||||||
|
FEATURE_DESCRIPTION = "🔧 插件管理功能 [插件管理]"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self) -> str:
|
def name(self) -> str:
|
||||||
return "插件管理"
|
return "插件管理"
|
||||||
@@ -39,11 +43,11 @@ class PluginManagerPlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def feature_key(self) -> Optional[str]:
|
def feature_key(self) -> Optional[str]:
|
||||||
return "PLUGIN_MANAGER"
|
return self.FEATURE_KEY
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def feature_description(self) -> Optional[str]:
|
def feature_description(self) -> Optional[str]:
|
||||||
return "🔧 插件管理功能 [插件管理]"
|
return self.FEATURE_DESCRIPTION
|
||||||
|
|
||||||
def start(self) -> bool:
|
def start(self) -> bool:
|
||||||
"""启动插件"""
|
"""启动插件"""
|
||||||
@@ -288,7 +292,9 @@ class PluginManagerPlugin(MessagePluginInterface):
|
|||||||
existing_module_name = existing_plugin.__class__.__module__.split('.')[-2]
|
existing_module_name = existing_plugin.__class__.__module__.split('.')[-2]
|
||||||
if existing_module_name == plugin_name:
|
if existing_module_name == plugin_name:
|
||||||
if not silent:
|
if not silent:
|
||||||
await self.bot.send_at_message(target, f"⚠️插件 {existing_plugin.name} (模块名: {plugin_name}) 已经加载", [sender])
|
await self.bot.send_at_message(target,
|
||||||
|
f"⚠️插件 {existing_plugin.name} (模块名: {plugin_name}) 已经加载",
|
||||||
|
[sender])
|
||||||
return True, f"插件 {existing_plugin.name} 已经加载"
|
return True, f"插件 {existing_plugin.name} 已经加载"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user