Giter VIP home page Giter VIP logo

ohmyduo's Introduction

Oh My Duo

Go GitHub release

> View the English version of README <

你是 Duolingo 的忠实用户吗?

本 Repo 可以帮助你生成自定义的可爱贴纸!

demo

默认内容
https://my.sbchild.top:81 /omd/_
更改角色,原文和翻译
https://my.sbchild.top:81 /omd/_?c=lily&o=do not talk with me&t=不要和我讲话

你在用 Telegram 嘛? 快快试试 https://t.me/sbchild_bot 吧~

用途

制作可爱贴纸!还可以在自己的主页上展示!

怎么用

  1. clone本项目, 或下载压缩包并解压

不想自己编译的可以去 Release GitHub release 下载预编译版

  1. manifest/config 目录下, 复制config.example.tomlconfig.toml, 按需编辑config.toml:
  • 更改 HTTP 监听端口
  • 更改 rootDir 为 URL 地址前缀
  • 更改 httpServer,如果不需要启用 HTTP 服务,请将值修改为 false
  • 更改 telegramBotToken,如果不需要启用 Telegram Bot,请将值修改为空
  • 更改 telegramBotHttpTimeout,推荐设为 3000
  • 更改 telegramBotHttpProxy,如果不需要启用 Telegram 代理,请将值修改为空
  • 更改 telegramBotImageServer 为 Telegram 使用的 OhMyDuo 地址
  1. 编译
  • 准备好golang 1.20+gfcli环境
  • ./build.sh
  1. 部署
  • 确保oh-my-duo-*config.yaml在同一目录下
  • 运行oh-my-duo-*
  • (可选) 按需修改OhMyDuo.service, 并拷贝至/etc/systemd/system/OhMyDuo.service, 即可创建一个 systemd 服务
  • 接下来你可以尝试使用 Web 服务器的反向代理功能,可以方便使用,以及允许 Telegram 从这个服务器请求图片!
  1. 测试
  • 打开浏览器,输入你的域名或ip地址/你的地址前缀/_,例如https://my.sbchild.top:81/omd/_
  • 如果浏览器显示了一张多儿的照片,恭喜你,它能用啦
  1. 到底怎么用

目前有两个方式调用这个生成器:

  1. /_后面添加参数, 第一个参数前加上?, 参数之间使用&分隔
  • /_ 默认
  • /_?c=lily 指定角色,不区分大小写, 默认为 Duo
    • Duo
    • Bea
    • Vikram
    • Oscar
    • Junior
    • Eddy
    • Zari
    • Lily
    • Lin
    • Lucy
    • Falstaff
  • /_?o=text... 原文。某些情况下,空格需要使用%20代替
  • /_?t=text... 译文(原文和译文需要一起指定)。某些情况下,空格需要使用%20代替
  1. /_/后面按照如下格式指定参数, 参数之间使用|分隔
  • /_/Hello-world|你好-世界 默认使用 Duo 角色, 原文为Hello world, 译文为你好 世界。空格使用-代替

  • /_/Can-you-speak--English%3f|你会讲英语吗? 原文为Can you speak-English?, 译文为你会讲英语吗?。问号?使用%3f代替, 连字符-使用--代替

  • /_/lucy|Can-you-speak--English%3f|你会讲英语吗? 指定Lucy角色, 原文为Can you speak-English?, 译文为你会讲英语吗?

但是在 Telegram Bot 中,需要这样使用:

  • @some_bot Hello world|你好 世界 列出所有角色的图片, 原文为Hello world, 译文为你好 世界

  • @some_bot Can u speak english|你能讲英语嘛|zari 使用 Zari 角色, 原文为Can u speak english, 译文为你能讲英语嘛

TODO

  • emoji 支持 😊
  • 日文支持
  • 自动截断超长单词
  • 更多语言旗帜 (欢迎 PR)

贡献

欢迎提交 PR 来改进这个程序!

框架

GoFrame

许可证

Apache 2.0

Makefile 子命令

Project Makefile Commands:

  • make cli: Install or Update to the latest GoFrame CLI tool.
  • make dao: Generate go files for Entity/DAO/DO according to the configuration file from hack folder.
  • make service: Parse logic folder to generate interface go files into service folder.
  • make image TAG=xxx: Run docker build to build image according manifest/docker.
  • make image.push TAG=xxx: Run docker build and docker push to build and push image according manifest/docker.
  • make deploy TAG=xxx: Run kustomize build to build and deploy deployment to kubernetes server group according manifest/deploy.

ohmyduo's People

Contributors

sb-child avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lwd-temp

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.