mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-20 11:40:13 +08:00
update v0.0.5.0
This commit is contained in:
@@ -4,16 +4,26 @@ from nonebot.typing import T_State
|
||||
from nonebot.adapters.cqhttp import Bot, MessageEvent, GroupMessageEvent
|
||||
from utils.utils import get_message_imgs
|
||||
from services.log import logger
|
||||
from utils.utils import UserExistLimiter
|
||||
|
||||
|
||||
__plugin_name__ = "识番"
|
||||
__plugin_usage__ = r"""
|
||||
以图识番
|
||||
识番 [图片]
|
||||
__zx_plugin_name__ = "识番"
|
||||
__plugin_usage__ = """
|
||||
usage:
|
||||
api.trace.moe 以图识番
|
||||
指令:
|
||||
识番 [图片]
|
||||
""".strip()
|
||||
__plugin_des__ = "以图识番"
|
||||
__plugin_cmd__ = ["识番 [图片]"]
|
||||
__plugin_version__ = 0.1
|
||||
__plugin_author__ = "HibiKier"
|
||||
__plugin_settings__ = {
|
||||
"level": 5,
|
||||
"default_status": True,
|
||||
"limit_superuser": False,
|
||||
"cmd": ["识番"],
|
||||
}
|
||||
|
||||
_ulmt = UserExistLimiter()
|
||||
|
||||
what_anime = on_command("识番", priority=5, block=True)
|
||||
|
||||
@@ -32,8 +42,6 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||
if str(event.get_message()) in ["帮助"]:
|
||||
await what_anime.finish(__plugin_usage__)
|
||||
if _ulmt.check(event.user_id):
|
||||
await what_anime.finish("您有识番任务正在进行,请稍等...", at_sender=True)
|
||||
img_url = get_message_imgs(event.json())
|
||||
if img_url:
|
||||
state["img_url"] = img_url
|
||||
@@ -42,7 +50,6 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||
@what_anime.got("img_url", prompt="虚空识番?来图来图GKD")
|
||||
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||
img_url = state["img_url"][0]
|
||||
_ulmt.set_true(event.user_id)
|
||||
await what_anime.send("开始识别.....")
|
||||
anime_data_report = await get_anime(img_url)
|
||||
if anime_data_report:
|
||||
@@ -58,4 +65,3 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||
f"{event.group_id if isinstance(event, GroupMessageEvent) else 'private'} 识番 {img_url} 未找到!!"
|
||||
)
|
||||
await what_anime.send(f"没有寻找到该番剧,果咩..", at_sender=True)
|
||||
_ulmt.set_false(event.user_id)
|
||||
|
||||
Reference in New Issue
Block a user