Skip to content

Commit

Permalink
feat: add slack notify
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZhengZhao committed Oct 20, 2024
1 parent a749361 commit df8ea77
Show file tree
Hide file tree
Showing 8 changed files with 229 additions and 169 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
### Change Log

## v0.0.23
- 接入 slack 推送

## v0.0.22
- 整体升级后台服务,重构通知服务
- 添加多语言功能,目前有 中文, English
- 推送添加多语言功能,目前有 中文, English

## v0.0.21
- 整体升级 ui
Expand Down
9 changes: 9 additions & 0 deletions README.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
# 免责申明
>!!!本项目不构成任何投资建议,投资者应独立决策并自行承担风险!!!
# 实时推送
> dingding, slack
- 钉钉
![钉钉推送1](./img/zh/dingding_future1.jpg)

- slack
![slack](./img/zh/listen_slack.jpg)

# 功能

# Features <!-- omit in toc -->
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ There are no warranties or guarantees expressed or implied.
You assume all responsibility and liability.
```

# Notification
> dingding, slack
- dingding
![钉钉推送1](./img/en/dinding_future1.jpg)

- slack
![slack](./img/en/listen_slack.jpg)


# Features <!-- omit in toc -->

- [Futures Trade](#futures-trade)
Expand Down Expand Up @@ -157,7 +167,7 @@ commend_stop = pm2 stop binance_futures
commend_log = pm2 log binance_futures
[notification]
# dingding, slack(Not currently supported)
# dingding, slack
channel = dingding
[dingding]
Expand All @@ -166,6 +176,10 @@ dingding_token = ""
# trigger keywords
dingding_word = "报警"
[slack]
slack_token = ""
slack_channel_id = ""
[external]
# external links
links = [{"url": "url1", "title": "title1"}]
Expand Down
4 changes: 4 additions & 0 deletions conf/app.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ dingding_token = ""
# 触发关键词
dingding_word = "报警"

[slack]
slack_token = ""
slack_channel_id = ""

[external]
# 外部链接
links = [{"url": "url1", "title": "title1"}]
Binary file added img/en/listen_slack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/zh/listen_slack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions notify/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func GetNotifyChannel() (pusher Pusher) {
switch (notification_channel) {
case "dingding":
pusher = DingDing{}
// case "slack":
// pusher = Slack{}
case "slack":
pusher = Slack{}
default:
pusher = DingDing{}
}
Expand Down
Loading

0 comments on commit df8ea77

Please sign in to comment.