|
| 1 | +package botapi |
| 2 | + |
| 3 | +// This file defines the typed string enums of the Bot API surface. Each is a |
| 4 | +// distinct named type over string so callers cannot pass an arbitrary string |
| 5 | +// where an enum is expected, and the valid values are exported constants. |
| 6 | + |
| 7 | +// ParseMode is the formatting mode for message text and captions. |
| 8 | +// |
| 9 | +// See https://core.telegram.org/bots/api#formatting-options. |
| 10 | +type ParseMode string |
| 11 | + |
| 12 | +const ( |
| 13 | + // ParseModeNone sends text without any entity parsing. |
| 14 | + ParseModeNone ParseMode = "" |
| 15 | + // ParseModeHTML parses a subset of HTML tags. |
| 16 | + ParseModeHTML ParseMode = "HTML" |
| 17 | + // ParseModeMarkdownV2 parses MarkdownV2-style formatting. |
| 18 | + ParseModeMarkdownV2 ParseMode = "MarkdownV2" |
| 19 | + // ParseModeMarkdown is the legacy Markdown mode; prefer ParseModeMarkdownV2. |
| 20 | + ParseModeMarkdown ParseMode = "Markdown" |
| 21 | +) |
| 22 | + |
| 23 | +// ChatType is the kind of a chat. |
| 24 | +type ChatType string |
| 25 | + |
| 26 | +const ( |
| 27 | + ChatTypePrivate ChatType = "private" |
| 28 | + ChatTypeGroup ChatType = "group" |
| 29 | + ChatTypeSupergroup ChatType = "supergroup" |
| 30 | + ChatTypeChannel ChatType = "channel" |
| 31 | + // ChatTypeSender is used for inline queries sent from the inline mode of a |
| 32 | + // private chat with the bot. |
| 33 | + ChatTypeSender ChatType = "sender" |
| 34 | +) |
| 35 | + |
| 36 | +// ChatAction is a status reported to a chat via SendChatAction. |
| 37 | +type ChatAction string |
| 38 | + |
| 39 | +const ( |
| 40 | + ChatActionTyping ChatAction = "typing" |
| 41 | + ChatActionUploadPhoto ChatAction = "upload_photo" |
| 42 | + ChatActionRecordVideo ChatAction = "record_video" |
| 43 | + ChatActionUploadVideo ChatAction = "upload_video" |
| 44 | + ChatActionRecordVoice ChatAction = "record_voice" |
| 45 | + ChatActionUploadVoice ChatAction = "upload_voice" |
| 46 | + ChatActionUploadDocument ChatAction = "upload_document" |
| 47 | + ChatActionChooseSticker ChatAction = "choose_sticker" |
| 48 | + ChatActionFindLocation ChatAction = "find_location" |
| 49 | + ChatActionRecordVideoNote ChatAction = "record_video_note" |
| 50 | + ChatActionUploadVideoNote ChatAction = "upload_video_note" |
| 51 | +) |
| 52 | + |
| 53 | +// MessageEntityType is the kind of a MessageEntity. |
| 54 | +type MessageEntityType string |
| 55 | + |
| 56 | +const ( |
| 57 | + EntityMention MessageEntityType = "mention" |
| 58 | + EntityHashtag MessageEntityType = "hashtag" |
| 59 | + EntityCashtag MessageEntityType = "cashtag" |
| 60 | + EntityBotCommand MessageEntityType = "bot_command" |
| 61 | + EntityURL MessageEntityType = "url" |
| 62 | + EntityEmail MessageEntityType = "email" |
| 63 | + EntityPhoneNumber MessageEntityType = "phone_number" |
| 64 | + EntityBold MessageEntityType = "bold" |
| 65 | + EntityItalic MessageEntityType = "italic" |
| 66 | + EntityUnderline MessageEntityType = "underline" |
| 67 | + EntityStrikethrough MessageEntityType = "strikethrough" |
| 68 | + EntitySpoiler MessageEntityType = "spoiler" |
| 69 | + EntityBlockquote MessageEntityType = "blockquote" |
| 70 | + EntityExpandableBlockquote MessageEntityType = "expandable_blockquote" |
| 71 | + EntityCode MessageEntityType = "code" |
| 72 | + EntityPre MessageEntityType = "pre" |
| 73 | + EntityTextLink MessageEntityType = "text_link" |
| 74 | + EntityTextMention MessageEntityType = "text_mention" |
| 75 | + EntityCustomEmoji MessageEntityType = "custom_emoji" |
| 76 | +) |
| 77 | + |
| 78 | +// ChatMemberStatus is a member's status in a chat. |
| 79 | +type ChatMemberStatus string |
| 80 | + |
| 81 | +const ( |
| 82 | + StatusCreator ChatMemberStatus = "creator" |
| 83 | + StatusAdministrator ChatMemberStatus = "administrator" |
| 84 | + StatusMember ChatMemberStatus = "member" |
| 85 | + StatusRestricted ChatMemberStatus = "restricted" |
| 86 | + StatusLeft ChatMemberStatus = "left" |
| 87 | + StatusBanned ChatMemberStatus = "kicked" |
| 88 | +) |
| 89 | + |
| 90 | +// PollType is the kind of a poll. |
| 91 | +type PollType string |
| 92 | + |
| 93 | +const ( |
| 94 | + PollRegular PollType = "regular" |
| 95 | + PollQuiz PollType = "quiz" |
| 96 | +) |
| 97 | + |
| 98 | +// StickerType is the kind of a sticker (or sticker set). |
| 99 | +type StickerType string |
| 100 | + |
| 101 | +const ( |
| 102 | + StickerRegular StickerType = "regular" |
| 103 | + StickerMask StickerType = "mask" |
| 104 | + StickerCustomEmoji StickerType = "custom_emoji" |
| 105 | +) |
| 106 | + |
| 107 | +// MessageOriginType discriminates a MessageOrigin variant. |
| 108 | +type MessageOriginType string |
| 109 | + |
| 110 | +const ( |
| 111 | + OriginUser MessageOriginType = "user" |
| 112 | + OriginHiddenUser MessageOriginType = "hidden_user" |
| 113 | + OriginChat MessageOriginType = "chat" |
| 114 | + OriginChannel MessageOriginType = "channel" |
| 115 | +) |
| 116 | + |
| 117 | +// ReactionTypeKind discriminates a ReactionType variant. |
| 118 | +type ReactionTypeKind string |
| 119 | + |
| 120 | +const ( |
| 121 | + ReactionEmoji ReactionTypeKind = "emoji" |
| 122 | + ReactionCustomEmoji ReactionTypeKind = "custom_emoji" |
| 123 | + ReactionPaid ReactionTypeKind = "paid" |
| 124 | +) |
| 125 | + |
| 126 | +// MenuButtonType discriminates a MenuButton variant. |
| 127 | +type MenuButtonType string |
| 128 | + |
| 129 | +const ( |
| 130 | + MenuButtonCommandsType MenuButtonType = "commands" |
| 131 | + MenuButtonWebAppType MenuButtonType = "web_app" |
| 132 | + MenuButtonDefaultType MenuButtonType = "default" |
| 133 | +) |
| 134 | + |
| 135 | +// InputMediaType discriminates an InputMedia variant. |
| 136 | +type InputMediaType string |
| 137 | + |
| 138 | +const ( |
| 139 | + InputMediaPhotoType InputMediaType = "photo" |
| 140 | + InputMediaVideoType InputMediaType = "video" |
| 141 | + InputMediaAnimationType InputMediaType = "animation" |
| 142 | + InputMediaAudioType InputMediaType = "audio" |
| 143 | + InputMediaDocumentType InputMediaType = "document" |
| 144 | +) |
| 145 | + |
| 146 | +// DiceEmoji is the emoji on which a dice-style value is based. |
| 147 | +type DiceEmoji string |
| 148 | + |
| 149 | +const ( |
| 150 | + DiceDie DiceEmoji = "🎲" |
| 151 | + DiceDart DiceEmoji = "🎯" |
| 152 | + DiceBasketball DiceEmoji = "🏀" |
| 153 | + DiceFootball DiceEmoji = "⚽" |
| 154 | + DiceBowling DiceEmoji = "🎳" |
| 155 | + DiceSlot DiceEmoji = "🎰" |
| 156 | +) |
0 commit comments