This commit is contained in:
lyx0 2021-10-21 00:07:18 +02:00
parent fdfe327bb3
commit a0a4632b22
3 changed files with 6 additions and 4 deletions

View file

@ -15,6 +15,7 @@ type Config struct {
func LoadConfig() *Config {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env")
}
@ -24,6 +25,7 @@ func LoadConfig() *Config {
Oauth: os.Getenv("TWITCH_PASS"),
BotUserId: os.Getenv("BOT_USER_ID"),
}
log.Info("Config loaded succesfully")
return cfg

View file

@ -10,6 +10,8 @@ import (
"github.com/sirupsen/logrus"
)
// Command contains all the logic for routing mesasges containing commands
// and will forward the messages to the specific command handlers.
func Command(message twitch.PrivateMessage, nb *bot.Bot) {
logrus.Info("fn Command")

View file

@ -6,10 +6,8 @@ import (
log "github.com/sirupsen/logrus"
)
// HandlePrivateMessage takes in a twitch.Privatemessage,
// *twitch.Client and *config.Config and has the logic to decide if the provided
// PrivateMessage is a command or not and passes it on accordingly.
// Typical twitch message tags https://paste.ivr.fi/nopiradodo.lua
// PrivateMessage checks messages for correctness and forwards
// commands to the command handler.
func PrivateMessage(message twitch.PrivateMessage, nb *bot.Bot) {
log.Info("fn PrivateMessage")
// log.Info(message)