projects
/
sylphiette-bot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a7b780
)
clean the text before conversation
author
Eduardo
<
[email protected]
>
Thu, 28 Mar 2024 19:38:11 +0000
(20:38 +0100)
committer
Eduardo
<
[email protected]
>
Thu, 28 Mar 2024 19:38:11 +0000
(20:38 +0100)
telegram.go
patch
|
blob
|
history
diff --git
a/telegram.go
b/telegram.go
index 4dc91080780f075543cd3a8c37fa0f8ed659b4d6..e4705d9f87fecebf1ffced32e226e6508eef3b37 100644
(file)
--- 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`)