mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-26 16:39:24 +00:00
Remove empty newlines from messages (telegram) #399
This commit is contained in:
@ -88,3 +88,13 @@ func HandleDownloadData(flog *log.Entry, msg *config.Message, name, comment, url
|
||||
}
|
||||
msg.Extra["file"] = append(msg.Extra["file"], config.FileInfo{Name: name, Data: data, URL: url, Comment: comment, Avatar: avatar})
|
||||
}
|
||||
|
||||
func RemoveEmptyNewLines(msg string) string {
|
||||
lines := ""
|
||||
for _, line := range strings.Split(msg, "\n") {
|
||||
if line != "" {
|
||||
lines += line + "\n"
|
||||
}
|
||||
}
|
||||
return lines
|
||||
}
|
||||
|
Reference in New Issue
Block a user