一个支持图片翻译的nonebot2插件
Project description
📖 介绍
一个基于Nonebot2的插件,提供多个api的文本及图片翻译功能,附带中英词典和ocr功能。
WIP
支持的api
词典功能
图文翻译
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-pictranslator
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-pictranslator
pdm
pdm add nonebot-plugin-pictranslator
poetry
poetry add nonebot-plugin-pictranslator
uv
uv add nonebot-plugin-pictranslator
conda
conda install nonebot-plugin-pictranslator
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_template"]
⚙️ 配置
在 nonebot2 项目的.env文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 可填值 | 说明 |
|---|---|---|---|---|
| TRANSLATE_API_CHOICE | 是 | all | tencent, youdao, baidu, random, all | 使用哪一个api进行翻译,random则随机选取,all则同时使用所有启用的api |
| 腾讯API相关 | / | / | / | 详见腾讯文档 |
| TENCENT_ID | 若使用则必填 | 无 | String | 腾讯API的secret_id |
| TENCENT_KEY | 若使用则必填 | 无 | String | 腾讯API的secret_key |
| USE_TENCENT | 否 | / | Bool | 是否启用腾讯API,填写了上两项则默认启用 |
| TENCENT_PROJECT_ID | 否 | 0 | Int | 腾讯API的project_id |
| TENCENT_API_REGION | 否 | 无 | String | 腾讯API的secret_key |
| 有道API相关 | / | / | / | 详见有道文档 |
| YOUDAO_ID | 若使用则必填 | 无 | String | 有道API的secret_id |
| YOUDAO_KEY | 若使用则必填 | 无 | String | 有道API的secret_key |
| USE_YOUDAO | 否 | / | Bool | 是否启用有道API,填写了上两项则默认启用 |
| 百度API相关 | WIP | |||
| TIANAPI_KEY | 是 | 无 | String | 天聚数行APIkey,用于中英词典查询 |
🎉 使用
指令表
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|---|---|---|---|---|
| 词典/查词 <单词> | 群员 | 否 | 群聊 | 查询单词释义 |
| (图片)翻译/<语言>译<语言> | 群员 | 否 | 群聊 | 核心翻译功能,使用<语言>译<语言>来指定源语言和目标语言。 |
| ocr | 群员 | 否 | 群聊 | 进行图片文字提取 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_pictranslator-0.1.1.tar.gz.
File metadata
- Download URL: nonebot_plugin_pictranslator-0.1.1.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c21feef017a49b7ef029ef8ff530ecb0f4251eb57819f2d6712e10f7bccf2128
|
|
| MD5 |
c056f1b86babaa4a37a6207963dcdcce
|
|
| BLAKE2b-256 |
711de740cf96cf1f7273a0dbfbd4cf3c638b319779406690295b57b9ff874bfc
|
File details
Details for the file nonebot_plugin_pictranslator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_pictranslator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecea62b8ab3cd34710443d5c39b307892b79dea03683f02b47fdcfc7e4ba64ff
|
|
| MD5 |
7e9579c0eb2aecc7252efdb472f28fad
|
|
| BLAKE2b-256 |
9d526e28395d2a0314c770d3e35bd847361b6e7b3a4c1d06c4ae7b1ec82ccf04
|