Changing to match many people

This commit is contained in:
Chris Sexton 2013-08-30 22:09:45 -04:00
parent 43a8bec86b
commit 9e1d3de25c
1 changed files with 3 additions and 3 deletions

View File

@ -153,10 +153,10 @@ func (b *Bot) Filter(message Message, input string) string {
input = strings.Replace(input, "$nick", nick, -1) input = strings.Replace(input, "$nick", nick, -1)
} }
if strings.Contains(input, "$someone") { for strings.Contains(input, "$someone") {
nicks := b.Who(message.Channel) nicks := b.Who(message.Channel)
someone := nicks[rand.Intn(len(nicks))].Name someone := nicks[rand.Intn(len(nicks))].Name
input = strings.Replace(input, "$someone", someone, -1) input = strings.Replace(input, "$someone", someone, 1)
} }
for strings.Contains(input, "$digit") { for strings.Contains(input, "$digit") {