commented code
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user