去掉无用的提示,新群默认有权限

This commit is contained in:
CMHopeSunshine 2022-08-24 23:41:33 +08:00
parent 08ab50d152
commit 206b86ea90
2 changed files with 3 additions and 3 deletions

View File

@ -106,7 +106,7 @@ async def _(event: MessageEvent, matcher: Matcher):
perm = await PluginPermission.get_or_none(name=matcher.plugin_name, session_id=session_id, session_type=session_type) perm = await PluginPermission.get_or_none(name=matcher.plugin_name, session_id=session_id, session_type=session_type)
if not perm: if not perm:
raise IgnoredException('插件使用权限未设置') return
if not perm.status: if not perm.status:
raise IgnoredException('插件使用权限已禁用') raise IgnoredException('插件使用权限已禁用')
if isinstance(event, GroupMessageEvent) and event.user_id in perm.ban: if isinstance(event, GroupMessageEvent) and event.user_id in perm.ban:

View File

@ -40,8 +40,8 @@ class PluginManager:
""" """
if self.config_path.exists(): if self.config_path.exists():
self.config = load_yaml(self.config_path) self.config = load_yaml(self.config_path)
else: # else:
logger.warning('插件管理器', '无法读取LittlePaimon配置文件请检查目录') # logger.warning('插件管理器', '无法读取LittlePaimon配置文件请检查目录')
for file in self.plugin_config_path.iterdir(): for file in self.plugin_config_path.iterdir():
if file.is_file() and file.name.endswith('.yml'): if file.is_file() and file.name.endswith('.yml'):
data = load_yaml(file) data = load_yaml(file)