forked from uniswapliquiditypool/wowalert
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,19 @@ | ||
# Telepush | ||
Telegram 推送机器人 | ||
|
||
Vercel Telegram 消息推送机器人 | ||
|
||
## 安装 | ||
### now 搭建 | ||
建议部署在 now 上,免费的套餐够用。 | ||
部署教程参考这篇文章:[📟如何搭建一个属于自己的 Telegram 推送 Bot - 瞎说](https://hesay.me/posts/your-own-telegram-push-service/) | ||
## 一键部署 | ||
|
||
### vps 安装 | ||
1. 下载代码 | ||
```shell | ||
git clone https://github.com/indes/telepush | ||
cd telepush | ||
``` | ||
|
||
2. 安装依赖 | ||
```shell | ||
composer install | ||
``` | ||
|
||
3. 修改配置文件 | ||
```shell | ||
cp .env.example .env | ||
``` | ||
|
||
参考下面格式修改 .env | ||
```shell | ||
BOT_TOKEN=<Telegram bot token> | ||
OWNER_ID=<你的 Telegram id> | ||
PROXY=<如果服务器不能正常访问telegram api服务器,请设置代理,例如:socks5h://127.0.0.1:1080,否则此项留空> | ||
``` | ||
|
||
4. 本地测试 | ||
``` | ||
php -S localhost:8080 -t public | ||
``` | ||
<a href="https://vercel.com/new/project?template=https://github.com/indes/telepush"><img src="https://vercel.com/button"></a> | ||
|
||
## 使用 | ||
发送消息 | ||
``` | ||
curl -X GET http://<your_url>:<port>/api/msg?text=HelloWorld | ||
``` | ||
|
||
发送图片 | ||
``` | ||
curl -X GET http://<your_url>:<port>/api/photo?url=https://i.loli.net/2018/12/07/5c0a36e08ec6d.jpg | ||
curl -X GET http://<your_url>/api/notify?u=123&m=HelloWorld | ||
``` | ||
|
||
路由说明 | ||
路由参数说明 | ||
|
||
|url 路径|参数(类型, 说明)|说明| | ||
| ------ | ------ | ------ | | ||
|api/msg |text(String,消息内容)|发送文字消息| | ||
|api/photo |url(String,发送的图片地址)|发送图片消息| | ||
| url 路径 | 参数(类型, 说明) | 说明 | | ||
| ---------- | ---------------------- | ------------ | | ||
| api/notify | m(消息内容),u(telegram用户id) | 发送文字消息 | |