Exemple #1
0
func InviteJoin(msg ircmessage.Message) {
	if len(msg.Content) > 0 && verify_channel(msg.Content) {
		if !floodcontrol.FloodCheck("invite", msg.Nick, msg.Channel) {
			bot.SendJoin(msg.Content)
		}
	}
}
Exemple #2
0
// Incoming event for and irc message
func Handle(msg ircmessage.Message) {
	url := httpRe.FindString(msg.Content)
	if url == "" {
		return
	}

	if floodcontrol.FloodCheck("link", msg.Nick, msg.Channel) {
		return
	}

	lastURL[msg.Channel] = url
	if !disabled[msg.Channel] && !checkblacklist(url, msg.Channel) {
		title := getAndFindTitle(url)
		if title != "" {
			bot.SendMessage(msg.Channel, "[URL] "+title)
		}
	} else {
		fmt.Println("Link detected, but", msg.Channel, "is disabled")
	}
}