Documentation ¶
Overview ¶
Package telegoutil provides utility methods for Telego.
Those utility methods provides a convenient way of construction Telegram methods parameters and other types.
Utilities by files: * api.go - low-level API of Telego * methods.go - Telegram methods parameters * types.go - types used in methods parameters * handler.go - handler and predicate helpers
This package is designed to be self-contained, and other packages should not depend on utilities.
Index ¶
- Constants
- func Animation(id telego.ChatID, animation telego.InputFile) *telego.SendAnimationParams
- func Audio(id telego.ChatID, audio telego.InputFile) *telego.SendAudioParams
- func CallbackQuery(queryID string) *telego.AnswerCallbackQueryParams
- func ChatAction(id telego.ChatID, action string) *telego.SendChatActionParams
- func Contact(id telego.ChatID, phoneNumber, firstName string) *telego.SendContactParams
- func ContactMessage(phoneNumber, firstName string) *telego.InputContactMessageContent
- func CopyMessage(id, fromID telego.ChatID, messageID int) *telego.CopyMessageParams
- func Delete(id telego.ChatID, messageID int) *telego.DeleteMessageParams
- func Dice(id telego.ChatID, emoji string) *telego.SendDiceParams
- func Document(id telego.ChatID, document telego.InputFile) *telego.SendDocumentParams
- func DownloadFile(url string) ([]byte, error)
- func ErrorDataField(sourceType, message, fieldName, dataHash string) *telego.PassportElementErrorDataField
- func ErrorFile(sourceType, message, fileHash string) *telego.PassportElementErrorFile
- func ErrorFiles(sourceType, message string, fileHashes ...string) *telego.PassportElementErrorFiles
- func ErrorFrontSide(sourceType, message, fileHash string) *telego.PassportElementErrorFrontSide
- func ErrorReverseSide(sourceType, message, fileHash string) *telego.PassportElementErrorReverseSide
- func ErrorSelfie(sourceType, message, fileHash string) *telego.PassportElementErrorSelfie
- func ErrorTranslationFile(sourceType, message, fileHash string) *telego.PassportElementErrorTranslationFile
- func ErrorTranslationFiles(sourceType, message string, fileHashes ...string) *telego.PassportElementErrorTranslationFiles
- func ErrorUnspecified(sourceType, message, elementHash string) *telego.PassportElementErrorUnspecified
- func File(file ta.NamedReader) telego.InputFile
- func FileFromID(id string) telego.InputFile
- func FileFromURL(url string) telego.InputFile
- func ForceReply() *telego.ForceReply
- func Game(id int64, gameShortName string) *telego.SendGameParams
- func ID(id int64) telego.ChatID
- func InlineKeyboard(rows ...[]telego.InlineKeyboardButton) *telego.InlineKeyboardMarkup
- func InlineKeyboardButton(text string) telego.InlineKeyboardButton
- func InlineKeyboardCols(cols int, buttons ...telego.InlineKeyboardButton) [][]telego.InlineKeyboardButton
- func InlineKeyboardGrid(buttons [][]telego.InlineKeyboardButton) *telego.InlineKeyboardMarkup
- func InlineKeyboardRow(buttons ...telego.InlineKeyboardButton) []telego.InlineKeyboardButton
- func InlineKeyboardRows(rows int, buttons ...telego.InlineKeyboardButton) [][]telego.InlineKeyboardButton
- func InlineQuery(queryID string, results ...telego.InlineQueryResult) *telego.AnswerInlineQueryParams
- func Invoice(id telego.ChatID, title, description, payload, providerToken, currency string, ...) *telego.SendInvoiceParams
- func InvoiceMessage(title, description, payload, providerToken, currency string, ...) *telego.InputInvoiceMessageContent
- func Keyboard(rows ...[]telego.KeyboardButton) *telego.ReplyKeyboardMarkup
- func KeyboardButton(text string) telego.KeyboardButton
- func KeyboardCols(cols int, buttons ...telego.KeyboardButton) [][]telego.KeyboardButton
- func KeyboardGrid(buttons [][]telego.KeyboardButton) *telego.ReplyKeyboardMarkup
- func KeyboardRow(buttons ...telego.KeyboardButton) []telego.KeyboardButton
- func KeyboardRows(rows int, buttons ...telego.KeyboardButton) [][]telego.KeyboardButton
- func LabeledPrice(label string, amount int) telego.LabeledPrice
- func Location(id telego.ChatID, latitude, longitude float64) *telego.SendLocationParams
- func LocationMessage(latitude, longitude float64) *telego.InputLocationMessageContent
- func MediaAnimation(media telego.InputFile) *telego.InputMediaAnimation
- func MediaAudio(media telego.InputFile) *telego.InputMediaAudio
- func MediaDocument(media telego.InputFile) *telego.InputMediaDocument
- func MediaGroup(id telego.ChatID, mediaGroups ...telego.InputMedia) *telego.SendMediaGroupParams
- func MediaPhoto(media telego.InputFile) *telego.InputMediaPhoto
- func MediaVideo(media telego.InputFile) *telego.InputMediaVideo
- func Message(id telego.ChatID, text string) *telego.SendMessageParams
- func MessageEntities(entityCollections ...MessageEntityCollection) (string, []telego.MessageEntity)
- func MessageWithEntities(id telego.ChatID, entityCollections ...MessageEntityCollection) *telego.SendMessageParams
- func Messagef(id telego.ChatID, format string, args ...any) *telego.SendMessageParams
- func NameReader(reader io.Reader, name string) ta.NamedReader
- func ParseCommand(text string) (cmd string, username string, args []string)
- func ParseCommandPayload(text string) (cmd string, username string, payload string)
- func Photo(id telego.ChatID, photo telego.InputFile) *telego.SendPhotoParams
- func Poll(id telego.ChatID, question string, options ...telego.InputPollOption) *telego.SendPollParams
- func PollOption(text string) telego.InputPollOption
- func PollTypeAny() *telego.KeyboardButtonPollType
- func PollTypeQuiz() *telego.KeyboardButtonPollType
- func PollTypeRegular() *telego.KeyboardButtonPollType
- func PreCheckoutQuery(queryID string, ok bool) *telego.AnswerPreCheckoutQueryParams
- func ReplyKeyboardRemove() *telego.ReplyKeyboardRemove
- func ResultArticle(id, title string, inputMessageContent telego.InputMessageContent) *telego.InlineQueryResultArticle
- func ResultAudio(id, audioURL, title string) *telego.InlineQueryResultAudio
- func ResultCachedAudio(id, audioFileID string) *telego.InlineQueryResultCachedAudio
- func ResultCachedDocument(id, title, documentFileID string) *telego.InlineQueryResultCachedDocument
- func ResultCachedGif(id, gifFileID string) *telego.InlineQueryResultCachedGif
- func ResultCachedMpeg4Gif(id, mpeg4FileID string) *telego.InlineQueryResultCachedMpeg4Gif
- func ResultCachedPhoto(id, photoFileID string) *telego.InlineQueryResultCachedPhoto
- func ResultCachedSticker(id, stickerFileID string) *telego.InlineQueryResultCachedSticker
- func ResultCachedVideo(id, videoFileID, title string) *telego.InlineQueryResultCachedVideo
- func ResultCachedVoice(id, voiceFileID, title string) *telego.InlineQueryResultCachedVoice
- func ResultContact(id, phoneNumber, firstName string) *telego.InlineQueryResultContact
- func ResultDocument(id, title, documentURL, mimeType string) *telego.InlineQueryResultDocument
- func ResultGame(id, gameShortName string) *telego.InlineQueryResultGame
- func ResultGif(id, gifURL, thumbnailURL string) *telego.InlineQueryResultGif
- func ResultLocation(id string, latitude, longitude float64, title string) *telego.InlineQueryResultLocation
- func ResultMpeg4Gif(id, mpeg4URL, thumbnailURL string) *telego.InlineQueryResultMpeg4Gif
- func ResultPhoto(id, photoURL, thumbnailURL string) *telego.InlineQueryResultPhoto
- func ResultVenue(id string, latitude, longitude float64, title, address string) *telego.InlineQueryResultVenue
- func ResultVideo(id, videoURL, mimeType, thumbnailURL, title string) *telego.InlineQueryResultVideo
- func ResultVoice(id, voiceURL, title string) *telego.InlineQueryResultVoice
- func ScopeAllChatAdministrators() *telego.BotCommandScopeAllChatAdministrators
- func ScopeAllGroupChats() *telego.BotCommandScopeAllGroupChats
- func ScopeAllPrivateChats() *telego.BotCommandScopeAllPrivateChats
- func ScopeChat(chatID telego.ChatID) *telego.BotCommandScopeChat
- func ScopeChatAdministrators(chatID telego.ChatID) *telego.BotCommandScopeChatAdministrators
- func ScopeChatMember(chatID telego.ChatID, userID int64) *telego.BotCommandScopeChatMember
- func ScopeDefault() *telego.BotCommandScopeDefault
- func ShippingOption(id, title string, prices ...telego.LabeledPrice) telego.ShippingOption
- func ShippingQuery(queryID string, ok bool, options ...telego.ShippingOption) *telego.AnswerShippingQueryParams
- func Sticker(id telego.ChatID, sticker telego.InputFile) *telego.SendStickerParams
- func TextMessage(messageText string) *telego.InputTextMessageContent
- func UTF16TextLen(text string) int
- func UpdateProcessor(updates <-chan telego.Update, buffer uint, ...) <-chan telego.Update
- func Username(username string) telego.ChatID
- func ValidateLoginWidgetData(token string, data string) (url.Values, error)
- func ValidateWebAppData(token string, data string) (url.Values, error)
- func Venue(id telego.ChatID, latitude, longitude float64, title, address string) *telego.SendVenueParams
- func VenueMessage(latitude, longitude float64, title, address string) *telego.InputVenueMessageContent
- func Video(id telego.ChatID, video telego.InputFile) *telego.SendVideoParams
- func VideoNote(id telego.ChatID, videoNote telego.InputFile) *telego.SendVideoNoteParams
- func Voice(id telego.ChatID, voice telego.InputFile) *telego.SendVoiceParams
- func WebAppInfo(url string) *telego.WebAppInfo
- func WebAppQuery(queryID string, result telego.InlineQueryResult) *telego.AnswerWebAppQueryParams
- func Webhook(url string) *telego.SetWebhookParams
- type MessageEntityCollection
- func (c MessageEntityCollection) Blockquote() MessageEntityCollection
- func (c MessageEntityCollection) Bold() MessageEntityCollection
- func (c MessageEntityCollection) BotCommand() MessageEntityCollection
- func (c MessageEntityCollection) Cashtag() MessageEntityCollection
- func (c MessageEntityCollection) Code() MessageEntityCollection
- func (c MessageEntityCollection) CustomEmoji(emojiID string) MessageEntityCollection
- func (c MessageEntityCollection) Email() MessageEntityCollection
- func (c MessageEntityCollection) Entities() []telego.MessageEntity
- func (c MessageEntityCollection) ExpandableBlockquote() MessageEntityCollection
- func (c MessageEntityCollection) Hashtag() MessageEntityCollection
- func (c MessageEntityCollection) Italic() MessageEntityCollection
- func (c MessageEntityCollection) Mention() MessageEntityCollection
- func (c MessageEntityCollection) PhoneNumber() MessageEntityCollection
- func (c MessageEntityCollection) Pre(language string) MessageEntityCollection
- func (c MessageEntityCollection) SetOffset(offset int)
- func (c MessageEntityCollection) Spoiler() MessageEntityCollection
- func (c MessageEntityCollection) Strikethrough() MessageEntityCollection
- func (c MessageEntityCollection) Text() string
- func (c MessageEntityCollection) TextLink(url string) MessageEntityCollection
- func (c MessageEntityCollection) TextMention(user *telego.User) MessageEntityCollection
- func (c MessageEntityCollection) TextMentionWithID(userID int64) MessageEntityCollection
- func (c MessageEntityCollection) URL() MessageEntityCollection
- func (c MessageEntityCollection) Underline() MessageEntityCollection
Constants ¶
const ( WebAppQueryID = "query_id" WebAppUser = "user" WebAppReceiver = "receiver" WebAppChat = "chat" WebAppStartParam = "start_param" WebAppCanSendAfter = "can_send_after" WebAppAuthDate = "auth_date" WebAppHash = "hash" )
Web app data query names
const ( LoginWidgetID = "id" LoginWidgetFirstName = "first_name" LoginWidgetLastName = "last_name" LoginWidgetUsername = "username" LoginWidgetPhotoURL = "photo_url" LoginWidgetAuthDate = "auth_date" LoginWidgetHash = "hash" )
Login widget data query names
const WebAppSecret = "WebAppData"
WebAppSecret represents secret used to hash web app data
Variables ¶
This section is empty.
Functions ¶
func CallbackQuery ¶ added in v0.15.2
func CallbackQuery(queryID string) *telego.AnswerCallbackQueryParams
CallbackQuery creates telego.AnswerCallbackQueryParams with required parameters
func ChatAction ¶
func ChatAction(id telego.ChatID, action string) *telego.SendChatActionParams
ChatAction creates telego.SendChatActionParams with required parameters
func Contact ¶
func Contact(id telego.ChatID, phoneNumber, firstName string) *telego.SendContactParams
Contact creates telego.SendContactParams with required parameters
func ContactMessage ¶ added in v0.10.0
func ContactMessage(phoneNumber, firstName string) *telego.InputContactMessageContent
ContactMessage creates telego.InputContactMessageContent with required fields
func CopyMessage ¶ added in v0.10.0
func CopyMessage(id, fromID telego.ChatID, messageID int) *telego.CopyMessageParams
CopyMessage creates telego.CopyMessageParams with required parameters
func Delete ¶ added in v0.25.0
func Delete(id telego.ChatID, messageID int) *telego.DeleteMessageParams
Delete creates telego.DeleteMessageParams with required parameters
func Dice ¶
func Dice(id telego.ChatID, emoji string) *telego.SendDiceParams
Dice creates telego.SendDiceParams with required parameters Note: Emoji isn't required, but most likely you would what to specify it, you can use telego.EmojiDice or etc.
func DownloadFile ¶ added in v0.22.1
DownloadFile returns downloaded file bytes or error
func ErrorDataField ¶ added in v0.10.0
func ErrorDataField(sourceType, message, fieldName, dataHash string) *telego.PassportElementErrorDataField
ErrorDataField creates telego.PassportElementErrorDataField with required fields
func ErrorFile ¶ added in v0.10.0
func ErrorFile(sourceType, message, fileHash string) *telego.PassportElementErrorFile
ErrorFile creates telego.PassportElementErrorFile with required fields
func ErrorFiles ¶ added in v0.10.0
func ErrorFiles(sourceType, message string, fileHashes ...string) *telego.PassportElementErrorFiles
ErrorFiles creates telego.PassportElementErrorFiles with required fields
func ErrorFrontSide ¶ added in v0.10.0
func ErrorFrontSide(sourceType, message, fileHash string) *telego.PassportElementErrorFrontSide
ErrorFrontSide creates telego.PassportElementErrorFrontSide with required fields
func ErrorReverseSide ¶ added in v0.10.0
func ErrorReverseSide(sourceType, message, fileHash string) *telego.PassportElementErrorReverseSide
ErrorReverseSide creates telego.PassportElementErrorReverseSide with required fields
func ErrorSelfie ¶ added in v0.10.0
func ErrorSelfie(sourceType, message, fileHash string) *telego.PassportElementErrorSelfie
ErrorSelfie creates telego.PassportElementErrorSelfie with required fields
func ErrorTranslationFile ¶ added in v0.10.0
func ErrorTranslationFile(sourceType, message, fileHash string) *telego.PassportElementErrorTranslationFile
ErrorTranslationFile creates telego.PassportElementErrorTranslationFile with required fields
func ErrorTranslationFiles ¶ added in v0.10.0
func ErrorTranslationFiles(sourceType, message string, fileHashes ...string, ) *telego.PassportElementErrorTranslationFiles
ErrorTranslationFiles creates telego.PassportElementErrorTranslationFiles with required fields
func ErrorUnspecified ¶ added in v0.10.0
func ErrorUnspecified(sourceType, message, elementHash string) *telego.PassportElementErrorUnspecified
ErrorUnspecified creates telego.PassportElementErrorUnspecified with required fields
func File ¶
func File(file ta.NamedReader) telego.InputFile
File creates telego.InputFile from telegoapi.NamedReader
func FileFromID ¶ added in v0.23.0
FileFromID creates telego.InputFile from file ID
func FileFromURL ¶ added in v0.23.0
FileFromURL creates telego.InputFile from URL
func ForceReply ¶ added in v0.18.2
func ForceReply() *telego.ForceReply
ForceReply creates telego.ForceReply with required fields
func Game ¶
func Game(id int64, gameShortName string) *telego.SendGameParams
Game creates telego.SendGameParams with required parameters
func InlineKeyboard ¶ added in v0.10.0
func InlineKeyboard(rows ...[]telego.InlineKeyboardButton) *telego.InlineKeyboardMarkup
InlineKeyboard creates telego.InlineKeyboardMarkup from slice of keyboard buttons rows
func InlineKeyboardButton ¶ added in v0.10.0
func InlineKeyboardButton(text string) telego.InlineKeyboardButton
InlineKeyboardButton creates telego.InlineKeyboardButton with required fields
func InlineKeyboardCols ¶ added in v0.27.0
func InlineKeyboardCols(cols int, buttons ...telego.InlineKeyboardButton) [][]telego.InlineKeyboardButton
InlineKeyboardCols creates a grid of buttons containing specified number of columns
func InlineKeyboardGrid ¶ added in v0.27.0
func InlineKeyboardGrid(buttons [][]telego.InlineKeyboardButton) *telego.InlineKeyboardMarkup
InlineKeyboardGrid creates a telego.InlineKeyboardMarkup from grid of buttons
func InlineKeyboardRow ¶ added in v0.10.0
func InlineKeyboardRow(buttons ...telego.InlineKeyboardButton) []telego.InlineKeyboardButton
InlineKeyboardRow creates a slice of telego.InlineKeyboardButton
func InlineKeyboardRows ¶ added in v0.27.0
func InlineKeyboardRows(rows int, buttons ...telego.InlineKeyboardButton) [][]telego.InlineKeyboardButton
InlineKeyboardRows creates a grid of buttons containing specified number of rows
func InlineQuery ¶ added in v0.10.0
func InlineQuery(queryID string, results ...telego.InlineQueryResult) *telego.AnswerInlineQueryParams
InlineQuery creates telego.AnswerInlineQueryParams with required parameters
func Invoice ¶
func Invoice(id telego.ChatID, title, description, payload, providerToken, currency string, prices ...telego.LabeledPrice, ) *telego.SendInvoiceParams
Invoice creates telego.SendInvoiceParams with required parameters
func InvoiceMessage ¶ added in v0.10.0
func InvoiceMessage(title, description, payload, providerToken, currency string, prices ...telego.LabeledPrice, ) *telego.InputInvoiceMessageContent
InvoiceMessage creates telego.InputInvoiceMessageContent with required fields
func Keyboard ¶ added in v0.10.0
func Keyboard(rows ...[]telego.KeyboardButton) *telego.ReplyKeyboardMarkup
Keyboard creates telego.ReplyKeyboardMarkup from slice of keyboard buttons
func KeyboardButton ¶ added in v0.10.0
func KeyboardButton(text string) telego.KeyboardButton
KeyboardButton creates telego.KeyboardButton with required fields
func KeyboardCols ¶ added in v0.27.0
func KeyboardCols(cols int, buttons ...telego.KeyboardButton) [][]telego.KeyboardButton
KeyboardCols creates a grid of buttons containing specified number of columns
func KeyboardGrid ¶ added in v0.27.0
func KeyboardGrid(buttons [][]telego.KeyboardButton) *telego.ReplyKeyboardMarkup
KeyboardGrid creates a telego.ReplyKeyboardMarkup from grid of buttons
func KeyboardRow ¶ added in v0.10.0
func KeyboardRow(buttons ...telego.KeyboardButton) []telego.KeyboardButton
KeyboardRow creates a slice of telego.KeyboardButton
func KeyboardRows ¶ added in v0.27.0
func KeyboardRows(rows int, buttons ...telego.KeyboardButton) [][]telego.KeyboardButton
KeyboardRows creates a grid of buttons containing specified number of rows
func LabeledPrice ¶ added in v0.16.0
func LabeledPrice(label string, amount int) telego.LabeledPrice
LabeledPrice creates telego.LabeledPrice with required parameters
func Location ¶
func Location(id telego.ChatID, latitude, longitude float64) *telego.SendLocationParams
Location creates telego.SendLocationParams with required parameters
func LocationMessage ¶ added in v0.10.0
func LocationMessage(latitude, longitude float64) *telego.InputLocationMessageContent
LocationMessage creates telego.InputLocationMessageContent with required fields
func MediaAnimation ¶ added in v0.10.0
func MediaAnimation(media telego.InputFile) *telego.InputMediaAnimation
MediaAnimation creates telego.InputMediaAnimation with required fields
func MediaAudio ¶ added in v0.10.0
func MediaAudio(media telego.InputFile) *telego.InputMediaAudio
MediaAudio creates telego.InputMediaAudio with required fields
func MediaDocument ¶ added in v0.10.0
func MediaDocument(media telego.InputFile) *telego.InputMediaDocument
MediaDocument creates telego.InputMediaDocument with required fields
func MediaGroup ¶
func MediaGroup(id telego.ChatID, mediaGroups ...telego.InputMedia) *telego.SendMediaGroupParams
MediaGroup creates telego.SendMediaGroupParams with required parameters
func MediaPhoto ¶ added in v0.10.0
func MediaPhoto(media telego.InputFile) *telego.InputMediaPhoto
MediaPhoto creates telego.InputMediaPhoto with required fields
func MediaVideo ¶ added in v0.10.0
func MediaVideo(media telego.InputFile) *telego.InputMediaVideo
MediaVideo creates telego.InputMediaVideo with required fields
func Message ¶
func Message(id telego.ChatID, text string) *telego.SendMessageParams
Message creates telego.SendMessageParams with required parameters
func MessageEntities ¶ added in v0.15.2
func MessageEntities(entityCollections ...MessageEntityCollection) (string, []telego.MessageEntity)
MessageEntities converts entity collections into the text and slice of telego.MessageEntity associated with text Note: Entity length is not trimmed as described in docs on purpose, Telegram still handles all entities perfectly fine, but trimming their length actually limits what can be sent
func MessageWithEntities ¶ added in v0.15.2
func MessageWithEntities(id telego.ChatID, entityCollections ...MessageEntityCollection) *telego.SendMessageParams
MessageWithEntities creates telego.SendMessageParams with required parameters and parsed entities
func Messagef ¶ added in v0.16.2
Messagef creates telego.SendMessageParams with required parameters and provided format
func NameReader ¶ added in v0.9.2
func NameReader(reader io.Reader, name string) ta.NamedReader
NameReader "names" io.Reader and returns valid telegoapi.NamedReader
func ParseCommand ¶ added in v0.9.1
ParseCommand returns command, bot username and its arguments if any
func ParseCommandPayload ¶ added in v0.30.0
ParseCommandPayload returns command, bot username and its payload if any
func Poll ¶
func Poll(id telego.ChatID, question string, options ...telego.InputPollOption) *telego.SendPollParams
Poll creates telego.SendPollParams with required parameters
func PollOption ¶ added in v0.30.1
func PollOption(text string) telego.InputPollOption
PollOption creates telego.InputPollOption with required parameters
func PollTypeAny ¶ added in v0.10.0
func PollTypeAny() *telego.KeyboardButtonPollType
PollTypeAny creates telego.KeyboardButtonPollType with any type
func PollTypeQuiz ¶ added in v0.10.0
func PollTypeQuiz() *telego.KeyboardButtonPollType
PollTypeQuiz creates telego.KeyboardButtonPollType with type quiz
func PollTypeRegular ¶ added in v0.10.0
func PollTypeRegular() *telego.KeyboardButtonPollType
PollTypeRegular creates telego.KeyboardButtonPollType with type regular
func PreCheckoutQuery ¶ added in v0.16.0
func PreCheckoutQuery(queryID string, ok bool) *telego.AnswerPreCheckoutQueryParams
PreCheckoutQuery creates telego.AnswerPreCheckoutQueryParams with required parameters
func ReplyKeyboardRemove ¶ added in v0.18.2
func ReplyKeyboardRemove() *telego.ReplyKeyboardRemove
ReplyKeyboardRemove creates telego.ReplyKeyboardRemove with required fields
func ResultArticle ¶ added in v0.10.0
func ResultArticle(id, title string, inputMessageContent telego.InputMessageContent, ) *telego.InlineQueryResultArticle
ResultArticle creates telego.InlineQueryResultArticle with required fields
func ResultAudio ¶ added in v0.10.0
func ResultAudio(id, audioURL, title string) *telego.InlineQueryResultAudio
ResultAudio creates telego.InlineQueryResultAudio with required fields
func ResultCachedAudio ¶ added in v0.10.0
func ResultCachedAudio(id, audioFileID string) *telego.InlineQueryResultCachedAudio
ResultCachedAudio creates telego.InlineQueryResultCachedAudio with required fields
func ResultCachedDocument ¶ added in v0.10.0
func ResultCachedDocument(id, title, documentFileID string) *telego.InlineQueryResultCachedDocument
ResultCachedDocument creates telego.InlineQueryResultCachedDocument with required fields
func ResultCachedGif ¶ added in v0.10.0
func ResultCachedGif(id, gifFileID string) *telego.InlineQueryResultCachedGif
ResultCachedGif creates telego.InlineQueryResultCachedGif with required fields
func ResultCachedMpeg4Gif ¶ added in v0.10.0
func ResultCachedMpeg4Gif(id, mpeg4FileID string) *telego.InlineQueryResultCachedMpeg4Gif
ResultCachedMpeg4Gif creates telego.InlineQueryResultCachedMpeg4Gif with required fields
func ResultCachedPhoto ¶ added in v0.10.0
func ResultCachedPhoto(id, photoFileID string) *telego.InlineQueryResultCachedPhoto
ResultCachedPhoto creates telego.InlineQueryResultCachedPhoto with required fields
func ResultCachedSticker ¶ added in v0.10.0
func ResultCachedSticker(id, stickerFileID string) *telego.InlineQueryResultCachedSticker
ResultCachedSticker creates telego.InlineQueryResultCachedSticker with required fields
func ResultCachedVideo ¶ added in v0.10.0
func ResultCachedVideo(id, videoFileID, title string) *telego.InlineQueryResultCachedVideo
ResultCachedVideo creates telego.InlineQueryResultCachedVideo with required fields
func ResultCachedVoice ¶ added in v0.10.0
func ResultCachedVoice(id, voiceFileID, title string) *telego.InlineQueryResultCachedVoice
ResultCachedVoice creates telego.InlineQueryResultCachedVoice with required fields
func ResultContact ¶ added in v0.10.0
func ResultContact(id, phoneNumber, firstName string) *telego.InlineQueryResultContact
ResultContact creates telego.InlineQueryResultContact with required fields
func ResultDocument ¶ added in v0.10.0
func ResultDocument(id, title, documentURL, mimeType string) *telego.InlineQueryResultDocument
ResultDocument creates telego.InlineQueryResultDocument with required fields
func ResultGame ¶ added in v0.10.0
func ResultGame(id, gameShortName string) *telego.InlineQueryResultGame
ResultGame creates telego.InlineQueryResultGame with required fields
func ResultGif ¶ added in v0.10.0
func ResultGif(id, gifURL, thumbnailURL string) *telego.InlineQueryResultGif
ResultGif creates telego.InlineQueryResultGif with required fields
func ResultLocation ¶ added in v0.10.0
func ResultLocation(id string, latitude, longitude float64, title string) *telego.InlineQueryResultLocation
ResultLocation creates telego.InlineQueryResultLocation with required fields
func ResultMpeg4Gif ¶ added in v0.10.0
func ResultMpeg4Gif(id, mpeg4URL, thumbnailURL string) *telego.InlineQueryResultMpeg4Gif
ResultMpeg4Gif creates telego.InlineQueryResultMpeg4Gif with required fields
func ResultPhoto ¶ added in v0.10.0
func ResultPhoto(id, photoURL, thumbnailURL string) *telego.InlineQueryResultPhoto
ResultPhoto creates telego.InlineQueryResultPhoto with required fields
func ResultVenue ¶ added in v0.10.0
func ResultVenue(id string, latitude, longitude float64, title, address string, ) *telego.InlineQueryResultVenue
ResultVenue creates telego.InlineQueryResultVenue with required fields
func ResultVideo ¶ added in v0.10.0
func ResultVideo(id, videoURL, mimeType, thumbnailURL, title string) *telego.InlineQueryResultVideo
ResultVideo creates telego.InlineQueryResultVideo with required fields
func ResultVoice ¶ added in v0.10.0
func ResultVoice(id, voiceURL, title string) *telego.InlineQueryResultVoice
ResultVoice creates telego.InlineQueryResultVoice with required fields
func ScopeAllChatAdministrators ¶ added in v0.10.0
func ScopeAllChatAdministrators() *telego.BotCommandScopeAllChatAdministrators
ScopeAllChatAdministrators creates telego.BotCommandScopeAllChatAdministrators with required fields
func ScopeAllGroupChats ¶ added in v0.10.0
func ScopeAllGroupChats() *telego.BotCommandScopeAllGroupChats
ScopeAllGroupChats creates telego.BotCommandScopeAllGroupChats with required fields
func ScopeAllPrivateChats ¶ added in v0.10.0
func ScopeAllPrivateChats() *telego.BotCommandScopeAllPrivateChats
ScopeAllPrivateChats creates telego.BotCommandScopeAllPrivateChats with required fields
func ScopeChat ¶ added in v0.10.0
func ScopeChat(chatID telego.ChatID) *telego.BotCommandScopeChat
ScopeChat creates telego.BotCommandScopeChat with required fields
func ScopeChatAdministrators ¶ added in v0.10.0
func ScopeChatAdministrators(chatID telego.ChatID) *telego.BotCommandScopeChatAdministrators
ScopeChatAdministrators creates telego.BotCommandScopeChatAdministrators with required fields
func ScopeChatMember ¶ added in v0.10.0
func ScopeChatMember(chatID telego.ChatID, userID int64) *telego.BotCommandScopeChatMember
ScopeChatMember creates telego.BotCommandScopeChatMember with required fields
func ScopeDefault ¶ added in v0.10.0
func ScopeDefault() *telego.BotCommandScopeDefault
ScopeDefault creates telego.BotCommandScopeDefault with required fields
func ShippingOption ¶ added in v0.16.0
func ShippingOption(id, title string, prices ...telego.LabeledPrice) telego.ShippingOption
ShippingOption creates telego.ShippingOption with required parameters
func ShippingQuery ¶ added in v0.16.0
func ShippingQuery(queryID string, ok bool, options ...telego.ShippingOption) *telego.AnswerShippingQueryParams
ShippingQuery creates telego.AnswerShippingQueryParams with required parameters
func TextMessage ¶ added in v0.10.0
func TextMessage(messageText string) *telego.InputTextMessageContent
TextMessage creates telego.InputTextMessageContent with required fields
func UTF16TextLen ¶ added in v0.22.1
UTF16TextLen returns length of a UTF-16 text Credit: https://core.telegram.org/api/entities#computing-entity-length
func UpdateProcessor ¶ added in v0.15.1
func UpdateProcessor(updates <-chan telego.Update, buffer uint, processor func(update telego.Update) telego.Update, ) <-chan telego.Update
UpdateProcessor allows you to process updates and still use updates chan. New updates chan will be closed when the original chan is closed. Warning: Deep copy of update is passed, telego.Update.Clone method can panic, please read its comment.
func ValidateLoginWidgetData ¶ added in v0.28.0
ValidateLoginWidgetData validates the integrity of value provided by Telegram Login Widget and returns url.Values containing all fields that were provided More info: https://core.telegram.org/widgets/login#checking-authorization
func ValidateWebAppData ¶ added in v0.16.1
ValidateWebAppData validates the integrity of value provided by `window.Telegram.WebApp.initData` from web app and returns url.Values containing all fields that were provided More info: https://core.telegram.org/bots/webapps#validating-data-received-via-the-mini-app
func Venue ¶
func Venue(id telego.ChatID, latitude, longitude float64, title, address string) *telego.SendVenueParams
Venue creates telego.SendVenueParams with required parameters
func VenueMessage ¶ added in v0.10.0
func VenueMessage(latitude, longitude float64, title, address string) *telego.InputVenueMessageContent
VenueMessage creates telego.InputVenueMessageContent with required fields
func WebAppInfo ¶ added in v0.27.2
func WebAppInfo(url string) *telego.WebAppInfo
WebAppInfo creates telego.WebAppInfo with required fields
func WebAppQuery ¶ added in v0.16.0
func WebAppQuery(queryID string, result telego.InlineQueryResult) *telego.AnswerWebAppQueryParams
WebAppQuery creates telego.AnswerWebAppQueryParams with required parameters
func Webhook ¶ added in v0.20.0
func Webhook(url string) *telego.SetWebhookParams
Webhook creates telego.SetWebhookParams with required parameters
Types ¶
type MessageEntityCollection ¶ added in v0.15.2
type MessageEntityCollection struct {
// contains filtered or unexported fields
}
MessageEntityCollection represents text and slice of telego.MessageEntity associated with it
func Entity ¶ added in v0.15.2
func Entity(text string) MessageEntityCollection
Entity creates new MessageEntityCollection with provided text and no entities
func Entityf ¶ added in v0.16.0
func Entityf(format string, args ...any) MessageEntityCollection
Entityf creates new MessageEntityCollection with the provided format and args and no entities
func (MessageEntityCollection) Blockquote ¶ added in v0.29.0
func (c MessageEntityCollection) Blockquote() MessageEntityCollection
Blockquote assigns blockquote entity and returns new collection
func (MessageEntityCollection) Bold ¶ added in v0.15.2
func (c MessageEntityCollection) Bold() MessageEntityCollection
Bold assigns bold entity and returns a new collection
func (MessageEntityCollection) BotCommand ¶ added in v0.15.2
func (c MessageEntityCollection) BotCommand() MessageEntityCollection
BotCommand assigns bot command entity and returns a new collection
func (MessageEntityCollection) Cashtag ¶ added in v0.15.2
func (c MessageEntityCollection) Cashtag() MessageEntityCollection
Cashtag assigns cashtag entity and returns a new collection
func (MessageEntityCollection) Code ¶ added in v0.15.2
func (c MessageEntityCollection) Code() MessageEntityCollection
Code assigns code entity and returns new collection
func (MessageEntityCollection) CustomEmoji ¶ added in v0.16.0
func (c MessageEntityCollection) CustomEmoji(emojiID string) MessageEntityCollection
CustomEmoji assigns custom emoji entity and returns a new collection
func (MessageEntityCollection) Email ¶ added in v0.15.2
func (c MessageEntityCollection) Email() MessageEntityCollection
Email assigns email entity and returns a new collection
func (MessageEntityCollection) Entities ¶ added in v0.15.2
func (c MessageEntityCollection) Entities() []telego.MessageEntity
Entities return message entities associated with a collection
func (MessageEntityCollection) ExpandableBlockquote ¶ added in v0.30.2
func (c MessageEntityCollection) ExpandableBlockquote() MessageEntityCollection
ExpandableBlockquote assigns expandable blockquote entity and returns new collection
func (MessageEntityCollection) Hashtag ¶ added in v0.15.2
func (c MessageEntityCollection) Hashtag() MessageEntityCollection
Hashtag assigns hashtag entity and returns a new collection
func (MessageEntityCollection) Italic ¶ added in v0.15.2
func (c MessageEntityCollection) Italic() MessageEntityCollection
Italic assigns italic entity and returns a new collection
func (MessageEntityCollection) Mention ¶ added in v0.15.2
func (c MessageEntityCollection) Mention() MessageEntityCollection
Mention assigns mention entity and returns new collection
func (MessageEntityCollection) PhoneNumber ¶ added in v0.15.2
func (c MessageEntityCollection) PhoneNumber() MessageEntityCollection
PhoneNumber assigns phone number entity and returns a new collection
func (MessageEntityCollection) Pre ¶ added in v0.15.2
func (c MessageEntityCollection) Pre(language string) MessageEntityCollection
Pre assigns pre entity with language and returns a new collection
func (MessageEntityCollection) SetOffset ¶ added in v0.15.2
func (c MessageEntityCollection) SetOffset(offset int)
SetOffset sets offset for all entities
func (MessageEntityCollection) Spoiler ¶ added in v0.15.2
func (c MessageEntityCollection) Spoiler() MessageEntityCollection
Spoiler assigns spoiler entity and returns new collection
func (MessageEntityCollection) Strikethrough ¶ added in v0.15.2
func (c MessageEntityCollection) Strikethrough() MessageEntityCollection
Strikethrough assigns strikethrough entity and returns a new collection
func (MessageEntityCollection) Text ¶ added in v0.15.2
func (c MessageEntityCollection) Text() string
Text returns text associated with a collection
func (MessageEntityCollection) TextLink ¶ added in v0.15.2
func (c MessageEntityCollection) TextLink(url string) MessageEntityCollection
TextLink assigns text link entity with URL and returns a new collection
func (MessageEntityCollection) TextMention ¶ added in v0.15.2
func (c MessageEntityCollection) TextMention(user *telego.User) MessageEntityCollection
TextMention assigns text mention entity with user and returns new collection
func (MessageEntityCollection) TextMentionWithID ¶ added in v0.15.2
func (c MessageEntityCollection) TextMentionWithID(userID int64) MessageEntityCollection
TextMentionWithID assigns text mention entity with just user ID and returns a new collection
func (MessageEntityCollection) URL ¶ added in v0.15.2
func (c MessageEntityCollection) URL() MessageEntityCollection
URL assigns url entity and returns a new collection
func (MessageEntityCollection) Underline ¶ added in v0.15.2
func (c MessageEntityCollection) Underline() MessageEntityCollection
Underline assigns underline entity and returns new collection