當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Line.Text方法代碼示例

本文整理匯總了Golang中github.com/fluffle/goirc/client.Line.Text方法的典型用法代碼示例。如果您正苦於以下問題:Golang Line.Text方法的具體用法?Golang Line.Text怎麽用?Golang Line.Text使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/fluffle/goirc/client.Line的用法示例。


在下文中一共展示了Line.Text方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: run

func (self *ModManager) run(event string, line *irc.Line) {
	self.mut.RLock()
	defer self.mut.RUnlock()

	for _, mod := range self.modules {
		// Module should check if enabled, not handlers
		go mod.Handle(module.Event(event), line.Text(), line)
	}
}
開發者ID:CrimsonVoid,項目名稱:irclib,代碼行數:9,代碼來源:handlers.go

示例2: message

func (ei *EndpointIRC) message(c *irc.Conn, l *irc.Line) {
	var messageTarget MessageTarget
	if l.Public() {
		messageTarget = ei.GetChannel(l.Target())
	} else {
		messageTarget = ei.GetUser(l.Target())
	}
	ei.handler(l.Text(), ei.GetUser(l.Nick), l.Target(), messageTarget)
}
開發者ID:andyleap,項目名稱:srvbot,代碼行數:9,代碼來源:endpoint_irc.go

示例3: Handle

// Implement client.Handler so commandSet can Handle things directly.
func (cs *commandSet) Handle(conn *client.Conn, line *client.Line) {
	// This is a dirty hack to treat factoid additions as a special
	// case, since they may begin with command string prefixes.
	ctx := context(conn, line)
	if ctx == nil || util.IsFactoidAddition(line.Text()) {
		return
	}
	if r, ln := cs.match(ctx.Text()); ctx.Addressed && r != nil {
		// Cut command off, trim and compress spaces.
		ctx.Args[1] = strings.Join(strings.Fields(ctx.Args[1][ln:]), " ")
		r.Run(ctx)
	}
}
開發者ID:gundalow,項目名稱:sp0rkle,代碼行數:14,代碼來源:commandset.go

示例4: parsePacket

func (ib *IrcBot) parsePacket(conn *irc.Conn, line *irc.Line) *models.Packet {
	result := ib.regex.FindStringSubmatch(line.Text())
	if result == nil {
		return nil
	}

	fileName := cleanFileName(result[3])
	packet := models.NewPacket(result[1], result[2], fileName, line.Nick, line.Target(), ib.server.Name, line.Time)

	//save packet
	if packet != nil {
		ib.dataService.SavePacket(packet)
	}

	return packet
}
開發者ID:kahoona77,項目名稱:emerald,代碼行數:16,代碼來源:ircBot.go

示例5: handle_privmsg

// Handle privmsgs
func handle_privmsg(conn *irc.Conn, line *irc.Line) {
	text := line.Text()
	args := strings.Split(text, " ")
	//var url_regex = regexp.MustCompile(`\Ahttps?://([[:alnum:]][a-zA-Z0-9-]{1,61}[[:alnum:]]\.?){2,3}((%[0-9A-Fa-f]{2}|[-_.!~*';/?#:@&=+$,A-Za-z0-9])+)?\z`)
	var url_regex = regexp.MustCompile(`\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))`)

	// handle a prefixed command
	if strings.Index(text, RC.CmdPrefix) == 0 {
		handle_command(conn, line, args)
	} else if len(url_regex.FindString(text)) > 0 {
		s := GetScanner()
		s.Handle(conn, line, text)
	}
	// Handle mocking
	if RC.Mocking[line.Nick] {
		SendMessage(conn, "Hey, everybody! "+line.Nick+" said something!", nil)
		SendMessage(conn, line.Nick+": "+line.Text(), nil)
		SendMessage(conn, "Great job, "+line.Nick+"! ╭(ᐛ)و", nil)
	}
}
開發者ID:cneill,項目名稱:rusty-robot,代碼行數:21,代碼來源:handlers.go

示例6: handleNotice

func (ib *IrcBot) handleNotice(conn *irc.Conn, line *irc.Line) {
	log.Printf("[NOTICE] %v", line.Text())
	ib.logToConsole("[NOTICE] " + line.Text())
}
開發者ID:kahoona77,項目名稱:emerald,代碼行數:4,代碼來源:ircBot.go

示例7: log372

func (ib *IrcBot) log372(conn *irc.Conn, line *irc.Line) {
	ib.logToConsole(line.Text())
}
開發者ID:kahoona77,項目名稱:emerald,代碼行數:3,代碼來源:ircBot.go


注:本文中的github.com/fluffle/goirc/client.Line.Text方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。