示例#1
0
文件: channels.go 项目: Nyubis/mibot
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)
		}
	}
}
示例#2
0
文件: linktitle.go 项目: Nyubis/mibot
// 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")
	}
}