mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add debug command
This commit is contained in:
parent
b91dc8d60a
commit
998ad5c907
2 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue