remove environment config variable

This commit is contained in:
lyx0 2023-03-03 21:34:52 +00:00
parent 1b382c3e95
commit 6448c71fc1
2 changed files with 16 additions and 11 deletions

View file

@ -45,15 +45,15 @@ func (app *Application) handleCommand(message twitch.PrivateMessage) {
// If the level returned is 0 then the user was not found in the database.
userLevel := app.GetUserLevel(message.User.Name)
// app.Logger.Infow("Command received",
// // "message", message, // Pretty taxing
// "message.Message", message.Message,
// "message.Channel", target,
// "userLevel", userLevel,
// "commandName", commandName,
// "cmdParams", cmdParams,
// "msgLen", msgLen,
// )
app.Logger.Infow("Command received",
// "message", message, // Pretty taxing
"message.Message", message.Message,
"message.Channel", target,
"userLevel", userLevel,
"commandName", commandName,
"cmdParams", cmdParams,
"msgLen", msgLen,
)
// A `commandName` is every message starting with `()`.
// Hardcoded commands have a priority over database commands.

View file

@ -24,7 +24,6 @@ type config struct {
twitchClientId string
twitchClientSecret string
commandPrefix string
environment string
db struct {
dsn string
maxOpenConns int
@ -127,6 +126,12 @@ func main() {
// Received a PrivateMessage (normal chat message).
app.TwitchClient.OnPrivateMessage(func(message twitch.PrivateMessage) {
app.Logger.Infow("Message received",
"message", message,
"message.User.DisplayName", message.User.DisplayName,
"message.Message", message.Message,
)
// roomId is the Twitch UserID of the channel the message originated from.
// If there is no roomId something went really wrong.
roomId := message.Tags["room-id"]
@ -163,7 +168,7 @@ func main() {
app.TwitchClient.OnConnect(func() {
app.Logger.Infow("Successfully connected to Twitch Servers",
"Bot username", cfg.twitchUsername,
"Environment", cfg.environment,
"Environment", envFlag,
"Database Open Conns", cfg.db.maxOpenConns,
"Database Idle Conns", cfg.db.maxIdleConns,
"Database Idle Time", cfg.db.maxIdleTime,