Multi language tanslator worked with nonebot2
Project description
nonebot_plugin_translator
功能
- 多语种翻译插件
接口来自 腾讯 AI 开放平台
准备工作
- 在 腾讯 AI 开放平台 新建应用,并从能力库接入 机器翻译 能力
开始使用
建议使用 poetry
- 通过 poetry 添加到 nonebot2 项目的 pyproject.toml
poetry add nonebot-plugin-translator
- 也可以通过 pip 从 PyPI 安装
pip install nonebot-plugin-translator
- 在 nonebot2 项目中设置
nonebot.load_plugin()
当使用 nb-cli 添加本插件时,该条会被自动添加
nonebot.load_plugin('nonebot_plugin_translator')
- 参照下文在 nonebot2 项目的环境文件
.env.*
中添加配置项
配置项
-
腾讯 AI 开放平台 应用鉴权信息(必须):
tencent_app_id: int
应用 APPIDtencent_app_key: str
应用 APPKEY
tencent_app_id = 0123456789
tencent_app_key = ""
- 这样,就能够在 bot 所在群聊或私聊发送
翻译
或机翻
使用了
特别感谢
优化建议
如有优化建议请积极提交 Issues 或 Pull requests
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
Close
Hashes for nonebot_plugin_translator-2.0.0a8.post0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ff8357ec212eefeba86ba516e8e4c9254ec7339782676bbfc39d7fee67682fd |
|
MD5 | f5d0e749a884355e83e1c3238e2ef7b2 |
|
BLAKE2b-256 | 5608c477855261f697d12c8440abc19001eb45fafb1399a5a78af2d182a9af45 |
Close
Hashes for nonebot_plugin_translator-2.0.0a8.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1292ff329a7244c3c5d4fb8a70078d3a6718f8f1f498a5c1b2d1816888215c07 |
|
MD5 | 2dc94557d7552e6508f6e867b5976a06 |
|
BLAKE2b-256 | e31cd853f61597c20ed95973c1467615965053eb7119b6a63610bee7168e01a6 |