Skip to content

Commit

Permalink
twitch oauth fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FlameInTheDark committed May 12, 2020
1 parent 318446e commit ef97f91
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bot/database.go
Expand Up @@ -153,9 +153,17 @@ func (db *DBWorker) GetTwitchToken() *TwitchDBConfig {
}

func (db *DBWorker) UpdateTwitchToken(token string, expire time.Time) {
err := db.DBSession.DB(db.DBName).C("config").Update(bson.M{"type": "twitch"}, bson.M{"&set": bson.M{"token": token, "expire": expire}})
err := db.DBSession.DB(db.DBName).C("config").Update(bson.M{"type": "twitch"}, bson.M{"$set": bson.M{"token": token, "expire": expire}})
if err != nil {
log.Println("[Mongo] Update twitch token error: ", err)
err = db.DBSession.DB(db.DBName).C("config").Insert(TwitchDBConfig{
Type: "twitch",
Token: token,
Expire: expire,
})
if err != nil {
log.Println("[Mongo] Update twitch token error: ", err)
}
}
}

Expand Down

0 comments on commit ef97f91

Please sign in to comment.