nonebot-plugin-baidutranslate


Namenonebot-plugin-baidutranslate JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/NumberSir/nonebot_plugin_baidutranslate
Summary基于 OneBot 适配器的 NoneBot2 百度翻译插件, 可以调用百度翻译 API 实现常用语种之间的互译
upload_time2023-03-29 08:54:24
maintainer
docs_urlNone
authorNumber_Sir
requires_python>=3.8
license
keywords pip nonebot2 nonebot nonebot_plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <a href="https://v2.nonebot.dev/"><img src="https://v2.nonebot.dev/logo.png" width="200" height="200" alt="nonebot"></a>
</p>

<div align="center">
  
# Nonebot_Plugin_BaiduTranslate
  
_✨ 基于OneBot适配器的[NoneBot2](https://v2.nonebot.dev/)百度翻译插件 ✨_
  
</div>

## 功能

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

## 安装

- 使用 nb-cli

```
nb plugin install nonebot_plugin_baidutranslate
```

- 使用 pip

```
pip install -U nonebot_plugin_baidutranslate
```

## 如何使用

### .env 配置项

```ini
# 以下均为百度翻译配置,见 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
    
语种识别:
    语种识别 [内容]
    (回复消息)语种识别
```

## 图片示例
<div align="left">
  <img src="https://user-images.githubusercontent.com/52584526/169519990-df4402d1-8b5e-4c88-8582-f64485e0e702.png" width="500" />
</div>

<div align="left">
  <img src="https://user-images.githubusercontent.com/52584526/169520252-71343d82-b3fc-477f-a7d7-714405e160ba.png" width="500" />
</div>

<div align="left">
  <img src="https://user-images.githubusercontent.com/52584526/215271556-2b800b02-298f-44f1-af1b-bda0a2d3653b.png" width="500" />
</div>

<div align="left">
  <img src="https://user-images.githubusercontent.com/52584526/215284148-93d94ee7-d04a-4834-9ce1-4e0aeacaa4b6.png" width="500" />
</div>

<div align="left">
  <img src="https://user-images.githubusercontent.com/52584526/215284152-8a0506fa-7719-4c86-a30e-c65d8f84db26.png" width="500" />
</div>

## 更新日志
> 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](https://github.com/NumberSir/nonebot_plugin_baidutranslate/pull/5)
>
> 2022-05-30 v0.1.1
> - 修改最低兼容版本到 Python 3.7.3 版本
> 
> 2022-05-27 v0.1.0
> - 添加了基础翻译功能
>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NumberSir/nonebot_plugin_baidutranslate",
    "name": "nonebot-plugin-baidutranslate",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "pip,nonebot2,nonebot,nonebot_plugin",
    "author": "Number_Sir",
    "author_email": "Number_Sir@126.com",
    "download_url": "https://files.pythonhosted.org/packages/0e/6e/7ac249ed47adc7ab65fdf536d13c6d86932b0d3e6128342540b9493605ad/nonebot_plugin_baidutranslate-0.3.1.tar.gz",
    "platform": "any",
    "description": "<p align=\"center\">\r\n  <a href=\"https://v2.nonebot.dev/\"><img src=\"https://v2.nonebot.dev/logo.png\" width=\"200\" height=\"200\" alt=\"nonebot\"></a>\r\n</p>\r\n\r\n<div align=\"center\">\r\n  \r\n# Nonebot_Plugin_BaiduTranslate\r\n  \r\n_\u2728 \u57fa\u4e8eOneBot\u9002\u914d\u5668\u7684[NoneBot2](https://v2.nonebot.dev/)\u767e\u5ea6\u7ffb\u8bd1\u63d2\u4ef6 \u2728_\r\n  \r\n</div>\r\n\r\n## \u529f\u80fd\r\n\r\n- \u53ef\u4ee5\u8c03\u7528\u767e\u5ea6\u7ffb\u8bd1 API \u5b9e\u73b0\u5e38\u7528\u8bed\u79cd\u4e4b\u95f4\u7684\u4e92\u8bd1\r\n\r\n## \u5b89\u88c5\r\n\r\n- \u4f7f\u7528 nb-cli\r\n\r\n```\r\nnb plugin install nonebot_plugin_baidutranslate\r\n```\r\n\r\n- \u4f7f\u7528 pip\r\n\r\n```\r\npip install -U nonebot_plugin_baidutranslate\r\n```\r\n\r\n## \u5982\u4f55\u4f7f\u7528\r\n\r\n### .env \u914d\u7f6e\u9879\r\n\r\n```ini\r\n# \u4ee5\u4e0b\u5747\u4e3a\u767e\u5ea6\u7ffb\u8bd1\u914d\u7f6e\uff0c\u89c1 https://fanyi-api.baidu.com/doc/21\r\nappid = \"xxx\"  # \u4f60\u7684 APP ID\uff0c\u5728\u767e\u5ea6\u7ffb\u8bd1\u7684\u5f00\u53d1\u8005\u4e2d\u5fc3\u91cc\u53ef\u4ee5\u627e\u5230\r\nkey = \"xxx\"    # \u4f60\u7684\u5bc6\u94a5\uff0c\u5728\u767e\u5ea6\u7ffb\u8bd1\u7684\u5f00\u53d1\u8005\u4e2d\u5fc3\u91cc\u53ef\u4ee5\u627e\u5230\r\nsalt = \"xxx\"   # \u968f\u673a\u5b57\u7b26\u4e32\r\n```\r\n\r\n\u5404\u914d\u7f6e\u9879\u7684\u542b\u4e49\u5982\u4e0a\u3002\r\n\r\n### \u6307\u4ee4\r\n\r\n\u4f7f\u7528\u4ee5\u4e0b\u6307\u4ee4\u89e6\u53d1\uff0c\u9700\u52a0\u4e0a\u6307\u4ee4\u524d\u7f00\r\n\r\n```\r\n\u901a\u7528\u6587\u672c\u7ffb\u8bd1\uff1a\r\n    x\u7ffbx [\u5185\u5bb9]\r\n    (\u56de\u590d\u6d88\u606f)x\u7ffbx\r\n   \r\n\u5782\u76f4\u9886\u57df\u7ffb\u8bd1\uff1a\r\n    oo\u9886\u57dfx\u7ffbx [\u5185\u5bb9]\r\n    (\u56de\u590d\u6d88\u606f)oo\u9886\u57dfx\u7ffbx\r\n    \r\n\u8bed\u79cd\u8bc6\u522b\uff1a\r\n    \u8bed\u79cd\u8bc6\u522b [\u5185\u5bb9]\r\n    (\u56de\u590d\u6d88\u606f)\u8bed\u79cd\u8bc6\u522b\r\n```\r\n\r\n## \u56fe\u7247\u793a\u4f8b\r\n<div align=\"left\">\r\n  <img src=\"https://user-images.githubusercontent.com/52584526/169519990-df4402d1-8b5e-4c88-8582-f64485e0e702.png\" width=\"500\" />\r\n</div>\r\n\r\n<div align=\"left\">\r\n  <img src=\"https://user-images.githubusercontent.com/52584526/169520252-71343d82-b3fc-477f-a7d7-714405e160ba.png\" width=\"500\" />\r\n</div>\r\n\r\n<div align=\"left\">\r\n  <img src=\"https://user-images.githubusercontent.com/52584526/215271556-2b800b02-298f-44f1-af1b-bda0a2d3653b.png\" width=\"500\" />\r\n</div>\r\n\r\n<div align=\"left\">\r\n  <img src=\"https://user-images.githubusercontent.com/52584526/215284148-93d94ee7-d04a-4834-9ce1-4e0aeacaa4b6.png\" width=\"500\" />\r\n</div>\r\n\r\n<div align=\"left\">\r\n  <img src=\"https://user-images.githubusercontent.com/52584526/215284152-8a0506fa-7719-4c86-a30e-c65d8f84db26.png\" width=\"500\" />\r\n</div>\r\n\r\n## \u66f4\u65b0\u65e5\u5fd7\r\n> 2023-03-29 v0.3.1\r\n> - \u73b0\u5728\u79c1\u804a\u4e5f\u53ef\u7528\uff08\u4f46\u4e0d\u63a8\u8350\uff09\r\n> \r\n> 2023-01-29 v0.3.0\r\n> - \u6dfb\u52a0\u201c\u5782\u76f4\u9886\u57df\u7ffb\u8bd1\u201d\u4e0e\u201c\u8bed\u79cd\u8bc6\u522b\u201d\u529f\u80fd\r\n> \r\n> 2023-01-28 v0.2.0\r\n> - \u4fee\u6539\u6700\u4f4e\u517c\u5bb9\u7248\u672c\u4e3a Python 3.8, \u4e0e nonebot2.0.0rc3 \u4e00\u81f4\r\n> - \u589e\u52a0\u56de\u590d\u6d88\u606f\u7ffb\u8bd1\u529f\u80fd\r\n> - \u4fee\u6539\u5339\u914d\u7ffb\u8bd1\u6587\u672c\u7684bug\r\n> - \u9519\u8bef\u4fe1\u606f\u4ee5\u804a\u5929\u4fe1\u606f\u7684\u65b9\u5f0f\u53d1\u9001\r\n> - \u4fee\u590d\u547d\u4ee4\u524d\u7f00\u5f15\u8d77\u53c2\u6570\u7f3a\u5c11\uff0c\u5224\u65ad\u7ffb\u8bd1\u540e\u7684\u6587\u672c\u957f\u5ea6[@pull/5](https://github.com/NumberSir/nonebot_plugin_baidutranslate/pull/5)\r\n>\r\n> 2022-05-30 v0.1.1\r\n> - \u4fee\u6539\u6700\u4f4e\u517c\u5bb9\u7248\u672c\u5230 Python 3.7.3 \u7248\u672c\r\n> \r\n> 2022-05-27 v0.1.0\r\n> - \u6dfb\u52a0\u4e86\u57fa\u7840\u7ffb\u8bd1\u529f\u80fd\r\n>\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "\u57fa\u4e8e OneBot \u9002\u914d\u5668\u7684 NoneBot2 \u767e\u5ea6\u7ffb\u8bd1\u63d2\u4ef6, \u53ef\u4ee5\u8c03\u7528\u767e\u5ea6\u7ffb\u8bd1 API \u5b9e\u73b0\u5e38\u7528\u8bed\u79cd\u4e4b\u95f4\u7684\u4e92\u8bd1",
    "version": "0.3.1",
    "split_keywords": [
        "pip",
        "nonebot2",
        "nonebot",
        "nonebot_plugin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b924af3c4997797745ed995c519b51d1b21d726bac83734c66e7456efbf009b",
                "md5": "9c4b24746adf50089082303db0fcc4e0",
                "sha256": "4650d12d8eccba6a84e919142bb23832133df882d8ed14ad5339e8f52708963a"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_baidutranslate-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c4b24746adf50089082303db0fcc4e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11619,
            "upload_time": "2023-03-29T08:54:23",
            "upload_time_iso_8601": "2023-03-29T08:54:23.140966Z",
            "url": "https://files.pythonhosted.org/packages/5b/92/4af3c4997797745ed995c519b51d1b21d726bac83734c66e7456efbf009b/nonebot_plugin_baidutranslate-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0e6e7ac249ed47adc7ab65fdf536d13c6d86932b0d3e6128342540b9493605ad",
                "md5": "837760a366b6239337b5ea5fd78b5c34",
                "sha256": "b9d746c42c0ebb7ed489946d2aa98e1d25968db32ad3283e75ad02ff0468c7c3"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_baidutranslate-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "837760a366b6239337b5ea5fd78b5c34",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11291,
            "upload_time": "2023-03-29T08:54:24",
            "upload_time_iso_8601": "2023-03-29T08:54:24.781253Z",
            "url": "https://files.pythonhosted.org/packages/0e/6e/7ac249ed47adc7ab65fdf536d13c6d86932b0d3e6128342540b9493605ad/nonebot_plugin_baidutranslate-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-29 08:54:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "NumberSir",
    "github_project": "nonebot_plugin_baidutranslate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nonebot-plugin-baidutranslate"
}
        
Elapsed time: 0.95569s