Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eaimty/eaimty_bot
个人用 Telegram Bot
https://github.com/eaimty/eaimty_bot
bot rust telegram telegram-bot
Last synced: about 2 hours ago
JSON representation
个人用 Telegram Bot
- Host: GitHub
- URL: https://github.com/eaimty/eaimty_bot
- Owner: EAimTY
- License: gpl-3.0
- Created: 2020-03-29T16:23:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-16T11:47:30.000Z (over 2 years ago)
- Last Synced: 2023-03-04T23:53:22.421Z (over 1 year ago)
- Topics: bot, rust, telegram, telegram-bot
- Language: Rust
- Homepage:
- Size: 404 KB
- Stars: 12
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eaimty_bot
个人用 Telegram Bot
## 功能
- [x] /about - 关于
- [x] /connectfour - 玩四子棋
- [x] /dart - 掷一枚飞标
- [x] /dice - 掷一枚骰子
- [x] /minesweeper [棋盘高] [棋盘宽] [地雷数] - 玩扫雷
- [x] /ocr - 识别图片中文字
- [x] /reversi - 玩黑白棋
- [x] /slot - 转一次老虎机
- [x] /tictactoe - 玩 Tic-Tac-Toe
- [x] /help - 帮助信息...
游戏抽象均来自 [EAimTY/gamie](https://github.com/EAimTY/gamie)
## 依赖
Leptonica、Tesseract、Tesseract 语言包(eng、jpn、chi_sim、chi_tra)
## 使用
USAGE:
eaimty_bot [OPTIONS] --tokenFLAGS:
-h, --help 打印帮助信息
-V, --version 打印版本信息OPTIONS:
-p, --proxy 设置代理(支持:http、https、socks5)
-t, --token 设置 Telegram Bot HTTP API Token
-w, --webhook 以 webhook 模式运行,后接监听端口号本 bot 支持 longpoll 与 webhook 两种运行方式,默认使用 longpoll
以 webhook 模式运行时,由于 Telegram 限制,webhook 地址必须为 HTTPS 协议,所以需要使用任意 web server 作为中继,以 Nginx 为例:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;# webhook callback URL 域名
server_name DOMAIN;# SSL 证书设置
ssl_certificate /PATH/TO/cert.pem;
ssl_certificate_key /PATH/TO/key.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;# webhook callback URL 路径
location /PATH {
proxy_redirect off;# bot 监听地址与端口
proxy_pass http://127.0.0.1:PORT;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
}## 编译
git clone https://github.com/EAimTY/eaimty_bot.git
cd eaimty_bot编译
cargo build --release
## 开源许可
The GNU General Public License v3.0