From 1806f87e401cc9b46df0d389077d84a019b59a96 Mon Sep 17 00:00:00 2001 From: David Haukeness Date: Tue, 31 Mar 2020 16:57:00 +0000 Subject: [PATCH] handleListCommand updated --- commands.go | 4 +++- handlers.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/commands.go b/commands.go index c8d8b40..5b263f8 100644 --- a/commands.go +++ b/commands.go @@ -126,7 +126,9 @@ func (b *bot) handleSetCommand(m chat1.MsgSummary) { } } -func (b *bot) listKValue(convid chat1.ConvIDStr, msgID chat1.MessageID, args []string) { +func (b *bot) handleListCommand(m chat1.MsgSummary) { + // first normalize the text and extract the arguments + args := strings.Fields(strings.ToLower(m.Content.Text.Body)) if args[0] != "list" { return } diff --git a/handlers.go b/handlers.go index 20ded34..d611d85 100644 --- a/handlers.go +++ b/handlers.go @@ -53,7 +53,7 @@ func (b *bot) chatHandler(m chat1.MsgSummary) { case "set": b.handleSetCommand(m) case "list": - b.listKValue(m.ConvID, m.Id, args) + b.handleListCommand(m) } } case "jitsi":