From 0279e6bd35779f094e004de65f159e6da7d059fd Mon Sep 17 00:00:00 2001 From: Hamcha Date: Sun, 27 Mar 2022 22:53:50 +0200 Subject: [PATCH] Command parsing fixes --- modules/proverbio/mod.go | 2 +- utils/command.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/proverbio/mod.go b/modules/proverbio/mod.go index ac2bfe0..becc147 100644 --- a/modules/proverbio/mod.go +++ b/modules/proverbio/mod.go @@ -51,7 +51,7 @@ func (m *Module) OnUpdate(update tg.APIUpdate) { return } - if utils.IsCommand(*update.Message, m.name, "metafora") { + if utils.IsCommand(*update.Message, m.name, "proverbio") { start := rand.Intn(len(proverbipairs.start)) end := rand.Intn(len(proverbipairs.end)) m.client.SendTextMessage(tg.ClientTextMessageData{ diff --git a/utils/command.go b/utils/command.go index 866fb1b..1c18521 100644 --- a/utils/command.go +++ b/utils/command.go @@ -22,7 +22,7 @@ func IsCommand(update tg.APIMessage, botname string, cmdname string) bool { } // Check long form - if text == shortcmd || strings.HasPrefix(text, fullcmd+" ") { + if text == fullcmd || strings.HasPrefix(text, fullcmd+" ") { return true }