From 1551463c7f9bbcf0ca3b6453f32307e2419c98f1 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sat, 25 Aug 2012 00:58:36 -0400 Subject: [PATCH] Added short user name complaining --- bot/handlers.go | 1 - plugins/talker.go | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bot/handlers.go b/bot/handlers.go index c5752ce..56db520 100644 --- a/bot/handlers.go +++ b/bot/handlers.go @@ -19,7 +19,6 @@ func (b *Bot) checkuser(nick string) *User { var user *User = nil for _, usr := range b.Users { if usr.Name == nick { - fmt.Println("Matched ", nick) user = &usr break } diff --git a/plugins/talker.go b/plugins/talker.go index b412c42..be4491f 100644 --- a/plugins/talker.go +++ b/plugins/talker.go @@ -26,6 +26,13 @@ func (p *TalkerPlugin) Message(message bot.Message) bool { return false } + if len(message.User.Name) != 9 { + msg := fmt.Sprintf("Hey %s, we really like to have 9 character nicks because we're crazy OCD and stuff.", + message.User.Name) + p.Bot.SendMessage(message.Channel, msg) + return true + } + lowermessage := strings.ToLower(body) if strings.Contains(lowermessage, "felps") || strings.Contains(lowermessage, "fredfelps") { @@ -49,7 +56,7 @@ func (p *TalkerPlugin) Help(channel string, parts []string) { func (p *TalkerPlugin) Event(kind string, message bot.Message) bool { if kind == "JOIN" && message.User.Name != p.Bot.Config.Nick { sayings := []string{ - "Real men use screen, flyngpngn.", + "Real men use screen, %s.", "Joins upset the hivemind's OCD, %s.", } msg := fmt.Sprintf(sayings[rand.Intn(len(sayings))], message.User.Name)