mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
27 lines
554 B
Go
27 lines
554 B
Go
|
package bot
|
||
|
|
||
|
import (
|
||
|
twitch "github.com/gempir/go-twitch-irc/v2"
|
||
|
cfg "github.com/lyx0/nourybot/config"
|
||
|
log "github.com/sirupsen/logrus"
|
||
|
)
|
||
|
|
||
|
type Bot struct {
|
||
|
twitchClient *twitch.Client
|
||
|
cfg *cfg.Config
|
||
|
log *log.Logger
|
||
|
}
|
||
|
|
||
|
func (b *Bot) newTwitchClient() *twitch.Client {
|
||
|
twitchClient := twitch.NewClient(b.cfg.Username, b.cfg.Oauth)
|
||
|
return twitchClient
|
||
|
}
|
||
|
|
||
|
func NewBot(cfg *cfg.Config, log *log.Logger, twitchClient *twitch.Client) *Bot {
|
||
|
return &Bot{
|
||
|
cfg: cfg,
|
||
|
twitchClient: twitchClient,
|
||
|
log: log,
|
||
|
}
|
||
|
}
|