mirror of https://github.com/velour/catbase.git
Added short user name complaining
This commit is contained in:
parent
bc7a2c4847
commit
1551463c7f
|
@ -19,7 +19,6 @@ func (b *Bot) checkuser(nick string) *User {
|
||||||
var user *User = nil
|
var user *User = nil
|
||||||
for _, usr := range b.Users {
|
for _, usr := range b.Users {
|
||||||
if usr.Name == nick {
|
if usr.Name == nick {
|
||||||
fmt.Println("Matched ", nick)
|
|
||||||
user = &usr
|
user = &usr
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,13 @@ func (p *TalkerPlugin) Message(message bot.Message) bool {
|
||||||
return false
|
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)
|
lowermessage := strings.ToLower(body)
|
||||||
|
|
||||||
if strings.Contains(lowermessage, "felps") || strings.Contains(lowermessage, "fredfelps") {
|
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 {
|
func (p *TalkerPlugin) Event(kind string, message bot.Message) bool {
|
||||||
if kind == "JOIN" && message.User.Name != p.Bot.Config.Nick {
|
if kind == "JOIN" && message.User.Name != p.Bot.Config.Nick {
|
||||||
sayings := []string{
|
sayings := []string{
|
||||||
"Real men use screen, flyngpngn.",
|
"Real men use screen, %s.",
|
||||||
"Joins upset the hivemind's OCD, %s.",
|
"Joins upset the hivemind's OCD, %s.",
|
||||||
}
|
}
|
||||||
msg := fmt.Sprintf(sayings[rand.Intn(len(sayings))], message.User.Name)
|
msg := fmt.Sprintf(sayings[rand.Intn(len(sayings))], message.User.Name)
|
||||||
|
|
Loading…
Reference in New Issue