1
0
Fork 0
telegram/const.go

252 lines
11 KiB
Go
Raw Permalink Normal View History

package telegram
2018-04-19 13:02:15 +00:00
// Version represents current version of Telegram API supported by this package
2021-08-01 15:54:20 +00:00
const Version string = "5.3.0"
2018-04-19 13:02:15 +00:00
2018-10-12 09:37:59 +00:00
// Action represents available and supported status actions of bot
const (
2019-07-30 11:34:28 +00:00
ActionFindLocation string = "find_location"
2021-08-01 15:15:51 +00:00
ActionRecordVoice string = "record_voice"
2019-07-30 11:34:28 +00:00
ActionRecordVideo string = "record_video"
ActionRecordVideoNote string = "record_video_note"
ActionTyping string = "typing"
2021-08-01 15:15:51 +00:00
ActionUploadVoice string = "upload_voice"
2019-07-30 11:34:28 +00:00
ActionUploadDocument string = "upload_document"
ActionUploadPhoto string = "upload_photo"
ActionUploadVideo string = "upload_video"
ActionUploadVideoNote string = "upload_video_note"
)
2018-10-12 09:37:59 +00:00
// Chat represents available and supported chat types
const (
2019-07-30 11:34:28 +00:00
ChatChannel string = "channel"
ChatGroup string = "group"
ChatPrivate string = "private"
ChatSuperGroup string = "supergroup"
)
2020-11-05 08:28:32 +00:00
// Command represents global commands which should be supported by any bot. You can user IsCommandEqual method of
// Message for checking.
2018-06-20 13:40:07 +00:00
//
// See: https://core.telegram.org/bots#global-commands
const (
2019-07-30 11:34:28 +00:00
CommandHelp string = "help"
CommandSettings string = "settings"
2020-01-09 15:27:00 +00:00
CommandStart string = "start"
2018-06-20 13:40:07 +00:00
)
2018-10-12 09:37:59 +00:00
// Entity represents available and supported entity types
const (
2020-01-06 21:41:22 +00:00
EntityBold string = "bold"
EntityBotCommand string = "bot_command"
EntityCashtag string = "cashtag"
EntityCode string = "code"
EntityEmail string = "email"
EntityHashtag string = "hashtag"
EntityItalic string = "italic"
EntityMention string = "mention"
EntityPhoneNumber string = "phone_number"
EntityPre string = "pre"
EntityStrikethrough string = "strikethrough"
EntityTextLink string = "text_link"
EntityTextMention string = "text_mention"
EntityUnderline string = "underline"
EntityURL string = "url"
)
2018-10-12 09:37:59 +00:00
// Method represents available and supported Telegram API methods
const (
2020-01-06 21:41:22 +00:00
MethodAddStickerToSet string = "addStickerToSet"
MethodAnswerCallbackQuery string = "answerCallbackQuery"
MethodAnswerInlineQuery string = "answerInlineQuery"
MethodAnswerPreCheckoutQuery string = "answerPreCheckoutQuery"
MethodAnswerShippingQuery string = "answerShippingQuery"
2021-08-01 15:54:20 +00:00
MethodBanChatMember string = "banChatMember"
2020-11-05 08:28:32 +00:00
MethodClose string = "close"
MethodCopyMessage string = "copyMessage"
2021-03-09 14:15:28 +00:00
MethodCreateChatInviteLink string = "createChatInviteLink"
2020-01-06 21:41:22 +00:00
MethodCreateNewStickerSet string = "createNewStickerSet"
MethodDeleteChatPhoto string = "deleteChatPhoto"
MethodDeleteChatStickerSet string = "deleteChatStickerSet"
MethodDeleteMessage string = "deleteMessage"
2021-08-01 15:54:20 +00:00
MethodDeleteMyCommands string = "deleteMyCommands"
2020-01-06 21:41:22 +00:00
MethodDeleteStickerFromSet string = "deleteStickerFromSet"
MethodDeleteWebhook string = "deleteWebhook"
2021-03-09 14:15:28 +00:00
MethodEditChatInviteLink string = "editChatInviteLink"
2020-01-06 21:41:22 +00:00
MethodEditMessageCaption string = "editMessageCaption"
MethodEditMessageLiveLocation string = "editMessageLiveLocation"
MethodEditMessageMedia string = "editMessageMedia"
MethodEditMessageReplyMarkup string = "editMessageReplyMarkup"
MethodEditMessageText string = "editMessageText"
MethodExportChatInviteLink string = "exportChatInviteLink"
MethodForwardMessage string = "forwardMessage"
MethodGetChat string = "getChat"
MethodGetChatAdministrators string = "getChatAdministrators"
MethodGetChatMember string = "getChatMember"
2021-08-01 15:54:20 +00:00
MethodGetChatMemberCount string = "getChatMemberCount"
2020-01-06 21:41:22 +00:00
MethodGetFile string = "getFile"
MethodGetGameHighScores string = "getGameHighScores"
MethodGetMe string = "getMe"
MethodGetMyCommands string = "getMyCommands"
2020-01-06 21:41:22 +00:00
MethodGetStickerSet string = "getStickerSet"
MethodGetUpdates string = "getUpdates"
MethodGetUserProfilePhotos string = "getUserProfilePhotos"
MethodGetWebhookInfo string = "getWebhookInfo"
MethodLeaveChat string = "leaveChat"
2020-11-05 08:28:32 +00:00
MethodLogOut string = "logOut"
2020-01-06 21:41:22 +00:00
MethodPinChatMessage string = "pinChatMessage"
MethodPromoteChatMember string = "promoteChatMember"
MethodRestrictChatMember string = "restrictChatMember"
2021-03-09 14:15:28 +00:00
MethodRevokeChatInviteLink string = "revokeChatInviteLink"
2020-01-06 21:41:22 +00:00
MethodSendAnimation string = "sendAnimation"
MethodSendAudio string = "sendAudio"
MethodSendChatAction string = "sendChatAction"
MethodSendContact string = "sendContact"
MethodSendDice string = "sendDice"
2020-01-06 21:41:22 +00:00
MethodSendDocument string = "sendDocument"
MethodSendGame string = "sendGame"
MethodSendInvoice string = "sendInvoice"
MethodSendLocation string = "sendLocation"
MethodSendMediaGroup string = "sendMediaGroup"
MethodSendMessage string = "sendMessage"
MethodSendPhoto string = "sendPhoto"
MethodSendPoll string = "sendPoll"
MethodSendSticker string = "sendSticker"
MethodSendVenue string = "sendVenue"
MethodSendVideo string = "sendVideo"
MethodSendVideoNote string = "sendVideoNote"
MethodSendVoice string = "sendVoice"
MethodSetChatAdministratorCustomTitle string = "setChatAdministratorCustomTitle"
MethodSetChatDescription string = "setChatDescription"
MethodSetChatPermissions string = "setChatPermissions"
MethodSetChatPhoto string = "setChatPhoto"
MethodSetChatStickerSet string = "setChatStickerSet"
MethodSetChatTitle string = "setChatTitle"
MethodSetGameScore string = "setGameScore"
MethodSetMyCommands string = "setMyCommands"
2020-01-06 21:41:22 +00:00
MethodSetPassportDataErrors string = "setPassportDataErrors"
MethodSetStickerPositionInSet string = "setStickerPositionInSet"
MethodSetStickerSetThumb string = "setStickerSetThumb"
2020-01-06 21:41:22 +00:00
MethodSetWebhook string = "setWebhook"
MethodStopMessageLiveLocation string = "stopMessageLiveLocation"
MethodStopPoll string = "stopPoll"
MethodUnbanChatMember string = "unbanChatMember"
2020-11-05 08:28:32 +00:00
MethodUnpinAllChatMessages string = "unpinAllChatMessages"
2020-01-06 21:41:22 +00:00
MethodUnpinChatMessage string = "unpinChatMessage"
MethodUploadStickerFile string = "uploadStickerFile"
)
2018-10-12 09:37:59 +00:00
// Mode represents available and supported parsing modes of messages
const (
2020-01-06 21:41:22 +00:00
ParseModeHTML string = "HTML"
ParseModeMarkdown string = "Markdown"
ParseModeMarkdownV2 string = "MarkdownV2"
)
2020-05-08 16:30:36 +00:00
// Point represent a type of point on face
2020-01-09 15:27:00 +00:00
const (
PointForehead string = "forehead"
PointEyes string = "eyes"
PointMouth string = "mouth"
PointChin string = "chin"
)
2018-10-12 09:37:59 +00:00
// Mime represents available and supported MIME types of data
const (
2020-06-05 11:10:51 +00:00
MimeGIF string = "image/gif"
2019-07-30 11:34:28 +00:00
MimeHTML string = "text/html"
2020-06-05 11:10:51 +00:00
MimeJPEG string = "image/jpeg"
2019-07-30 11:34:28 +00:00
MimeMP4 string = "video/mp4"
MimePDF string = "application/pdf"
MimeZIP string = "application/zip"
)
2018-10-12 09:37:59 +00:00
// Scheme represents optional schemes for URLs
const (
2019-07-30 11:34:28 +00:00
SchemeAttach string = "attach"
SchemeTelegram string = "tg"
)
2018-10-12 09:37:59 +00:00
// Status represents available and supported statuses of ID
const (
2019-07-30 11:34:28 +00:00
StatusAdministrator string = "administrator"
StatusCreator string = "creator"
StatusKicked string = "kicked"
StatusLeft string = "left"
StatusMember string = "member"
StatusRestricted string = "restricted"
)
2018-10-12 09:37:59 +00:00
// Type represents available and supported types of data
const (
2019-07-30 11:34:28 +00:00
TypeAddress string = "address"
TypeArticle string = "article"
TypeAudio string = "audio"
TypeBankStatement string = "bank_statement"
TypeContact string = "contact"
TypeDocument string = "document"
TypeDriverLicense string = "driver_license"
TypeEmail string = "email"
TypeGame string = "game"
TypeGIF string = "gif"
TypeIdentityCard string = "identity_card"
TypeInternalPassport string = "internal_passport"
TypeLocation string = "location"
TypeMpeg4Gif string = "mpeg4_gif"
TypePassport string = "passport"
TypePassportRegistration string = "passport_registration"
TypePersonalDetails string = "personal_details"
TypePhoneNumber string = "phone_number"
TypePhoto string = "photo"
TypeRentalAgreement string = "rental_agreement"
TypeSticker string = "sticker"
TypeTemporaryRegistration string = "temporary_registration"
TypeUtilityBill string = "utility_bill"
TypeVenue string = "venue"
TypeVideo string = "video"
TypeVoice string = "voice"
)
2018-10-12 09:37:59 +00:00
// Update represents available and supported types of updates
const (
2019-07-30 11:34:28 +00:00
UpdateCallbackQuery string = "callback_query"
UpdateChannelPost string = "channel_post"
UpdateChosenInlineResult string = "chosen_inline_result"
UpdateEditedChannelPost string = "edited_channel_post"
UpdateEditedMessage string = "edited_message"
UpdateInlineQuery string = "inline_query"
UpdateMessage string = "message"
2019-08-09 07:23:21 +00:00
UpdatePoll string = "poll"
2019-07-30 11:34:28 +00:00
UpdatePreCheckoutQuery string = "pre_checkout_query"
UpdateShippingQuery string = "shipping_query"
)
2020-01-09 15:27:00 +00:00
2020-05-08 16:30:36 +00:00
// Default represents a default values for some helpers
2020-01-09 15:27:00 +00:00
const (
2021-03-09 14:15:28 +00:00
DefaultAudioSeparator string = " "
DefaultAudioTitle string = "[untitled]"
2020-01-09 15:27:00 +00:00
)
2020-05-08 16:30:36 +00:00
// Poll represents a poll types
const (
PollQuiz string = "quiz"
PollRegular string = "regular"
)
// Emoji represents emoji supported by SendDice method
const (
2020-11-05 08:28:32 +00:00
EmojiBasketball string = "🏀" // 1-5
2021-03-09 14:15:28 +00:00
EmojiBowling string = "🎳" // 1-6
2020-11-05 08:28:32 +00:00
EmojiDart string = "🎯" // 1-6
EmojiGameDie string = "🎲" // 1-6
EmojiSlotMachine string = "🎰" // 1-64
EmojiSoccer string = "⚽" // 1-5
)
const (
// FromAnonymous is a User ID for messages from anonymous group administrators.
2021-03-09 14:15:28 +00:00
FromAnonymous int64 = 1087968824 // @GroupAnonymousBot
2020-11-05 08:28:32 +00:00
// FromForwarder is a User ID for messages automatically forwarded to the discussion group.
2021-03-09 14:15:28 +00:00
FromForwarder int64 = 777000
)