Skip to content

Commit da89ff9

Browse files
sanialesfiore
authored andcommitted
Integrating go-report-card badge and making it happy for better score
1 parent b787e70 commit da89ff9

File tree

18 files changed

+1706
-1705
lines changed

18 files changed

+1706
-1705
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ _testmain.go
2626
golang-crypto-trading-bot
2727

2828
.bot_config.yaml
29-
.bot_config.yml
29+
.bot_config.yml
30+
31+
.vscode

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# golang-crypto-trading-bot
22

3+
[![Go Report Card](https://goreportcard.com/badge/github.com/saniales/golang-crypto-trading-bot)](https://goreportcard.com/report/github.com/saniales/golang-crypto-trading-bot)
34
[![GoDoc](https://godoc.org/github.com/saniales/golang-crypto-trading-bot?status.svg)](https://godoc.org/github.com/saniales/golang-crypto-trading-bot)
45
[![Travis CI](https://img.shields.io/travis/saniales/golang-crypto-trading-bot.svg)]((https://travis-ci.org/saniales/golang-crypto-trading-bot))
56
[![GitHub release](https://img.shields.io/github/release/saniales/golang-crypto-trading-bot.svg)](https://github.com/saniales/golang-crypto-trading-bot/releases)

examples/telegram_integration.go

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
package strategies
2-
3-
import (
4-
"time"
5-
6-
"github.com/saniales/golang-crypto-trading-bot/environment"
7-
"github.com/saniales/golang-crypto-trading-bot/exchanges"
8-
"github.com/saniales/golang-crypto-trading-bot/strategies"
9-
"github.com/sirupsen/logrus"
10-
tb "gopkg.in/tucnak/telebot.v2"
11-
)
12-
13-
var telegramBot *tb.Bot
14-
15-
var telegramIntegrationExample = strategies.IntervalStrategy{
16-
Model: strategies.StrategyModel{
17-
Name: "telegramIntegrationExample",
18-
Setup: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
19-
telegramBot, err := tb.NewBot(tb.Settings{
20-
Token: "TOKEN_HERE",
21-
Poller: &tb.LongPoller{Timeout: 10 * time.Second},
22-
})
23-
24-
if err != nil {
25-
return err
26-
}
27-
28-
telegramBot.Start()
29-
return nil
30-
},
31-
OnUpdate: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
32-
telegramBot.Send(&tb.User{
33-
Username: "YOUR-USERNAME-GROUP-OR-USER",
34-
}, "OMG SOMETHING HAPPENING!!!!!", tb.SendOptions{})
35-
36-
/*
37-
// Optionally it can have options
38-
telegramBot.Send(tb.User{
39-
Username: "YOUR-JOINED-GROUP-USERNAME",
40-
}, "OMG SOMETHING HAPPENING!!!!!", tb.SendOptions{})
41-
*/
42-
return nil
43-
},
44-
OnError: func(err error) {
45-
logrus.Errorf("I Got an error %s", err)
46-
telegramBot.Stop()
47-
},
48-
TearDown: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
49-
telegramBot.Stop()
50-
return nil
51-
},
52-
},
53-
}
1+
package strategies
2+
3+
import (
4+
"time"
5+
6+
"github.com/saniales/golang-crypto-trading-bot/environment"
7+
"github.com/saniales/golang-crypto-trading-bot/exchanges"
8+
"github.com/saniales/golang-crypto-trading-bot/strategies"
9+
"github.com/sirupsen/logrus"
10+
tb "gopkg.in/tucnak/telebot.v2"
11+
)
12+
13+
var telegramBot *tb.Bot
14+
15+
var telegramIntegrationExample = strategies.IntervalStrategy{
16+
Model: strategies.StrategyModel{
17+
Name: "telegramIntegrationExample",
18+
Setup: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
19+
telegramBot, err := tb.NewBot(tb.Settings{
20+
Token: "TOKEN_HERE",
21+
Poller: &tb.LongPoller{Timeout: 10 * time.Second},
22+
})
23+
24+
if err != nil {
25+
return err
26+
}
27+
28+
telegramBot.Start()
29+
return nil
30+
},
31+
OnUpdate: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
32+
telegramBot.Send(&tb.User{
33+
Username: "YOUR-USERNAME-GROUP-OR-USER",
34+
}, "OMG SOMETHING HAPPENING!!!!!", tb.SendOptions{})
35+
36+
/*
37+
// Optionally it can have options
38+
telegramBot.Send(tb.User{
39+
Username: "YOUR-JOINED-GROUP-USERNAME",
40+
}, "OMG SOMETHING HAPPENING!!!!!", tb.SendOptions{})
41+
*/
42+
return nil
43+
},
44+
OnError: func(err error) {
45+
logrus.Errorf("I Got an error %s", err)
46+
telegramBot.Stop()
47+
},
48+
TearDown: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
49+
telegramBot.Stop()
50+
return nil
51+
},
52+
},
53+
}

0 commit comments

Comments
 (0)