clean the text before conversation
authorEduardo <[email protected]>
Thu, 28 Mar 2024 19:38:11 +0000 (20:38 +0100)
committerEduardo <[email protected]>
Thu, 28 Mar 2024 19:38:11 +0000 (20:38 +0100)
telegram.go

index 4dc91080780f075543cd3a8c37fa0f8ed659b4d6..e4705d9f87fecebf1ffced32e226e6508eef3b37 100644 (file)
@@ -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`)