mirror-nourybot/cmd/nourybot/nourybot.go

35 lines
626 B
Go
Raw Normal View History

2022-03-06 20:19:55 +01:00
package main
import (
"time"
"github.com/gempir/go-twitch-irc/v3"
"github.com/lyx0/nourybot/internal/bot"
"github.com/lyx0/nourybot/internal/config"
"github.com/lyx0/nourybot/internal/db"
2022-03-06 20:40:00 +01:00
"github.com/sirupsen/logrus"
2022-03-06 20:19:55 +01:00
)
func main() {
cfg := config.LoadConfig()
2022-03-06 20:40:00 +01:00
logrus.Info(cfg.Username, cfg.Oauth)
2022-03-06 20:19:55 +01:00
twitchClient := twitch.NewClient(cfg.Username, cfg.Oauth)
now := time.Now()
mongoClient := db.Connect(cfg)
nb := &bot.Bot{
TwitchClient: twitchClient,
MongoClient: mongoClient,
Uptime: now,
}
nb.TwitchClient.Join("nourybot")
2022-03-06 20:40:00 +01:00
err := nb.TwitchClient.Connect()
if err != nil {
panic(err)
}
2022-03-06 20:19:55 +01:00
}