mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
clean up
This commit is contained in:
parent
13639b82c1
commit
a871dcd3cd
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 <username>
|
||||
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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue