示例#1
0
func (a *adapter) newMessage(req *irc.Event) *hal.Message {
	return &hal.Message{
		User: hal.User{
			ID:   req.Nick,
			Name: req.Nick,
		},
		Room: req.Arguments[0],
		Text: req.Message(),
	}
}
示例#2
0
func newEventData(ev *ircevent.Event) map[string]interface{} {
	return map[string]interface{}{
		"User":    ev.User,
		"Host":    ev.Host,
		"Source":  ev.Source,
		"Code":    ev.Code,
		"Message": ev.Message(),
		"Nick":    ev.Nick,
		"Target":  ev.Arguments[0],
	}
}
示例#3
0
//irc client incomming message handler function
func ircMsgHandler(e *ircevent.Event) {
	//Samples new anime string:
	//Release: [Anime] [HorribleSubs] Ushio to Tora - 22 [480p].mkv
	//Release: [Anime] [HorribleSubs] Hackadoll the Animation - 09 [720p].mkv

	if releaseWatch.MatchString(e.Message()) == true {
		newEpisode(releaseWatch.FindStringSubmatch(e.Message()))
	} else if e.Arguments[0] == ircClient.Nickname && e.Nick != ircClient.Nickname {
		ircConn.Privmsg(e.Nick, "Discord BOT - https://github.com/gagizagi/Axolotl-GO")
		ircConn.Privmsg(e.Nick, "Current uptime is "+getUptime())
	}
}
示例#4
0
func onPRIVMSG(e *ircevent.Event) {
	b.MessageReceived(e.Arguments[0], e.Message(), &bot.User{Nick: e.Nick})
}