all repos — paprika @ e793cf577d4223e920af2930fa2aab09f0b874f7

go rewrite of taigabot

Trim leading and trailing spaces in message
Anirudh Oppiliappan x@icyphox.sh
Tue, 28 Dec 2021 21:24:11 +0530
commit

e793cf577d4223e920af2930fa2aab09f0b874f7

parent

eb2f22649405dd676a6c6c3cf1eedfa325fa8bef

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M main.gomain.go

@@ -13,8 +13,11 @@ "gopkg.in/irc.v3"

) func handleChatMessage(c *irc.Client, m *irc.Message) { + // Trim leading and trailing spaces to not trip up our + // plugins. + m.Params[1] = strings.TrimSpace(m.Params[1]) response, err := plugins.ProcessTrigger(m) - + if errors.Is(err, plugins.NoReply) { return }

@@ -24,7 +27,7 @@ if errors.Is(err, plugins.IsNotice) {

err = nil cmd = "NOTICE" } - msg := irc.Message {Command: cmd} + msg := irc.Message{Command: cmd} target := m.Params[0] split := strings.Split(response, "\n")