]> git.giacomolli.uk - onechat/blobdiff - botapi.go
Convert reply Markdown to Telegram entities
[onechat] / botapi.go
index d02aff04b539507225a0ab858822abb98fd38adf..57bf9dba8111e163f99bda5a78470dafd594016e 100644 (file)
--- a/botapi.go
+++ b/botapi.go
@@ -87,6 +87,17 @@ type botChat struct {
        Type string `json:"type"`
 }
 
        Type string `json:"type"`
 }
 
+// botEntity is a message entity of sendMessage: a part of the text with a
+// format, such as bold or a link. Offset and Length count UTF-16 code units.
+// URL is the target of a text_link, and Language the language of a pre.
+type botEntity struct {
+       Type     string `json:"type"`
+       Offset   int    `json:"offset"`
+       Length   int    `json:"length"`
+       URL      string `json:"url,omitempty"`
+       Language string `json:"language,omitempty"`
+}
+
 // botUser is the sender of a message.
 type botUser struct {
        ID int64 `json:"id"`
 // botUser is the sender of a message.
 type botUser struct {
        ID int64 `json:"id"`