Multi language tanslator worked with nonebot2
Project description
基于 NoneBot2。
前言
接口来自 腾讯机器翻译 TMT 目前使用 签名方法 v1
准备工作
开始使用
建议使用 poetry
通过 poetry 添加到 NoneBot2 项目的 pyproject.toml
poetry add nonebot-plugin-translator
也可以通过 pip 从 PyPI 安装
pip install nonebot-plugin-translator
参照下文在 NoneBot2 项目的环境文件 .env.* 中添加配置项
配置项
腾讯云 API 请求的公共参数(必须)
- tencentcloud_common_region str
- 地域参数 ,用来标识希望操作哪个地域的数据
- tencentcloud_common_secretid str
- tencentcloud_common_secretkey str
- 你的 SecretKey 用来生成请求签名 Signature
# .env.prod
tencentcloud_common_region = "ap-shanghai"
tencentcloud_common_secretid = ""
tencentcloud_common_secretkey = ""
这样,就能够在 bot 所在群聊或私聊发送 翻译 或 翻译+ 使用了
翻译+ 是一个用于进行连续翻译的翻译锁定模式,翻译锁定 是它的别名,请根据提示操作
常见问题
- 我确认我的安装和配置过程正确,但我发送 翻译 或 机翻 没有反应
- 如果在 .env.* 的 command_start 内仅设置了非空前缀,就必须在命令前加上前缀,比如 /翻译 /翻译+
特别感谢
优化建议
请积极提交 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.0b4.post0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb6c2a079b20d300eb1d09bb785255ac2e3be3e43cc261dc6950657b53791f0d |
|
MD5 | be0c8b3ed6b749941094a8bacc56d5d3 |
|
BLAKE2b-256 | 47688b16461bca67c958085a02d55e94b13db3eed33b5aed14c8adce025732cb |
Close
Hashes for nonebot_plugin_translator-2.0.0b4.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41982f5d5d382c5d342773a769aca6c1708e475bf4b951ee06c77793f170e70c |
|
MD5 | b4c74550119b8a69ebcd509f9510bf5c |
|
BLAKE2b-256 | 5a8f48fbddc88280fdaceb9442d320617c214b4f51977da27eba430d9f1c8c34 |