Multi language tanslator worked with nonebot2
Project description
nonebot plugin translator
功能
- 多语种翻译插件
接口来自 腾讯机器翻译 TMT 目前使用 签名方法 v1
准备工作
- 在 云API密钥 新建密钥,取得
SecretId
和SecretKey
开始使用
建议使用 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.*
中添加配置项
配置项
-
腾讯云 API 请求的公共参数(必须)
tencentcloud_common_region: str
地域参数,用来标识希望操作哪个地域的数据tencentcloud_common_secretid: str
在 云API密钥 上申请的标识身份的SecretId
,一个SecretId
对应唯一的SecretKey
tencentcloud_common_secretkey: str
你的SecretKey
用来生成请求签名 Signature
tencentcloud_common_region = "ap-shanghai"
tencentcloud_common_secretid = ""
tencentcloud_common_secretkey = ""
- 这样,就能够在 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.0a13.post0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2f5938faeeeac18b847166f91ac4f32007200ab7777a5db60d5d56c09fb0d9e |
|
MD5 | 17c00a9c4d3f0a8dbe91c5a695119728 |
|
BLAKE2b-256 | 861864c6d6348aaeae931915b732141cf74969c801498905db042e4d5936166c |
Close
Hashes for nonebot_plugin_translator-2.0.0a13.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e093fa8d000bb18325cd3f9040650c20c52566325660ffb01c900bcd166b52b |
|
MD5 | 100cb5b0955769e9e73906852611f0a0 |
|
BLAKE2b-256 | 0084ba4cd7fd55713786c629b6968f1665f5deac93653dbbbeabc7cecdd31ab0 |