-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtelegrambotTypes.go
341 lines (281 loc) · 12.1 KB
/
telegrambotTypes.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
package telegrambot
// Types which are not exactly specified in the official Bot API documentation
// Unique user identifier
type UserID ChatID
// Unique chat identifier
type ChatID int64
// Unique user specified string identifier
type Username string
// Literally ChatID or Username typed value
type ChatIDOrUsername interface {
chatIDOrUsername()
}
func (ChatID) chatIDOrUsername() {}
func (Username) chatIDOrUsername() {}
// Unique identifier for file, which is supposed to be the same over time and
// for different bots. Can't be used to download or reuse the file.
type FileUniqueID string
// A two-letter ISO 639-1 language code.
type LanguageCode string
const (
LanguageCodeRussian LanguageCode = "ru"
LanguageCodeEnglish LanguageCode = "en"
LanguageCodeBelarusian LanguageCode = "be"
LanguageCodeUkrainian LanguageCode = "uk"
LanguageCodeKorean LanguageCode = "ko"
LanguageCodeCatalan LanguageCode = "ca"
LanguageCodeDutch LanguageCode = "nl"
LanguageCodeFrench LanguageCode = "fr"
LanguageCodeGerman LanguageCode = "de"
LanguageCodeItalian LanguageCode = "it"
LanguageCodeMalay LanguageCode = "ms"
LanguageCodePolish LanguageCode = "pl"
LanguageCodePortuguese LanguageCode = "pt"
LanguageCodeSpanish LanguageCode = "es"
LanguageCodeTurkish LanguageCode = "tr"
)
// Type of the chat. Can be either “sender” for a private chat with the inline
// query sender, “private”, “group”, “supergroup”, or “channel”.
type ChatType string
const (
ChatTypePrivate ChatType = "private"
ChatTypeGroup ChatType = "group"
ChatTypeSupergroup ChatType = "supergroup"
ChatTypeChannel ChatType = "channel"
)
// Unique message identifier inside chat
type MessageID int
// Type of the entity.
type MessageEntityType string
const (
// @username
MessageEntityTypeMention MessageEntityType = "mention"
// #hashtag
MessageEntityTypeHashtag MessageEntityType = "hashtag"
// $USD
MessageEntityTypeCashtag MessageEntityType = "cashtag"
// /start@jobs_bot
MessageEntityTypeBotCommand MessageEntityType = "bot_command"
// https://telegram.org
MessageEntityTypeURL MessageEntityType = "url"
MessageEntityTypeEmail MessageEntityType = "email"
// +1-212-555-0123
MessageEntityTypePhoneNumber MessageEntityType = "phone_number"
// bold text
MessageEntityTypeBold MessageEntityType = "bold"
// italic text
MessageEntityTypeItalic MessageEntityType = "italic"
// underlined text
MessageEntityTypeUnderline MessageEntityType = "underline"
// strikethrough text
MessageEntityTypeStrikethrough MessageEntityType = "strikethrough"
// spoiler message
MessageEntityTypeSpoiler MessageEntityType = "spoiler"
// monowidth string
MessageEntityTypeCode MessageEntityType = "code"
// monowidth block
MessageEntityTypePre MessageEntityType = "pre"
// for clickable text URLs
MessageEntityTypeTextLink MessageEntityType = "text_link"
// for users without usernames https://telegram.org/blog/edit#new-mentions
MessageEntityTypeTextMention MessageEntityType = "text_mention"
// for inline custom emoji stickers
MessageEntityTypeCustomEmoji MessageEntityType = "custom_emoji"
)
// Short name of a Game, serves as the unique identifier for the game
// https://core.telegram.org/bots/api#games
type GameShortName string
// Unique poll identifier
type PollID string
// Poll type, currently can be “regular” or “quiz”
type PollType string
const (
PollTypeRegular PollType = "regular"
PollTypeQuiz PollType = "quiz"
)
// Unique identifier for callback query
type CallbackQueryID string
// Global identifier, uniquely corresponding to the chat to which a message with
// the callback button was sent. Useful for high scores in games.
// https://core.telegram.org/bots/api#games
type ChatInstance string
// The member's status in a chat
type ChatMemberStatus string
const (
ChatMemberStatusCreator ChatMemberStatus = "creator"
ChatMemberStatusAdministrator ChatMemberStatus = "administrator"
ChatMemberStatusMember ChatMemberStatus = "member"
ChatMemberStatusRestricted ChatMemberStatus = "restricted"
ChatMemberStatusLeft ChatMemberStatus = "left"
ChatMemberStatusKicked ChatMemberStatus = "kicked"
)
type BotCommandScopeType string
const (
BotCommandScopeTypeDefault BotCommandScopeType = "default"
BotCommandScopeTypeAllPrivateChats BotCommandScopeType = "all_private_chats"
BotCommandScopeTypeAllGroupChats BotCommandScopeType = "all_group_chats"
BotCommandScopeTypeAllChatAdministrators BotCommandScopeType = "all_chat_administrators"
BotCommandScopeTypeChat BotCommandScopeType = "chat"
BotCommandScopeTypeChatAdministrator BotCommandScopeType = "chat_administrators"
BotCommandScopeTypeChatMember BotCommandScopeType = "chat_member"
)
// https://core.telegram.org/bots/api#formatting-options
type ParseMode string
const (
// https://core.telegram.org/bots/api#markdownv2-style
ParseModeMarkdownV2 ParseMode = "MarkdownV2"
// https://core.telegram.org/bots/api#html-style
ParseModeHTML ParseMode = "HTML"
// https://core.telegram.org/bots/api#markdown-style
ParseModeMarkdown ParseMode = "Markdown"
)
type InputMediaType string
const (
InputMediaTypePhoto InputMediaType = "photo"
InputMediaTypeVideo InputMediaType = "video"
InputMediaTypeAnimation InputMediaType = "animation"
InputMediaTypeAudio InputMediaType = "audio"
InputMediaTypeDocument InputMediaType = "document"
)
type StickerSetName string
type MaskPositionPoint string
const (
MaskPositionPointForehead MaskPositionPoint = "forehead"
MaskPositionPointEyes MaskPositionPoint = "eyes"
MaskPositionPointMouth MaskPositionPoint = "mouth"
MaskPositionPointChin MaskPositionPoint = "chin"
)
// Unique identifier for an inline query
type InlineQueryID string
type InlineQueryChatType ChatType
const (
InlineQueryChatTypeSender InlineQueryChatType = "sender"
InlineQueryChatTypePrivate InlineQueryChatType = InlineQueryChatType(ChatTypePrivate)
InlineQueryChatTypeGroup InlineQueryChatType = InlineQueryChatType(ChatTypeGroup)
InlineQueryChatTypeSupergroup InlineQueryChatType = InlineQueryChatType(ChatTypeSupergroup)
InlineQueryChatTypeChannel InlineQueryChatType = InlineQueryChatType(ChatTypeChannel)
)
// Type of an inline query result
type InlineQueryResultType string
const (
InlineQueryResultTypeArticle InlineQueryResultType = "article"
InlineQueryResultTypePhoto InlineQueryResultType = "photo"
InlineQueryResultTypeGif InlineQueryResultType = "gif"
InlineQueryResultTypeMpeg4Gif InlineQueryResultType = "mpeg4_gif"
InlineQueryResultTypeVideo InlineQueryResultType = "video"
InlineQueryResultTypeAudio InlineQueryResultType = "audio"
InlineQueryResultTypeVoice InlineQueryResultType = "voice"
InlineQueryResultTypeDocument InlineQueryResultType = "document"
InlineQueryResultTypeLocation InlineQueryResultType = "location"
InlineQueryResultTypeVenue InlineQueryResultType = "venue"
InlineQueryResultTypeContact InlineQueryResultType = "contact"
InlineQueryResultTypeGame InlineQueryResultType = "game"
InlineQueryResultTypeSticker InlineQueryResultType = "sticker"
)
type InlineQueryResultID string
type UpdateID int
type UpdateType string
const (
UpdateTypeMessage UpdateType = "message"
UpdateTypeEditedMessage UpdateType = "edited_message"
UpdateTypeChannelPost UpdateType = "channel_post"
UpdateTypeEditedChannelPost UpdateType = "edited_channel_post"
UpdateTypeInlineQuery UpdateType = "inline_query"
UpdateTypeChosenInlineResult UpdateType = "chosen_inline_result"
UpdateTypeCallbackQuery UpdateType = "callback_query"
UpdateTypeShippingQuery UpdateType = "shipping_query"
UpdateTypePreCheckoutQuery UpdateType = "pre_checkout_query"
UpdateTypePoll UpdateType = "poll"
UpdateTypePollAnswer UpdateType = "poll_answer"
UpdateTypeMyChatMember UpdateType = "my_chat_member"
UpdateTypeChatMember UpdateType = "chat_member"
UpdateTypeChatJoinRequest UpdateType = "chat_join_request"
)
type InlineMessageID string
type ShippingOptionID string
type ShippingQueryID string
type PreCheckoutQueryID string
type PassportElementType string
const (
PassportElementTypePersonalDetails PassportElementType = "personal_details"
PassportElementTypePassport PassportElementType = "passport"
PassportElementTypeDriverLicense PassportElementType = "driver_license"
PassportElementTypeIdentityCard PassportElementType = "identity_card"
PassportElementTypeInternalPassport PassportElementType = "internal_passport"
PassportElementTypeAddress PassportElementType = "address"
PassportElementTypeUtilityBill PassportElementType = "utility_bill"
PassportElementTypeBankStatement PassportElementType = "bank_statement"
PassportElementTypeRentalAgreement PassportElementType = "rental_agreement"
PassportElementTypePassportRegistration PassportElementType = "passport_registration"
PassportElementTypeTemporaryRegistration PassportElementType = "temporary_registration"
PassportElementTypePhoneNumber PassportElementType = "phone_number"
PassportElementTypeEmail PassportElementType = "email"
)
type PassportElementErrorSource string
const (
PassportElementErrorSourceData PassportElementErrorSource = "data"
PassportElementErrorSourceFrontSide PassportElementErrorSource = "front_side"
PassportElementErrorSourceReverseSide PassportElementErrorSource = "reverse_side"
PassportElementErrorSourceSelfie PassportElementErrorSource = "selfie"
PassportElementErrorSourceFile PassportElementErrorSource = "file"
PassportElementErrorSourceFiles PassportElementErrorSource = "files"
PassportElementErrorSourceTranslationFile PassportElementErrorSource = "translation_file"
PassportElementErrorSourceTranslationFiles PassportElementErrorSource = "translation_files"
PassportElementErrorSourceUnspecified PassportElementErrorSource = "unspecified"
)
type ReplyMarkup interface {
replyMarkup()
}
func (*InlineKeyboardMarkup) replyMarkup() {}
func (*ReplyKeyboardMarkup) replyMarkup() {}
func (*ReplyKeyboardRemove) replyMarkup() {}
func (*ForceReply) replyMarkup() {}
type DiceEmoji string
const (
DiceEmojiGameDie DiceEmoji = "🎲"
DiceEmojiBullseye DiceEmoji = "🎯"
DiceEmojiBasketball DiceEmoji = "🏀"
DiceEmojiSoccerBall DiceEmoji = "⚽"
DiceEmojiBowling DiceEmoji = "🎳"
DiceEmojiSlotMachine DiceEmoji = "🎰"
)
type ChatAction string
const (
// https://core.telegram.org/bots/api#sendmessage
ChatActionTyping ChatAction = "typing"
// https://core.telegram.org/bots/api#sendphoto
ChatActionUploadPhoto ChatAction = "upload_photo"
// https://core.telegram.org/bots/api#sendvideo
ChatActionRecordVideo ChatAction = "record_video"
// https://core.telegram.org/bots/api#sendvideo
ChatActionUploadVideo ChatAction = "upload_video"
// https://core.telegram.org/bots/api#sendvoice
ChatActionRecordVoice ChatAction = "record_voice"
// https://core.telegram.org/bots/api#sendvoice
ChatActionUploadVoice ChatAction = "upload_voice"
// https://core.telegram.org/bots/api#senddocument
ChatActionUploadDocument ChatAction = "upload_document"
// https://core.telegram.org/bots/api#sendsticker
ChatActionChooseSticker ChatAction = "choose_sticker"
// https://core.telegram.org/bots/api#sendlocation
ChatActionFindLocation ChatAction = "find_location"
// https://core.telegram.org/bots/api#sendvideonote
ChatActionRecordVideoNote ChatAction = "record_video_note"
// https://core.telegram.org/bots/api#sendvideonote
ChatActionUploadVideoNote ChatAction = "upload_video_note"
)
type WebAppQueryID string
type MenuButtonType string
const (
MenuButtonTypeCommands MenuButtonType = "commands"
MenuButtonTypeWebApp MenuButtonType = "web_app"
MenuButtonTypeDefault MenuButtonType = "default"
)
type CustomEmojiID string
type StickerType string
const (
StickerTypeRegular StickerType = "regular"
StickerTypeMask StickerType = "mask"
StickerTypeCustomEmoji StickerType = "custom_emoji"
)