mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
comments
This commit is contained in:
parent
fdfe327bb3
commit
a0a4632b22
3 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue