本文整理匯總了Golang中github.com/fluffle/goirc/client.Conn.Topic方法的典型用法代碼示例。如果您正苦於以下問題:Golang Conn.Topic方法的具體用法?Golang Conn.Topic怎麽用?Golang Conn.Topic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/fluffle/goirc/client.Conn
的用法示例。
在下文中一共展示了Conn.Topic方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: topic
func topic(conn *irc.Conn, nick *irc.Nick, args, target string) {
channel, args := parseAccess(conn, nick, target, args, "t")
if channel == "" {
return
}
section := conn.Network + " " + channel
if args != "" {
updateConf(section, "basetopic", args)
conn.Topic(channel, args)
} else {
basetopic, _ := conf.String(section, "basetopic")
say(conn, nick.Nick, "Basetopic: %s", basetopic)
}
}
示例2: setTopic
func setTopic(conn *irc.Conn, channel string) {
defer func() {
if r := recover(); r != nil {
log.Printf("most likely coding error: %v", r)
}
}()
topic := conn.StateTracker().GetChannel(channel).Topic
newtopic := insertNextEvent(topic)
newtopic = advanceDates(newtopic)
if topic == newtopic {
return
}
log.Printf("%s OLD TOPIC: %s", channel, topic)
log.Printf("%s NEW TOPIC: %s", channel, newtopic)
conn.Topic(channel, newtopic)
}
示例3: appendtopic
func appendtopic(conn *irc.Conn, nick *irc.Nick, args, target string) {
channel, args := parseAccess(conn, nick, target, args, "t")
if channel == "" {
return
}
c := conn.GetChannel(channel)
if c == nil {
say(conn, target, "Error while getting channel information for %s", channel)
return
}
section := conn.Network + " " + channel
basetopic, _ := conf.String(section, "basetopic")
if basetopic == "" || !strings.HasPrefix(strings.TrimLeft(c.Topic, " "), basetopic) {
basetopic = c.Topic
say(conn, nick.Nick, "New basetopic: %s", basetopic)
updateConf(section, "basetopic", basetopic)
}
conn.Topic(channel, basetopic+args)
}