1
0

commented code

This commit is contained in:
2022-05-07 11:03:14 +02:00
parent 6bbae4da79
commit e8d5293911
5 changed files with 24 additions and 5 deletions

View File

@ -17,6 +17,7 @@ func removeCharacters(input string, characters string) string {
}
// https://stackoverflow.com/questions/34839659/how-can-i-easily-get-a-substring-in-go-while-guarding-against-slice-bounds-out
// get a substring of size "max" from a string "s"
func maxString(s string, max int) string {
if len(s) > max {
r := 0
@ -45,6 +46,7 @@ func stripEmoji(msg string) string {
}
}
// sanitize received message for text-to-speech
func prepareTTSMessage(msg string) string {
t1 := maxString(msg, 300)
t2 := stripEmoji(t1)