From: Eduardo Date: Thu, 28 Mar 2024 19:38:11 +0000 (+0100) Subject: clean the text before conversation X-Git-Url: http://git.edufdez.es/?a=commitdiff_plain;h=7626d1e51bded04c0e61e64e02912d52178793bf;p=sylphiette-bot.git clean the text before conversation --- diff --git a/telegram.go b/telegram.go index 4dc9108..e4705d9 100644 --- a/telegram.go +++ b/telegram.go @@ -128,6 +128,12 @@ func handleCommand(chatId int64, command string) error { func handleConversation(chatId int64, text string) error { var err error + + // Clean up the text + text = removeCommand(text) + text = normaliceString(text) + text = removePunctuation(text) + text = trimMultipleSpaces(text) text = strings.ToLower(text) var regexIssue = regexp.MustCompile(`(?i)\bIssue\b`)