func privmsg(server *ircudf.Server, channel, user, message string) { if message == "!get" && strings.ToLower(user) == admin { if len(add) < 1 { server.Privmsg(chann, "no entries yet") return } i := 0 rand := rand.Intn(len(add)) for name, entry := range add { if i == rand { server.Privmsg(chann, "Selected "+name+": "+entry) break } i++ } add = make(map[string]string) return } if len(message) > 5 { if message[:5] == "!add " { add[user] = message[5:] } } }
func reply(server *ircudf.Server, number, name, reply string) { if number == "376" { log.Println("Quick fix: Waiting 10 seconds") time.Sleep(10 * time.Second) server.Join(chann) } }