diff --git a/pkg/api/ivr/whois.go b/pkg/api/ivr/whois.go index bad4faf..d43287a 100644 --- a/pkg/api/ivr/whois.go +++ b/pkg/api/ivr/whois.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "net/http" + "strings" log "github.com/sirupsen/logrus" ) @@ -50,7 +51,22 @@ func Whois(username string) string { var responseObject whoisApiResponse json.Unmarshal(body, &responseObject) - reply := fmt.Sprintf("User: %s, ID: %s, Color: %s, Partner: %v, Affiliate: %v, Staff: %v, Admin: %v, Bot: %v, Bio: %v", responseObject.DisplayName, responseObject.Id, responseObject.ChatColor, responseObject.Roles.IsPartner, responseObject.Roles.IsAffiliate, responseObject.Roles.IsStaff, responseObject.Roles.IsSiteAdmin, responseObject.Bot, responseObject.Bio) + // time string format 2011-05-19T00:28:28.310449Z + // discard everything after T + created := strings.Split(responseObject.CreatedAt, "T") + + reply := fmt.Sprintf("User: %s, ID: %s, Created on: %s, Color: %s, Affiliate: %v, Partner: %v, Staff: %v, Admin: %v, Bot: %v, Bio: %v", + responseObject.DisplayName, + responseObject.Id, + created[0], + responseObject.ChatColor, + responseObject.Roles.IsAffiliate, + responseObject.Roles.IsPartner, + responseObject.Roles.IsStaff, + responseObject.Roles.IsSiteAdmin, + responseObject.Bot, + responseObject.Bio, + ) // User not found if responseObject.Error != "" { diff --git a/pkg/handlers/command.go b/pkg/handlers/command.go index 67c7488..41e5dee 100644 --- a/pkg/handlers/command.go +++ b/pkg/handlers/command.go @@ -433,9 +433,6 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { if msgLen == 1 { nb.Send(target, "Usage: ()whois [user]") return - } else if message.User.ID != "31437432" { - nb.Send(target, "You are not authorized to do that.") - return } else { commands.Whois(target, cmdParams[1], nb) return