/
ext_options.go
81 lines (65 loc) · 2.98 KB
/
ext_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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// ADDED BY DROP - https://github.com/matryer/drop (v0.7)
// source: github.com/tucnak/telebot (41796c460e2f38cfd32062dd27eed6d4ee40d7ba)
// update: drop -f github.com/tucnak/telebot
// license: The MIT License (MIT) (see repo for details)
package telebot
// ParseMode determines the way client applications treat the text of the message
type ParseMode string
// Supported ParseMode
const (
ModeDefault ParseMode = ""
ModeMarkdown ParseMode = "Markdown"
ModeHTML ParseMode = "HTML"
)
// SendOptions represents a set of custom options that could
// be appled to messages sent.
type SendOptions struct {
// If the message is a reply, original message.
ReplyTo Message
// See ReplyMarkup struct definition.
ReplyMarkup ReplyMarkup
// For text messages, disables previews for links in this message.
DisableWebPagePreview bool
// Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
DisableNotification bool
// ParseMode controls how client apps render your message.
ParseMode ParseMode
}
// ReplyMarkup specifies convenient options for bot-user communications.
type ReplyMarkup struct {
// ForceReply forces Telegram clients to display
// a reply interface to the user (act as if the user
// has selected the bot‘s message and tapped "Reply").
ForceReply bool `json:"force_reply,omitempty"`
// CustomKeyboard is Array of button rows, each represented by an Array of Strings.
//
// Note: you don't need to set HideCustomKeyboard field to show custom keyboard.
CustomKeyboard [][]SimpleKeyboardButton `json:"keyboard,omitempty"`
InlineKeyboard [][]KeyboardButton `json:"inline_keyboard,omitempty"`
// Requests clients to resize the keyboard vertically for optimal fit
// (e.g., make the keyboard smaller if there are just two rows of buttons).
// Defaults to false, in which case the custom keyboard is always of the
// same height as the app's standard keyboard.
ResizeKeyboard bool `json:"resize_keyboard,omitempty"`
// Requests clients to hide the keyboard as soon as it's been used. Defaults to false.
OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"`
// Requests clients to hide the custom keyboard.
//
// Note: You dont need to set CustomKeyboard field to hide custom keyboard.
HideCustomKeyboard bool `json:"hide_keyboard,omitempty"`
// Use this param if you want to force reply from
// specific users only.
//
// Targets:
// 1) Users that are @mentioned in the text of the Message object;
// 2) If the bot's message is a reply (has SendOptions.ReplyTo),
// sender of the original message.
Selective bool `json:"selective,omitempty"`
// Telegram clients will remove the current custom keyboard and display the default letter-keyboard
RemoveKeyboard bool `json:"remove_keyboard,omitempty"`
}
type SimpleKeyboardButton struct {
Text string `json:"text"`
RequestContact bool `json:"request_contact, omitempty"`
RequestLocation bool `json:"request_location, omitempty"`
}