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() {