Code Monkey home page Code Monkey logo

fanyi_bot's Introduction

谷歌翻译机器人(fanyi_bot)

GitHub top language codebeat badge version License Served
为全世界语言提供中文翻译。
在 Telegram 上使用

如何使用?

  • 私聊我,发送或转发需要翻译的文字,我会将其翻译为中文;
  • 群聊中,添加我为管理员,用 "/fy" 命令回复需要翻译的消息
  • 任意聊天中 @fanyi_bot 调用翻译
  • 自动中译英。

功能预览

  • 私聊或有管理员权限的群聊中直接翻译

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

最近更新 / 2020.2.2

  • 更换为 aiogram 异步框架
  • 添加行内实时转译
  • 更改样式
  • 提供指定语言功能

历史更新

  • 修复群聊判断逻辑
  • 修复上游模块的网页问题
  • 忽略不带文字的群组命令
  • 修复了 Emoji 导致的翻译问题
  • 使用配置文件的方式存储 TOKEN
  • 更换了更稳定的谷歌翻译 API
  • 提供了中译英的新功能。
  • 新增了任意调用功能(inline mode)

如何部署到自己的服务器?

  • 按照 confi.template 文件的格式新建 config.ini 配置文件,将你的 Telegram Bot Token 放入该文件中
  • pip install -r requirements.txt 安装依赖 aiogram, termcolor, and googletrans
  • 执行 python3 main.py / 或后台执行 setsid python3 main.py

代码依赖

  • Python >= 3.7
  • aiogram Is a pretty simple and fully asynchronous framework for Telegram Bot API written in Python 3.7 with asyncio and aiohttp.
  • googletrans (unofficial) Googletrans: Free and Unlimited Google translate API for Python.
  • termcolor (fork version) fork of termcolor Python library

fanyi_bot's People

Contributors

dapohou avatar reycn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.