handle code blocks in telegram.

This commit is contained in:
Dan Walmsley
2021-12-07 02:18:53 +00:00
parent 80d3033456
commit ccced05391

View File

@@ -451,5 +451,9 @@ func (b *Btelegram) handleEntities(rmsg *config.Message, message *tgbotapi.Messa
link := utf16.Decode(utfEncodedString[e.Offset : e.Offset+e.Length])
rmsg.Text = strings.Replace(rmsg.Text, string(link), url.String(), 1)
}
if e.Type == "code" {
rmsg.Text = "`" + rmsg.Text + "`"
}
}
}