Added short user name complaining

This commit is contained in:
Chris Sexton 2012-08-25 00:58:36 -04:00
parent bc7a2c4847
commit 1551463c7f
2 changed files with 8 additions and 2 deletions

View File

@ -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
}

View File

@ -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)