remove helix stuff

This commit is contained in:
lyx0 2021-11-07 17:33:39 +01:00
parent 5d61cbfe43
commit 34e2bddef1
5 changed files with 8 additions and 30 deletions

View file

@ -4,13 +4,11 @@ import (
"time" "time"
twitch "github.com/gempir/go-twitch-irc/v2" twitch "github.com/gempir/go-twitch-irc/v2"
"github.com/nicklaw5/helix"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
) )
type Bot struct { type Bot struct {
TwitchClient *twitch.Client TwitchClient *twitch.Client
HelixClient *helix.Client
MongoClient *mongo.Client MongoClient *mongo.Client
Uptime time.Time Uptime time.Time
} }

View file

@ -10,7 +10,6 @@ import (
"github.com/lyx0/nourybot/pkg/config" "github.com/lyx0/nourybot/pkg/config"
"github.com/lyx0/nourybot/pkg/db" "github.com/lyx0/nourybot/pkg/db"
"github.com/lyx0/nourybot/pkg/handlers" "github.com/lyx0/nourybot/pkg/handlers"
"github.com/nicklaw5/helix"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -25,17 +24,8 @@ func main() {
conf := config.LoadConfig() conf := config.LoadConfig()
helixClient, err := helix.NewClient(&helix.Options{
ClientID: conf.ClientId,
ClientSecret: conf.ClientSecret,
})
if err != nil {
log.Fatalf("Error creating helix client: %s", err)
}
nb = &bot.Bot{ nb = &bot.Bot{
TwitchClient: twitch.NewClient(conf.Username, conf.Oauth), TwitchClient: twitch.NewClient(conf.Username, conf.Oauth),
HelixClient: helixClient,
MongoClient: db.Connect(conf), MongoClient: db.Connect(conf),
Uptime: time.Now(), Uptime: time.Now(),
} }

2
go.mod
View file

@ -12,10 +12,8 @@ require (
require ( require (
github.com/go-stack/stack v1.8.0 // indirect github.com/go-stack/stack v1.8.0 // indirect
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
github.com/golang/snappy v0.0.1 // indirect github.com/golang/snappy v0.0.1 // indirect
github.com/klauspost/compress v1.13.6 // indirect github.com/klauspost/compress v1.13.6 // indirect
github.com/nicklaw5/helix v1.25.0 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.0.2 // indirect github.com/xdg-go/scram v1.0.2 // indirect

4
go.sum
View file

@ -32,8 +32,6 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe
github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ=
github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0=
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
@ -54,8 +52,6 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/nicklaw5/helix v1.25.0 h1:Mrz537izZVsGdM3I46uGAAlslj61frgkhS/9xQqyT/M=
github.com/nicklaw5/helix v1.25.0/go.mod h1:yvXZFapT6afIoxnAvlWiJiUMsYnoHl7tNs+t0bloAMw=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

View file

@ -10,8 +10,6 @@ import (
type Config struct { type Config struct {
Username string Username string
Oauth string Oauth string
ClientId string
ClientSecret string
BotUserId string BotUserId string
MongoURI string MongoURI string
} }
@ -26,8 +24,6 @@ func LoadConfig() *Config {
cfg := &Config{ cfg := &Config{
Username: os.Getenv("TWITCH_USER"), Username: os.Getenv("TWITCH_USER"),
Oauth: os.Getenv("TWITCH_PASS"), Oauth: os.Getenv("TWITCH_PASS"),
ClientId: os.Getenv("CLIENT_ID"),
ClientSecret: os.Getenv("CLIENT_SECRET"),
BotUserId: os.Getenv("BOT_USER_ID"), BotUserId: os.Getenv("BOT_USER_ID"),
MongoURI: os.Getenv("MONGO_URI"), MongoURI: os.Getenv("MONGO_URI"),
} }