clientSecret option added
This commit is contained in:
parent
913c76a765
commit
65ed841f29
6 changed files with 9 additions and 4 deletions
|
@ -4,6 +4,7 @@
|
|||
"username": "gempbot",
|
||||
"oauth": "oauthtokenforchat",
|
||||
"clientID": "mytwitchclientid",
|
||||
"clientSecret": "mysecret",
|
||||
"logLevel": "info",
|
||||
"channels": ["77829817", "11148817"],
|
||||
"channelConfigs": {
|
||||
|
|
|
@ -21,6 +21,7 @@ type Config struct {
|
|||
Admin string `json:"admin"`
|
||||
Channels []string `json:"channels"`
|
||||
ClientID string `json:"clientID"`
|
||||
ClientSecret string `json:"clientSecret"`
|
||||
LogLevel string `json:"logLevel"`
|
||||
ChannelConfigs map[string]ChannelConfig `json:"channelConfigs"`
|
||||
}
|
||||
|
|
2
go.mod
2
go.mod
|
@ -5,7 +5,7 @@ go 1.12
|
|||
require (
|
||||
github.com/gempir/go-twitch-irc/v2 v2.2.0
|
||||
github.com/kr/pretty v0.1.0 // indirect
|
||||
github.com/nicklaw5/helix v0.5.7
|
||||
github.com/nicklaw5/helix v0.5.8
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
|
||||
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd // indirect
|
||||
github.com/sirupsen/logrus v1.4.2
|
||||
|
|
2
go.sum
2
go.sum
|
@ -12,6 +12,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
|||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/nicklaw5/helix v0.5.7 h1:DvNyoKkuLYrqZv5/yugL18Ud99UeQoXzzAsg4OwU8uY=
|
||||
github.com/nicklaw5/helix v0.5.7/go.mod h1:nRcok4VLg8ONQYW/iXBZ24wcfiJjTlDbhgk0ZatOrUY=
|
||||
github.com/nicklaw5/helix v0.5.8 h1:RG1vV/XDI6Kc0V/KvoUzRb3Q/7rmAQvVuisfxxYg1ZY=
|
||||
github.com/nicklaw5/helix v0.5.8/go.mod h1:nRcok4VLg8ONQYW/iXBZ24wcfiJjTlDbhgk0ZatOrUY=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=
|
||||
|
|
|
@ -26,9 +26,10 @@ func init() {
|
|||
}
|
||||
|
||||
// NewClient Create helix client
|
||||
func NewClient(clientID string) Client {
|
||||
func NewClient(clientID string, clientSecret string) Client {
|
||||
client, err := helixClient.NewClient(&helixClient.Options{
|
||||
ClientID: clientID,
|
||||
ClientID: clientID,
|
||||
ClientSecret: clientSecret,
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
2
main.go
2
main.go
|
@ -19,7 +19,7 @@ func main() {
|
|||
cfg := config.NewConfig(*configFile)
|
||||
|
||||
fileLogger := filelog.NewFileLogger(cfg.LogsDirectory)
|
||||
helixClient := helix.NewClient(cfg.ClientID)
|
||||
helixClient := helix.NewClient(cfg.ClientID, cfg.ClientSecret)
|
||||
archiver := archiver.NewArchiver(cfg.LogsDirectory)
|
||||
go archiver.Boot()
|
||||
|
||||
|
|
Loading…
Reference in a new issue