Skip to main content

通过ai.animedb.cn的api识别动漫、galgame角色

Project description

NoneBotPluginLogo
NoneBotPluginText

nonebot-plugin-anime-trace

✨ 通过 ai.animedb.cn 的 api 识别动漫、galgame 角色 ✨

License pypi Python stars forks

最新情报

网站 api 更新,已适配。 2025/02/20

前两天网站抽风,现已恢复正常。2023/08/25

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-anime-trace
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip install nonebot-plugin-anime-trace

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot-plugin-anime-trace"]

🎉 使用

默认配置下

命令: {#} {识别|角色|人物|} [gal|动漫]

说明:命令符不是命令头,只要包含命令符和命令关键字就会触发响应,例如“foo 识别 foo#foo”也可以触发

大括号内{}为必要关键字, 中括号内[]为可选参数, 默认使用动漫模型

附带一张图片、或回复一张图片、或再发送一张图片

可以自定义命令符、命令关键字

示例:
image image
image image

⚙️ 配置

如果需要自定义配置,请在 nonebot2 项目的.env文件中添加配置

class Config(BaseModel):
    # 是否合并转发消息
    animetrace_send_forward: bool = True
    # 是否检测ai图
    animetrace_ai_detect: bool = True
    # 是否拆分每个识别结果:角色,作品,链接
    animetrace_extract: bool = True
    # 是否发送萌娘百科链接
    animetrace_moegirl: bool = False
    # 自定义搜索链接, 设置为空""则取消
    animetrace_url: str = "zh.wikipedia.org/w/index.php?search="
    # 命令符
    animetrace_cmd: str = "#"
    # 命令关键字
    animetrace_keyword: set[str] = {"识别", "角色", "人物"}
    # 响应优先级
    animetrace_priority: int = 10
    # 动漫模型
    animetrace_model_anime: str = "anime_model_lovelive"
    # galgame模型
    animetrace_model_gal: str = "full_game_model_kira"
    # 一个角色最多返回几个识别结果
    animetrace_max_num: int = 3
    # bot昵称
    nickname: list[str] = ["anime trace"]

动漫模型和 galgame 模型请前往 ai.animedb.cn查看

常见问题 Q&A

没有识别到任何角色

网站没有识别到该图中的角色

出错啦~可能是图里角色太多了 content:{code:-1}

网站处理图片出错,可能是图中角色过多、或者网站后端挂了,可以尝试裁剪图片

识别失败,换张图片试试吧~<Response [504 Gateway Time-out]>

网站接收图片出错,可能是图中角色过多、或者网站后端挂了,可以尝试裁剪图片

其他

请先去ai.animedb.cn尝试能否识别,若能识别,联系我更新;若不能识别,等待站长修复

TODO

  • 增加 ai 绘图鉴别
  • 添加结果图片对比
  • 跨平台兼容

跨平台兼容

合并转发消息

send_group_forward_msg

字段 类型 说明
group_id uint 群号
messages List[Node] 自定义转发消息

Node

字段 类型 说明
uin string QQ 号
name string 昵称
content List[OneBotSegment] / OneBotSegment 消息内容

send_private_forward_msg

字段 类型 说明
user_id uint 好友 QQ 号
messages List[Node] 自定义转发消息

赞助

救救 developer,孩子吃不起饭了

donate-wx donate-wx

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_anime_trace-0.2.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_anime_trace-0.2.3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_anime_trace-0.2.3.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_anime_trace-0.2.3.tar.gz
Algorithm Hash digest
SHA256 8e8ca6133284be6b092a8f36030efcce27cd90ea1cb621ee49e7de6a7afe9555
MD5 da01517005245902dab031440d9c1ec8
BLAKE2b-256 1e4bcfb3e54f5dfd51f69a6d237f176a94ef53c113e4961ec227581dd91c609e

See more details on using hashes here.

File details

Details for the file nonebot_plugin_anime_trace-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_anime_trace-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d966707b4fde71859a0daf01abfac17415c7e0f2c2d5a02e23e3d785315af53c
MD5 a922ad639e4ac77797cb664b58c6ee50
BLAKE2b-256 66217c51210cc1066dcbbb6f866fb6e078b2a330bc873eed47a014744972c684

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page