mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-07 21:00:21 +08:00
⚡️ 优化权限判断
This commit is contained in:
@@ -10,7 +10,7 @@ from zhenxun.services.log import logger
|
||||
from zhenxun.utils.message import MessageUtils
|
||||
|
||||
__plugin_meta__ = PluginMetadata(
|
||||
name="识番",
|
||||
name="关于",
|
||||
description="想要更加了解真寻吗",
|
||||
usage="""
|
||||
指令:
|
||||
|
||||
@@ -21,7 +21,8 @@ __plugin_meta__ = PluginMetadata(
|
||||
extra=PluginExtraData(
|
||||
author="HibiKier",
|
||||
version="0.1",
|
||||
plugin_type=PluginType.HIDDEN,
|
||||
menu_type="其他",
|
||||
plugin_type=PluginType.DEPENDANT,
|
||||
).dict(),
|
||||
)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
author="HibiKier",
|
||||
version="0.1",
|
||||
menu_type="其他",
|
||||
plugin_type=PluginType.HIDDEN,
|
||||
plugin_type=PluginType.DEPENDANT,
|
||||
tasks=[Task(module="fudu", name="复读")],
|
||||
configs=[
|
||||
RegisterConfig(
|
||||
|
||||
@@ -7,6 +7,7 @@ from nonebot_plugin_session import EventSession
|
||||
|
||||
from zhenxun.configs.config import NICKNAME
|
||||
from zhenxun.configs.utils import PluginExtraData
|
||||
from zhenxun.models.ban_console import BanConsole
|
||||
from zhenxun.services.log import logger
|
||||
from zhenxun.utils.enum import PluginType
|
||||
from zhenxun.utils.image_utils import get_download_image_hash
|
||||
@@ -23,7 +24,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
author="HibiKier",
|
||||
version="0.1",
|
||||
menu_type="其他",
|
||||
plugin_type=PluginType.HIDDEN,
|
||||
plugin_type=PluginType.DEPENDANT,
|
||||
).dict(),
|
||||
)
|
||||
|
||||
@@ -35,6 +36,8 @@ async def _(bot: Bot, session: EventSession, message: UniMsg):
|
||||
group_id = session.id2
|
||||
if not session.id1 or not group_id:
|
||||
return
|
||||
if await BanConsole.is_ban(session.id1, group_id):
|
||||
return
|
||||
plain_text = message.extract_plain_text()
|
||||
image_list = [m.url for m in message if isinstance(m, alcImage) and m.url]
|
||||
img_hash = ""
|
||||
|
||||
@@ -28,7 +28,8 @@ __plugin_meta__ = PluginMetadata(
|
||||
extra=PluginExtraData(
|
||||
author="leekooyo",
|
||||
version="0.1",
|
||||
plugin_type=PluginType.HIDDEN,
|
||||
plugin_type=PluginType.DEPENDANT,
|
||||
menu_type="其他",
|
||||
configs=[
|
||||
RegisterConfig(
|
||||
module="_task",
|
||||
|
||||
@@ -24,7 +24,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
author="HibiKier",
|
||||
version="0.1",
|
||||
menu_type="其他",
|
||||
plugin_type=PluginType.HIDDEN,
|
||||
plugin_type=PluginType.DEPENDANT,
|
||||
).dict(),
|
||||
)
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ async def _() -> Result:
|
||||
load_status=True,
|
||||
).count()
|
||||
plugin_count.other = await DbPluginInfo.filter(
|
||||
plugin_type=PluginType.HIDDEN, load_status=True
|
||||
plugin_type__in=[PluginType.HIDDEN, PluginType.DEPENDANT], load_status=True
|
||||
).count()
|
||||
return Result.ok(plugin_count)
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ class WordBankManage:
|
||||
problem, _problem_list = await WordBank.get_problem_all_answer(
|
||||
problem, # type: ignore
|
||||
index,
|
||||
group_id if group_id is None else None,
|
||||
group_id if group_id is not None else None,
|
||||
word_scope,
|
||||
)
|
||||
if not _problem_list:
|
||||
@@ -248,7 +248,8 @@ class WordBankManage:
|
||||
# __text = (m.data["image"], 30, 30)
|
||||
__text = "[图片]"
|
||||
_text.append(__text)
|
||||
msg_list.append("".join(str(_text)))
|
||||
_text = "".join(_text)
|
||||
msg_list.append(_text)
|
||||
column_name = ["序号", "回答内容"]
|
||||
data_list = []
|
||||
for index, msg in enumerate(msg_list):
|
||||
|
||||
@@ -15,7 +15,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
description="",
|
||||
usage="""""",
|
||||
extra=PluginExtraData(
|
||||
author="HibiKier", version="0.1", plugin_type=PluginType.HIDDEN
|
||||
author="HibiKier", version="0.1", plugin_type=PluginType.DEPENDANT
|
||||
).dict(),
|
||||
)
|
||||
|
||||
@@ -28,4 +28,4 @@ async def _(session: EventSession, state: T_State):
|
||||
gid = session.id3 or session.id2
|
||||
if result := await WordBank.get_answer(gid, problem):
|
||||
await result.send()
|
||||
logger.info(f" 触发词条 {problem}", "词条检测", session=session)
|
||||
logger.info(f"触发词条 {problem}", "词条检测", session=session)
|
||||
|
||||
@@ -322,4 +322,8 @@ async def _(
|
||||
None, index.result if index.available else None, group_id, word_scope
|
||||
)
|
||||
await result.send()
|
||||
logger.info(f"查看词条回答: {problem}", arparma.header_result, session=session)
|
||||
logger.info(
|
||||
f"查看词条回答: {problem.result if problem.available else index.result}",
|
||||
arparma.header_result,
|
||||
session=session,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user