From a871dcd3cddf7991d750a1de5c09c71b5dc10f1d Mon Sep 17 00:00:00 2001 From: lyx0 <66651385+lyx0@users.noreply.github.com> Date: Sun, 14 Aug 2022 20:33:49 +0200 Subject: [PATCH] clean up --- cmd/bot/channel.go | 2 +- cmd/bot/command.go | 23 ++++++++++++----------- cmd/bot/main.go | 12 ++++++------ cmd/bot/user.go | 2 +- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/cmd/bot/channel.go b/cmd/bot/channel.go index 5ab17c9..81852fb 100644 --- a/cmd/bot/channel.go +++ b/cmd/bot/channel.go @@ -80,7 +80,7 @@ func (app *Application) InitialJoin() { // Iterate over the slice of channels and join each. for _, v := range channel { app.TwitchClient.Join(v) - app.Logger.Infow("Joining channel:", + app.Logger.Infow("Joining channel", "channel", v) } } diff --git a/cmd/bot/command.go b/cmd/bot/command.go index c8758bf..f1ad5dd 100644 --- a/cmd/bot/command.go +++ b/cmd/bot/command.go @@ -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. @@ -148,7 +148,7 @@ func (app *Application) handleCommand(message twitch.PrivateMessage) { return } - // ()pinG + // ()ping case "ping": commands.Ping(target, app.TwitchClient) return @@ -219,6 +219,7 @@ func (app *Application) handleCommand(message twitch.PrivateMessage) { //################# // 250 - VIP only //################# + // ()debug user case "debug": if userLevel < 250 { return @@ -301,7 +302,7 @@ func (app *Application) handleCommand(message twitch.PrivateMessage) { } else { return } - case "editcommand": // ()editcommand level nourylul 1000 + case "editcommand": // ()editcommand level dankwave 1000 if userLevel < 1000 { return } else if msgLen < 4 { diff --git a/cmd/bot/main.go b/cmd/bot/main.go index 8d12c73..9a54194 100644 --- a/cmd/bot/main.go +++ b/cmd/bot/main.go @@ -59,12 +59,12 @@ func main() { // Received a PrivateMessage (normal chat message). app.TwitchClient.OnPrivateMessage(func(message twitch.PrivateMessage) { - // app.Logger.Infow("Private Message received", - // // "message", message, - // "message.Channel", message.Channel, - // "message.User", message.User.DisplayName, - // "message.Message", message.Message, - // ) + // app.Logger.Infow("Private Message received", + // // "message", message, + // "message.Channel", message.Channel, + // "message.User", 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. diff --git a/cmd/bot/user.go b/cmd/bot/user.go index 522eb99..6a71b1c 100644 --- a/cmd/bot/user.go +++ b/cmd/bot/user.go @@ -58,7 +58,7 @@ func (app *Application) DebugUser(login string, message twitch.PrivateMessage) { common.Send(message.Channel, reply, app.TwitchClient) return } else { - reply := fmt.Sprintf("User %v: ID %v, Login: %s, TwitchID: %v, Level %v", login, user.ID, user.Login, user.TwitchID, user.Level) + reply := fmt.Sprintf("User %v: ID %v, Login: %s, TwitchID: %v, Level: %v", login, user.ID, user.Login, user.TwitchID, user.Level) common.Send(message.Channel, reply, app.TwitchClient) app.TwitchClient.Whisper(message.User.Name, reply) return