Skip to content

Commit a512751

Browse files
committed
better discord message formatting
fixes: #15
1 parent 0e0f126 commit a512751

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

commands/monitor.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func waitForTerm(sigChan <-chan os.Signal) {
2323
<-sigChan
2424

2525
if config.MonitorWebhook != "" {
26-
hook := exec.Command("curl", "-H", "Content-type: application/json", "-d", `{"content": "stopped monitoring"}`,
26+
hook := exec.Command("curl", "-H", "Content-type: application/json", "-d", `{"content": "👋"}`,
2727
config.MonitorWebhook)
2828
hook.Run()
2929
}
@@ -88,7 +88,7 @@ func fromDownToUp(serverAddress string) {
8888
fmt.Printf(theme.ColorGreen+"\r[conn]"+theme.ColorReset+" ⤴️: %v\n", time.Now().UTC())
8989

9090
if config.MonitorWebhook != "" {
91-
msg := fmt.Sprintf(`{"content": "[conn] ⤴️: %s"}`, serverAddress)
91+
msg := fmt.Sprintf(`{"content": "⤴️ %s"}`, serverAddress)
9292
hook := exec.Command("curl", "-H", "Content-type: application/json", "-d", msg,
9393
config.MonitorWebhook)
9494
hook.Run()
@@ -99,7 +99,7 @@ func fromUpToDown(serverAddress string) {
9999
fmt.Printf(theme.ColorRed+"\r[down]"+theme.ColorReset+" ⤵️: %v\n", time.Now().UTC())
100100

101101
if config.MonitorWebhook != "" {
102-
msg := fmt.Sprintf(`{"content": "[down] ⤵️: %s"}`, serverAddress)
102+
msg := fmt.Sprintf(`{"content": "⤵️ %s"}`, serverAddress)
103103
hook := exec.Command("curl", "-H", "Content-type: application/json", "-d", msg,
104104
config.MonitorWebhook)
105105
hook.Run()
@@ -140,7 +140,7 @@ func Monitor(args []string) {
140140
fmt.Printf(theme.ColorGray+"interval: "+theme.ColorYellow+"%v seconds"+theme.ColorReset+"\n", montitorScanInterval)
141141

142142
if config.MonitorWebhook != "" {
143-
msg := fmt.Sprintf(`{"content": "starting monitoring: %s"}`, serverAddress)
143+
msg := fmt.Sprintf(`{"content": "📡 %s"}`, serverAddress)
144144
hook := exec.Command("curl", "-H", "Content-type: application/json", "-d", msg,
145145
config.MonitorWebhook)
146146
hook.Run()

0 commit comments

Comments
 (0)