From a94f1751ff17e0f0933b4b834cbbbf3ca6e95379 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 15 Aug 2020 16:24:25 -0700 Subject: [PATCH] disable old greeter --- cmd/swarm/main.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 31bf0f4..ae3dbb5 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -81,7 +81,7 @@ func handleIRCCon(c *irc.Client, m *irc.Message) { } else if text[len(text)-1] == "invite" { c.Write("INVITE " + victim + " " + channel) sent++ - } else if strings.Contains(m.Trailing(), "greetings") { + }/* else if strings.Contains(m.Trailing(), "greetings") { c.WriteMessage(&irc.Message{ Command: "PRIVMSG", Params: []string{ @@ -89,9 +89,18 @@ func handleIRCCon(c *irc.Client, m *irc.Message) { victim + ": hi", }, }) + }*/ + } else if m.Command == "JOIN" && c.FromChannel(m) { + if m.Prefix.Name != c.CurrentNick() { + c.WriteMessage(&irc.Message{ + Command: "PRIVMSG", + Params: []string{ + m.Params[0], + "greetings " + m.Prefix.Name, + }, + }) } } - } func main() {