Skip to content

Commit

Permalink
Integrating go-report-card badge and making it happy for better score
Browse files Browse the repository at this point in the history
  • Loading branch information
saniales authored and fiore committed Nov 5, 2018
1 parent b787e70 commit da89ff9
Show file tree
Hide file tree
Showing 18 changed files with 1,706 additions and 1,705 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ _testmain.go
golang-crypto-trading-bot

.bot_config.yaml
.bot_config.yml
.bot_config.yml

.vscode
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# golang-crypto-trading-bot

[![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)
[![GoDoc](https://godoc.org/github.com/saniales/golang-crypto-trading-bot?status.svg)](https://godoc.org/github.com/saniales/golang-crypto-trading-bot)
[![Travis CI](https://img.shields.io/travis/saniales/golang-crypto-trading-bot.svg)]((https://travis-ci.org/saniales/golang-crypto-trading-bot))
[![GitHub release](https://img.shields.io/github/release/saniales/golang-crypto-trading-bot.svg)](https://github.com/saniales/golang-crypto-trading-bot/releases)
Expand Down
106 changes: 53 additions & 53 deletions examples/telegram_integration.go
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
package strategies

import (
"time"

"github.com/saniales/golang-crypto-trading-bot/environment"
"github.com/saniales/golang-crypto-trading-bot/exchanges"
"github.com/saniales/golang-crypto-trading-bot/strategies"
"github.com/sirupsen/logrus"
tb "gopkg.in/tucnak/telebot.v2"
)

var telegramBot *tb.Bot

var telegramIntegrationExample = strategies.IntervalStrategy{
Model: strategies.StrategyModel{
Name: "telegramIntegrationExample",
Setup: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
telegramBot, err := tb.NewBot(tb.Settings{
Token: "TOKEN_HERE",
Poller: &tb.LongPoller{Timeout: 10 * time.Second},
})

if err != nil {
return err
}

telegramBot.Start()
return nil
},
OnUpdate: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
telegramBot.Send(&tb.User{
Username: "YOUR-USERNAME-GROUP-OR-USER",
}, "OMG SOMETHING HAPPENING!!!!!", tb.SendOptions{})

/*
// Optionally it can have options
telegramBot.Send(tb.User{
Username: "YOUR-JOINED-GROUP-USERNAME",
}, "OMG SOMETHING HAPPENING!!!!!", tb.SendOptions{})
*/
return nil
},
OnError: func(err error) {
logrus.Errorf("I Got an error %s", err)
telegramBot.Stop()
},
TearDown: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
telegramBot.Stop()
return nil
},
},
}
package strategies

import (
"time"

"github.com/saniales/golang-crypto-trading-bot/environment"
"github.com/saniales/golang-crypto-trading-bot/exchanges"
"github.com/saniales/golang-crypto-trading-bot/strategies"
"github.com/sirupsen/logrus"
tb "gopkg.in/tucnak/telebot.v2"
)

var telegramBot *tb.Bot

var telegramIntegrationExample = strategies.IntervalStrategy{
Model: strategies.StrategyModel{
Name: "telegramIntegrationExample",
Setup: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
telegramBot, err := tb.NewBot(tb.Settings{
Token: "TOKEN_HERE",
Poller: &tb.LongPoller{Timeout: 10 * time.Second},
})

if err != nil {
return err
}

telegramBot.Start()
return nil
},
OnUpdate: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
telegramBot.Send(&tb.User{
Username: "YOUR-USERNAME-GROUP-OR-USER",
}, "OMG SOMETHING HAPPENING!!!!!", tb.SendOptions{})

/*
// Optionally it can have options
telegramBot.Send(tb.User{
Username: "YOUR-JOINED-GROUP-USERNAME",
}, "OMG SOMETHING HAPPENING!!!!!", tb.SendOptions{})
*/
return nil
},
OnError: func(err error) {
logrus.Errorf("I Got an error %s", err)
telegramBot.Stop()
},
TearDown: func([]exchanges.ExchangeWrapper, []*environment.Market) error {
telegramBot.Stop()
return nil
},
},
}
Loading

0 comments on commit da89ff9

Please sign in to comment.