-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathformatting_options.go
64 lines (55 loc) · 2.15 KB
/
formatting_options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package telebot
import "fmt"
type ParseMode string
const (
ParseModeDefault ParseMode = ""
ParseModeMarkdown ParseMode = "Markdown"
ParseModeMarkdownV2 ParseMode = "MarkdownV2"
ParseModeHTML ParseMode = "HTML"
)
type EntityType string
const (
EntityTypeMention EntityType = "mention"
EntityTypeHashtag EntityType = "hashtag"
EntityTypeCashTag EntityType = "cashtag"
EntityTypeBotCommand EntityType = "bot_command"
EntityTypeURL EntityType = "url"
EntityTypeEmail EntityType = "email"
EntityTypePhoneNumber EntityType = "phone_number"
EntityTypeBold EntityType = "bold"
EntityTypeItalic EntityType = "italic"
EntityTypeUnderline EntityType = "underline"
EntityTypeStrikethrough EntityType = "strikethrough"
EntityTypeSpoiler EntityType = "spoiler"
EntityTypeBlockquote EntityType = "blockquote"
EntityTypeCode EntityType = "code"
EntityTypePre EntityType = "pre"
EntityTypeTextLink EntityType = "text_link"
EntityTypeTextMention EntityType = "text_mention"
EntityTypeCustomEmoji EntityType = "custom_emoji"
)
type Entity struct {
EntityType EntityType `json:"type"`
Offset int `json:"offset"`
Length int `json:"length"`
URL string `json:"url,omitempty"`
User *User `json:"user,omitempty"`
Language *string `json:"language,omitempty"`
CustomEmojiID *CustomEmoji `json:"custom_emoji_id,omitempty"`
}
func (c *Entity) ReflectType() string { return fmt.Sprintf("%T", c) }
func (c *Entity) Type() string {
if c.EntityType == "" {
return "unknown"
}
return string(c.EntityType)
}
type LinkPreviewOptions struct {
IsDisabled *bool `json:"is_disabled,omitempty"`
URL *string `json:"url,omitempty"`
PreferSmallMedia *bool `json:"prefer_small_media,omitempty"`
PreferLargeMedia *bool `json:"prefer_large_media,omitempty"`
ShowAboveText *bool `json:"show_above_text,omitempty"`
}
func (c *LinkPreviewOptions) ReflectType() string { return fmt.Sprintf("%T", c) }
func (c *LinkPreviewOptions) Type() string { return "LinkPreviewOptions" }