From 6e30eab40b911e7abc168f1380465e599395587e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 29 Jul 2015 19:27:37 +0200 Subject: Replace Privmsg with Notice --- blame.go | 2 +- duck.go | 4 ++-- help.go | 2 +- href.go | 2 +- last.go | 2 +- rfc.go | 6 +++--- rss.go | 2 +- theo.go | 2 +- top.go | 2 +- urban.go | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/blame.go b/blame.go index 6085459..20fc560 100644 --- a/blame.go +++ b/blame.go @@ -12,7 +12,7 @@ func (_ Blame) Handle(conn *irc.Conn, line *irc.Line) { "Install: go get dim13.org/bot", } for _, s := range src { - conn.Privmsg(line.Target(), s) + conn.Notice(line.Target(), s) } } diff --git a/duck.go b/duck.go index 83e4440..2801125 100644 --- a/duck.go +++ b/duck.go @@ -14,9 +14,9 @@ func (_ Duck) WithArgs(_ int) bool { return true } func (_ Duck) Handle(conn *irc.Conn, line *irc.Line) { if q := strings.SplitN(line.Text(), " ", 2); len(q) == 2 { if a, err := duck.Abstract(q[1]); err != nil { - conn.Privmsg(line.Target(), err.Error()) + conn.Notice(line.Target(), err.Error()) } else { - conn.Privmsg(line.Target(), a) + conn.Notice(line.Target(), a) } } } diff --git a/help.go b/help.go index 22fa60e..c505d45 100644 --- a/help.go +++ b/help.go @@ -16,7 +16,7 @@ func (_ Help) Handle(conn *irc.Conn, line *irc.Line) { } sort.Sort(sort.StringSlice(msg)) for _, s := range msg { - conn.Privmsg(line.Nick, s) + conn.Notice(line.Nick, s) } } diff --git a/href.go b/href.go index 976d7fb..bb01191 100644 --- a/href.go +++ b/href.go @@ -82,7 +82,7 @@ func ExtractLinks(conn *irc.Conn, line *irc.Line) { log.Println(err) } if t != "" { - conn.Privmsg(line.Target(), "Title: "+t) + conn.Notice(line.Target(), t) } }(v) } diff --git a/last.go b/last.go index d2d1d8d..ff63bb0 100644 --- a/last.go +++ b/last.go @@ -19,7 +19,7 @@ func (_ Last) Handle(conn *irc.Conn, line *irc.Line) { s := fmt.Sprintf("%v (UTC) <%v> %v", l.Time.UTC().Format("15:04"), l.Nick, l.Text()) - conn.Privmsg(line.Nick, s) + conn.Notice(line.Nick, s) } }) } diff --git a/rfc.go b/rfc.go index b76b789..b083216 100644 --- a/rfc.go +++ b/rfc.go @@ -23,9 +23,9 @@ func (_ RFC) Handle(conn *irc.Conn, line *irc.Line) { kw := strings.ToLower(f[1]) if e, ok := rfcKW[kw]; ok { s := strings.Join(e, ", ") - conn.Privmsg(line.Target(), s) + conn.Notice(line.Target(), s) } else { - conn.Privmsg(line.Target(), "no matches") + conn.Notice(line.Target(), "no matches") } } } @@ -37,7 +37,7 @@ func ExtractRFC(conn *irc.Conn, line *irc.Line) { if _, err := fmt.Sscanf(w, "RFC%d", &id); err == nil { if entry, ok := rfcMap[id]; ok { s := fmt.Sprint(entry) - conn.Privmsg(line.Target(), s) + conn.Notice(line.Target(), s) } } } diff --git a/rss.go b/rss.go index 9247598..0e089cf 100644 --- a/rss.go +++ b/rss.go @@ -31,7 +31,7 @@ func ShowNews(conn *irc.Conn, _ *irc.Line) { n := <-news s := fmt.Sprintf("%v: %v - %v", n.Source, n.Item.Title, n.Item.Link) - conn.Privmsg(*room, s) + conn.Notice(*room, s) } } diff --git a/theo.go b/theo.go index fe246d7..2da46e2 100644 --- a/theo.go +++ b/theo.go @@ -8,7 +8,7 @@ import ( type Theo struct{ Command } func (_ Theo) Handle(conn *irc.Conn, line *irc.Line) { - conn.Privmsg(line.Target(), theo.Theo()) + conn.Notice(line.Target(), theo.Theo()) } func init() { diff --git a/top.go b/top.go index 10a557f..80c40d9 100644 --- a/top.go +++ b/top.go @@ -14,7 +14,7 @@ func (_ Top) Handle(conn *irc.Conn, line *irc.Line) { n = 10 } s := fmt.Sprint(NewScores(n)) - conn.Privmsg(line.Target(), s) + conn.Notice(line.Target(), s) } func init() { diff --git a/urban.go b/urban.go index cf17a2e..0886863 100644 --- a/urban.go +++ b/urban.go @@ -15,10 +15,10 @@ func (_ Urban) WithArgs(_ int) bool { return true } func (_ Urban) Handle(conn *irc.Conn, line *irc.Line) { if q := strings.SplitN(line.Text(), " ", 2); len(q) == 2 { if u, err := urban.QueryTop(q[1]); err != nil { - conn.Privmsg(line.Target(), err.Error()) + conn.Notice(line.Target(), err.Error()) } else { s := fmt.Sprintf("%v: %v", u.Word, u.Definition) - conn.Privmsg(line.Target(), s) + conn.Notice(line.Target(), s) } } } -- cgit v1.2.3