diff --git a/cmd/bot/command.go b/cmd/bot/command.go index 4e44944..dc0e36b 100644 --- a/cmd/bot/command.go +++ b/cmd/bot/command.go @@ -87,6 +87,18 @@ func (app *Application) handleCommand(message twitch.PrivateMessage) { } else { return } + case "debug": // ()edituser level nourylul 1000 + if message.User.ID != "31437432" { // Limit to myself for now. + return + } else if msgLen < 3 { + common.Send(target, "Not enough arguments provided.", app.TwitchClient) + return + } else if cmdParams[1] == "user" { + app.DebugUser(cmdParams[2], message) + return + } else { + return + } case "deletechannel": if message.User.ID != "31437432" { // Limit to myself for now. return diff --git a/cmd/bot/user.go b/cmd/bot/user.go index ff93f68..65b4742 100644 --- a/cmd/bot/user.go +++ b/cmd/bot/user.go @@ -43,6 +43,21 @@ func (app *Application) AddUser(login, lvl string, message twitch.PrivateMessage } } +func (app *Application) DebugUser(login string, message twitch.PrivateMessage) { + user, err := app.Models.Users.Get(login) + + if err != nil { + reply := fmt.Sprintf("Something went wrong FeelsBadMan %s", err) + 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) + common.Send(message.Channel, reply, app.TwitchClient) + app.TwitchClient.Whisper(message.User.Name, reply) + return + } +} + func (app *Application) DeleteUser(login string, message twitch.PrivateMessage) { err := app.Models.Users.Delete(login) if err != nil {