From 3b8ee25e5d5cfdb7920e5bfb7ff99a35c5b26345 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 6 Jul 2019 17:35:43 +0200 Subject: split more --- notify.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 notify.go (limited to 'notify.go') diff --git a/notify.go b/notify.go new file mode 100644 index 0000000..9234e20 --- /dev/null +++ b/notify.go @@ -0,0 +1,23 @@ +package main + +import ( + "log" + + irc "github.com/fluffle/goirc/client" +) + +type notify struct { + conn *irc.Conn + target string +} + +func newNotify(conn *irc.Conn, target string) *notify { + return ¬ify{conn: conn, target: target} +} + +func (n *notify) Write(p []byte) (int, error) { + s := limitString(p) + log.Println("send", s) + n.conn.Notice(n.target, s.String()) + return len(p), nil +} -- cgit v1.2.3