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. // If the level returned is 0 then the user was not found in the database.
userLevel := app.GetUserLevel(message.User.Name) userLevel := app.GetUserLevel(message.User.Name)
// app.Logger.Infow("Command received", app.Logger.Infow("Command received",
// // "message", message, // Pretty taxing // "message", message, // Pretty taxing
// "message.Message", message.Message, "message.Message", message.Message,
// "message.Channel", target, "message.Channel", target,
// "userLevel", userLevel, "userLevel", userLevel,
// "commandName", commandName, "commandName", commandName,
// "cmdParams", cmdParams, "cmdParams", cmdParams,
// "msgLen", msgLen, "msgLen", msgLen,
// ) )
// A `commandName` is every message starting with `()`. // A `commandName` is every message starting with `()`.
// Hardcoded commands have a priority over database commands. // Hardcoded commands have a priority over database commands.

View file

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