https://github.com/reycn/fanyi-bot
🤖 Telegram 上的谷歌翻译机器人,为全世界语言提供中文翻译。
https://github.com/reycn/fanyi-bot
googletranslate python3 telegram-bot translation
Last synced: 9 months ago
JSON representation
🤖 Telegram 上的谷歌翻译机器人,为全世界语言提供中文翻译。
- Host: GitHub
- URL: https://github.com/reycn/fanyi-bot
- Owner: reycn
- License: mit
- Created: 2020-01-30T15:03:30.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-05-28T02:38:32.000Z (about 3 years ago)
- Last Synced: 2024-12-29T23:25:17.744Z (over 1 year ago)
- Topics: googletranslate, python3, telegram-bot, translation
- Language: Python
- Homepage: https://t.me/fanyi_bot
- Size: 242 KB
- Stars: 61
- Watchers: 1
- Forks: 11
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 谷歌翻译机器人(fanyi_bot)

[](https://codebeat.co/projects/github-com-reycn-fanyi_bot-master)   [](https://www.stathat.com/s/9xOlCBfnl1kj)
为全世界语言提供中文翻译。
[在 Telegram 上使用](https://t.me/fanyi_bot)
## 如何使用?
- 私聊机器人,自动翻译文字消息;
- 群聊中添加机器人,使用命令翻译指定消息;
- 任意聊天框,输入 @fanyi_bot 实时翻译。
## 最近更新
- [2020.12.05] 彻底解决 API 问题
- [2020.11.14] 脏解决 API 问题
- [2020.08.11] 修复交互细节
- [2020.08.05] 机器人现已无需管理员权限
- [2020.08.04] 使用最新模型,提升翻译质量
## 如何部署到自己的服务器?
- 按照 `confi.template` 文件的格式新建 `config.ini` 配置文件,将你的 [Telegram Bot Token](https://core.telegram.org/bots#6-botfather) 放入该文件中
- `pip install -r requirements.txt` 安装依赖 `aiogram`, `termcolor`, and `googletrans`
- 执行 `python3 main.py` / 或后台执行 `setsid python3 main.py`
## 功能预览
- 私聊或有管理员权限的群聊中直接翻译

- 在任意聊天窗口 @fanyi_bot 通过 inline query 直接查询

## 代码依赖
- Python >= 3.7
- [aiogram](https://github.com/aiogram/aiogram) Is a pretty simple and fully asynchronous framework for Telegram Bot API written in Python 3.7 with asyncio and aiohttp.
- [googletrans](https://github.com/ssut/py-googletrans) (unofficial) Googletrans: Free and Unlimited Google translate API for Python.
- [termcolor](https://github.com/hfeeki/termcolor) (fork version) fork of termcolor Python library
## 感谢
- Supprot from [Cloudflare](https://cloudflare.com)