Skip to main content

基于 OneBot 适配器的 NoneBot2 百度翻译插件, 可以调用百度翻译 API 实现常用语种之间的互译

Project description

nonebot

Nonebot_Plugin_BaiduTranslate

✨ 基于OneBot适配器的NoneBot2百度翻译插件 ✨

功能

  • 可以调用百度翻译 API 实现常用语种之间的互译

安装

  • 使用 nb-cli
nb plugin install nonebot_plugin_baidutranslate
  • 使用 pip
pip install -U nonebot_plugin_baidutranslate

如何使用

.env 配置项

# 以下均为百度翻译配置,见 https://fanyi-api.baidu.com/doc/21
appid = "xxx"  # 你的 APP ID,在百度翻译的开发者中心里可以找到
key = "xxx"    # 你的密钥,在百度翻译的开发者中心里可以找到
salt = "xxx"   # 随机字符串

各配置项的含义如上。

指令

使用以下指令触发,需加上指令前缀

通用文本翻译:
    x翻x [内容]
    (回复消息)x翻x
   
垂直领域翻译:
    oo领域x翻x [内容]
    (回复消息)oo领域x翻x
    
语种识别:
    语种识别 [内容]
    (回复消息)语种识别

图片示例

更新日志

2023-04-04 v0.3.2

2023-03-29 v0.3.1

  • 现在私聊也可用(但不推荐)

2023-01-29 v0.3.0

  • 添加“垂直领域翻译”与“语种识别”功能

2023-01-28 v0.2.0

  • 修改最低兼容版本为 Python 3.8, 与 nonebot2.0.0rc3 一致
  • 增加回复消息翻译功能
  • 修改匹配翻译文本的bug
  • 错误信息以聊天信息的方式发送
  • 修复命令前缀引起参数缺少,判断翻译后的文本长度@pull/5

2022-05-30 v0.1.1

  • 修改最低兼容版本到 Python 3.7.3 版本

2022-05-27 v0.1.0

  • 添加了基础翻译功能

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_baidutranslate-0.3.2.tar.gz (11.4 kB view hashes)

Uploaded Source

Built Distribution

Supported by

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