Documentation ¶
Overview ¶
Package utils provides utility methods for TGO.
Those utility methods provides a convenient way of construction Telegram methods parameters and other types.
Utilities by files: * api.go - low-level API of TGO * 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 tgo.ChatID, animation tgo.InputFile) *tgo.SendAnimationParams
- func Audio(id tgo.ChatID, audio tgo.InputFile) *tgo.SendAudioParams
- func CallbackQuery(queryID string) *tgo.AnswerCallbackQueryParams
- func ChatAction(id tgo.ChatID, action string) *tgo.SendChatActionParams
- func Contact(id tgo.ChatID, phoneNumber, firstName string) *tgo.SendContactParams
- func ContactMessage(phoneNumber, firstName string) *tgo.InputContactMessageContent
- func CopyMessage(id, fromID tgo.ChatID, messageID int) *tgo.CopyMessageParams
- func Dice(id tgo.ChatID, emoji string) *tgo.SendDiceParams
- func Document(id tgo.ChatID, document tgo.InputFile) *tgo.SendDocumentParams
- func ErrorDataField(sourceType, message, fieldName, dataHash string) *tgo.PassportElementErrorDataField
- func ErrorFile(sourceType, message, fileHash string) *tgo.PassportElementErrorFile
- func ErrorFiles(sourceType, message string, fileHashes ...string) *tgo.PassportElementErrorFiles
- func ErrorFrontSide(sourceType, message, fileHash string) *tgo.PassportElementErrorFrontSide
- func ErrorReverseSide(sourceType, message, fileHash string) *tgo.PassportElementErrorReverseSide
- func ErrorSelfie(sourceType, message, fileHash string) *tgo.PassportElementErrorSelfie
- func ErrorTranslationFile(sourceType, message, fileHash string) *tgo.PassportElementErrorTranslationFile
- func ErrorTranslationFiles(sourceType, message string, fileHashes ...string) *tgo.PassportElementErrorTranslationFiles
- func ErrorUnspecified(sourceType, message, elementHash string) *tgo.PassportElementErrorUnspecified
- func File(file api.NamedReader) tgo.InputFile
- func FileByID(id string) tgo.InputFile
- func FileByURL(url string) tgo.InputFile
- func Game(id int64, gameShortName string) *tgo.SendGameParams
- func ID(id int64) tgo.ChatID
- func InlineKeyboard(rows ...[]tgo.InlineKeyboardButton) *tgo.InlineKeyboardMarkup
- func InlineKeyboardButton(text string) tgo.InlineKeyboardButton
- func InlineKeyboardRow(buttons ...tgo.InlineKeyboardButton) []tgo.InlineKeyboardButton
- func InlineQuery(queryID string, results ...tgo.InlineQueryResult) *tgo.AnswerInlineQueryParams
- func Invoice(id tgo.ChatID, title, description, payload, providerToken, currency string, ...) *tgo.SendInvoiceParams
- func InvoiceMessage(title, description, payload, providerToken, currency string, ...) *tgo.InputInvoiceMessageContent
- func Keyboard(rows ...[]tgo.KeyboardButton) *tgo.ReplyKeyboardMarkup
- func KeyboardButton(text string) tgo.KeyboardButton
- func KeyboardRow(buttons ...tgo.KeyboardButton) []tgo.KeyboardButton
- func LabeledPrice(label string, amount int) tgo.LabeledPrice
- func Location(id tgo.ChatID, latitude, longitude float64) *tgo.SendLocationParams
- func LocationMessage(latitude, longitude float64) *tgo.InputLocationMessageContent
- func MediaAnimation(media tgo.InputFile) *tgo.InputMediaAnimation
- func MediaAudio(media tgo.InputFile) *tgo.InputMediaAudio
- func MediaDocument(media tgo.InputFile) *tgo.InputMediaDocument
- func MediaGroup(id tgo.ChatID, mediaGroups ...tgo.InputMedia) *tgo.SendMediaGroupParams
- func MediaPhoto(media tgo.InputFile) *tgo.InputMediaPhoto
- func MediaVideo(media tgo.InputFile) *tgo.InputMediaVideo
- func Message(id tgo.ChatID, text string) *tgo.SendMessageParams
- func MessageEntities(entityCollections ...MessageEntityCollection) (string, []tgo.MessageEntity)
- func MessageWithEntities(id tgo.ChatID, entityCollections ...MessageEntityCollection) *tgo.SendMessageParams
- func Messagef(id tgo.ChatID, format string, args ...interface{}) *tgo.SendMessageParams
- func NameReader(reader io.Reader, name string) ta.NamedReader
- func ParseCommand(text string) (string, []string)
- func Photo(id tgo.ChatID, photo tgo.InputFile) *tgo.SendPhotoParams
- func Poll(id tgo.ChatID, question string, options ...string) *tgo.SendPollParams
- func PollTypeAny() *tgo.KeyboardButtonPollType
- func PollTypeQuiz() *tgo.KeyboardButtonPollType
- func PollTypeRegular() *tgo.KeyboardButtonPollType
- func PreCheckoutQuery(queryID string, ok bool) *tgo.AnswerPreCheckoutQueryParams
- func ResultArticle(id, title string, inputMessageContent tgo.InputMessageContent) *tgo.InlineQueryResultArticle
- func ResultAudio(id, audioURL, title string) *tgo.InlineQueryResultAudio
- func ResultCachedAudio(id, audioFileID string) *tgo.InlineQueryResultCachedAudio
- func ResultCachedDocument(id, title, documentFileID string) *tgo.InlineQueryResultCachedDocument
- func ResultCachedGif(id, gifFileID string) *tgo.InlineQueryResultCachedGif
- func ResultCachedMpeg4Gif(id, mpeg4FileID string) *tgo.InlineQueryResultCachedMpeg4Gif
- func ResultCachedPhoto(id, photoFileID string) *tgo.InlineQueryResultCachedPhoto
- func ResultCachedSticker(id, stickerFileID string) *tgo.InlineQueryResultCachedSticker
- func ResultCachedVideo(id, videoFileID, title string) *tgo.InlineQueryResultCachedVideo
- func ResultCachedVoice(id, voiceFileID, title string) *tgo.InlineQueryResultCachedVoice
- func ResultContact(id, phoneNumber, firstName string) *tgo.InlineQueryResultContact
- func ResultDocument(id, title, documentURL, mimeType string) *tgo.InlineQueryResultDocument
- func ResultGame(id, gameShortName string) *tgo.InlineQueryResultGame
- func ResultGif(id, gifURL, thumbURL string) *tgo.InlineQueryResultGif
- func ResultLocation(id string, latitude, longitude float64, title string) *tgo.InlineQueryResultLocation
- func ResultMpeg4Gif(id, mpeg4URL, thumbURL string) *tgo.InlineQueryResultMpeg4Gif
- func ResultPhoto(id, photoURL, thumbURL string) *tgo.InlineQueryResultPhoto
- func ResultVenue(id string, latitude, longitude float64, title, address string) *tgo.InlineQueryResultVenue
- func ResultVideo(id, videoURL, mimeType, thumbURL, title string) *tgo.InlineQueryResultVideo
- func ResultVoice(id, voiceURL, title string) *tgo.InlineQueryResultVoice
- func ScopeAllChatAdministrators() *tgo.BotCommandScopeAllChatAdministrators
- func ScopeAllGroupChats() *tgo.BotCommandScopeAllGroupChats
- func ScopeAllPrivateChats() *tgo.BotCommandScopeAllPrivateChats
- func ScopeChat(chatID tgo.ChatID) *tgo.BotCommandScopeChat
- func ScopeChatAdministrators(chatID tgo.ChatID) *tgo.BotCommandScopeChatAdministrators
- func ScopeChatMember(chatID tgo.ChatID, userID int64) *tgo.BotCommandScopeChatMember
- func ScopeDefault() *tgo.BotCommandScopeDefault
- func ShippingOption(id, title string, prices ...tgo.LabeledPrice) tgo.ShippingOption
- func ShippingQuery(queryID string, ok bool, options ...tgo.ShippingOption) *tgo.AnswerShippingQueryParams
- func Sticker(id tgo.ChatID, sticker tgo.InputFile) *tgo.SendStickerParams
- func TextMessage(messageText string) *tgo.InputTextMessageContent
- func UpdateProcessor(updates <-chan tgo.Update, buffer uint, ...) <-chan tgo.Update
- func Username(username string) tgo.ChatID
- func ValidateWebAppData(token string, data string) (url.Values, error)
- func Venue(id tgo.ChatID, latitude, longitude float64, title, address string) *tgo.SendVenueParams
- func VenueMessage(latitude, longitude float64, title, address string) *tgo.InputVenueMessageContent
- func Video(id tgo.ChatID, video tgo.InputFile) *tgo.SendVideoParams
- func VideoNote(id tgo.ChatID, videoNote tgo.InputFile) *tgo.SendVideoNoteParams
- func Voice(id tgo.ChatID, voice tgo.InputFile) *tgo.SendVoiceParams
- func WebAppQuery(queryID string, result tgo.InlineQueryResult) *tgo.AnswerWebAppQueryParams
- type 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() []tgo.MessageEntity
- 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 *tgo.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 WebAppSecret = "WebAppData"
WebAppSecret represents secret used to hash web app data
Variables ¶
This section is empty.
Functions ¶
func CallbackQuery ¶
func CallbackQuery(queryID string) *tgo.AnswerCallbackQueryParams
CallbackQuery creates tgo.AnswerCallbackQueryParams with required parameters
func ChatAction ¶
func ChatAction(id tgo.ChatID, action string) *tgo.SendChatActionParams
ChatAction creates tgo.SendChatActionParams with required parameters
func Contact ¶
func Contact(id tgo.ChatID, phoneNumber, firstName string) *tgo.SendContactParams
Contact creates tgo.SendContactParams with required parameters
func ContactMessage ¶
func ContactMessage(phoneNumber, firstName string) *tgo.InputContactMessageContent
ContactMessage creates tgo.InputContactMessageContent with required fields
func CopyMessage ¶
func CopyMessage(id, fromID tgo.ChatID, messageID int) *tgo.CopyMessageParams
CopyMessage creates tgo.CopyMessageParams with required parameters
func Dice ¶
func Dice(id tgo.ChatID, emoji string) *tgo.SendDiceParams
Dice creates tgo.SendDiceParams with required parameters Note: Emoji isn't required, but most likely you would what to specify it, you can use tgo.EmojiDice or etc.
func ErrorDataField ¶
func ErrorDataField(sourceType, message, fieldName, dataHash string) *tgo.PassportElementErrorDataField
ErrorDataField creates tgo.PassportElementErrorDataField with required fields
func ErrorFile ¶
func ErrorFile(sourceType, message, fileHash string) *tgo.PassportElementErrorFile
ErrorFile creates tgo.PassportElementErrorFile with required fields
func ErrorFiles ¶
func ErrorFiles(sourceType, message string, fileHashes ...string) *tgo.PassportElementErrorFiles
ErrorFiles creates tgo.PassportElementErrorFiles with required fields
func ErrorFrontSide ¶
func ErrorFrontSide(sourceType, message, fileHash string) *tgo.PassportElementErrorFrontSide
ErrorFrontSide creates tgo.PassportElementErrorFrontSide with required fields
func ErrorReverseSide ¶
func ErrorReverseSide(sourceType, message, fileHash string) *tgo.PassportElementErrorReverseSide
ErrorReverseSide creates tgo.PassportElementErrorReverseSide with required fields
func ErrorSelfie ¶
func ErrorSelfie(sourceType, message, fileHash string) *tgo.PassportElementErrorSelfie
ErrorSelfie creates tgo.PassportElementErrorSelfie with required fields
func ErrorTranslationFile ¶
func ErrorTranslationFile(sourceType, message, fileHash string) *tgo.PassportElementErrorTranslationFile
ErrorTranslationFile creates tgo.PassportElementErrorTranslationFile with required fields
func ErrorTranslationFiles ¶
func ErrorTranslationFiles(sourceType, message string, fileHashes ...string, ) *tgo.PassportElementErrorTranslationFiles
ErrorTranslationFiles creates tgo.PassportElementErrorTranslationFiles with required fields
func ErrorUnspecified ¶
func ErrorUnspecified(sourceType, message, elementHash string) *tgo.PassportElementErrorUnspecified
ErrorUnspecified creates tgo.PassportElementErrorUnspecified with required fields
func File ¶
func File(file api.NamedReader) tgo.InputFile
File creates tgo.InputFile from api.NamedReader
func Game ¶
func Game(id int64, gameShortName string) *tgo.SendGameParams
Game creates tgo.SendGameParams with required parameters
func InlineKeyboard ¶
func InlineKeyboard(rows ...[]tgo.InlineKeyboardButton) *tgo.InlineKeyboardMarkup
InlineKeyboard creates tgo.InlineKeyboardMarkup from slice of keyboard buttons
func InlineKeyboardButton ¶
func InlineKeyboardButton(text string) tgo.InlineKeyboardButton
InlineKeyboardButton creates tgo.InlineKeyboardButton with required fields
func InlineKeyboardRow ¶
func InlineKeyboardRow(buttons ...tgo.InlineKeyboardButton) []tgo.InlineKeyboardButton
InlineKeyboardRow creates slice of tgo.InlineKeyboardButton
func InlineQuery ¶
func InlineQuery(queryID string, results ...tgo.InlineQueryResult) *tgo.AnswerInlineQueryParams
InlineQuery creates tgo.AnswerInlineQueryParams with required parameters
func Invoice ¶
func Invoice(id tgo.ChatID, title, description, payload, providerToken, currency string, prices ...tgo.LabeledPrice, ) *tgo.SendInvoiceParams
Invoice creates tgo.SendInvoiceParams with required parameters
func InvoiceMessage ¶
func InvoiceMessage(title, description, payload, providerToken, currency string, prices ...tgo.LabeledPrice, ) *tgo.InputInvoiceMessageContent
InvoiceMessage creates tgo.InputInvoiceMessageContent with required fields
func Keyboard ¶
func Keyboard(rows ...[]tgo.KeyboardButton) *tgo.ReplyKeyboardMarkup
Keyboard creates tgo.ReplyKeyboardMarkup from slice of keyboard buttons
func KeyboardButton ¶
func KeyboardButton(text string) tgo.KeyboardButton
KeyboardButton creates tgo.KeyboardButton with required fields
func KeyboardRow ¶
func KeyboardRow(buttons ...tgo.KeyboardButton) []tgo.KeyboardButton
KeyboardRow creates slice of tgo.KeyboardButton
func LabeledPrice ¶
func LabeledPrice(label string, amount int) tgo.LabeledPrice
LabeledPrice creates tgo.LabeledPrice with required parameters
func Location ¶
func Location(id tgo.ChatID, latitude, longitude float64) *tgo.SendLocationParams
Location creates tgo.SendLocationParams with required parameters
func LocationMessage ¶
func LocationMessage(latitude, longitude float64) *tgo.InputLocationMessageContent
LocationMessage creates tgo.InputLocationMessageContent with required fields
func MediaAnimation ¶
func MediaAnimation(media tgo.InputFile) *tgo.InputMediaAnimation
MediaAnimation creates tgo.InputMediaAnimation with required fields
func MediaAudio ¶
func MediaAudio(media tgo.InputFile) *tgo.InputMediaAudio
MediaAudio creates tgo.InputMediaAudio with required fields
func MediaDocument ¶
func MediaDocument(media tgo.InputFile) *tgo.InputMediaDocument
MediaDocument creates tgo.InputMediaDocument with required fields
func MediaGroup ¶
func MediaGroup(id tgo.ChatID, mediaGroups ...tgo.InputMedia) *tgo.SendMediaGroupParams
MediaGroup creates tgo.SendMediaGroupParams with required parameters
func MediaPhoto ¶
func MediaPhoto(media tgo.InputFile) *tgo.InputMediaPhoto
MediaPhoto creates tgo.InputMediaPhoto with required fields
func MediaVideo ¶
func MediaVideo(media tgo.InputFile) *tgo.InputMediaVideo
MediaVideo creates tgo.InputMediaVideo with required fields
func Message ¶
func Message(id tgo.ChatID, text string) *tgo.SendMessageParams
Message creates tgo.SendMessageParams with required parameters
func MessageEntities ¶
func MessageEntities(entityCollections ...MessageEntityCollection) (string, []tgo.MessageEntity)
MessageEntities coverts entity collections into text and slice of tgo.MessageEntity associated with that text
func MessageWithEntities ¶
func MessageWithEntities(id tgo.ChatID, entityCollections ...MessageEntityCollection) *tgo.SendMessageParams
MessageWithEntities creates tgo.SendMessageParams with required parameters and parsed entities
func Messagef ¶
func Messagef(id tgo.ChatID, format string, args ...interface{}) *tgo.SendMessageParams
Messagef creates tgo.SendMessageParams with required parameters and provided format
func NameReader ¶
func NameReader(reader io.Reader, name string) ta.NamedReader
NameReader "names" io.Reader and returns valid api.NamedReader
func ParseCommand ¶
ParseCommand returns command and its arguments if any
func PollTypeAny ¶
func PollTypeAny() *tgo.KeyboardButtonPollType
PollTypeAny creates tgo.KeyboardButtonPollType with any type
func PollTypeQuiz ¶
func PollTypeQuiz() *tgo.KeyboardButtonPollType
PollTypeQuiz creates tgo.KeyboardButtonPollType with type quiz
func PollTypeRegular ¶
func PollTypeRegular() *tgo.KeyboardButtonPollType
PollTypeRegular creates tgo.KeyboardButtonPollType with type regular
func PreCheckoutQuery ¶
func PreCheckoutQuery(queryID string, ok bool) *tgo.AnswerPreCheckoutQueryParams
PreCheckoutQuery creates tgo.AnswerPreCheckoutQueryParams with required parameters
func ResultArticle ¶
func ResultArticle(id, title string, inputMessageContent tgo.InputMessageContent, ) *tgo.InlineQueryResultArticle
ResultArticle creates tgo.InlineQueryResultArticle with required fields
func ResultAudio ¶
func ResultAudio(id, audioURL, title string) *tgo.InlineQueryResultAudio
ResultAudio creates tgo.InlineQueryResultAudio with required fields
func ResultCachedAudio ¶
func ResultCachedAudio(id, audioFileID string) *tgo.InlineQueryResultCachedAudio
ResultCachedAudio creates tgo.InlineQueryResultCachedAudio with required fields
func ResultCachedDocument ¶
func ResultCachedDocument(id, title, documentFileID string) *tgo.InlineQueryResultCachedDocument
ResultCachedDocument creates tgo.InlineQueryResultCachedDocument with required fields
func ResultCachedGif ¶
func ResultCachedGif(id, gifFileID string) *tgo.InlineQueryResultCachedGif
ResultCachedGif creates tgo.InlineQueryResultCachedGif with required fields
func ResultCachedMpeg4Gif ¶
func ResultCachedMpeg4Gif(id, mpeg4FileID string) *tgo.InlineQueryResultCachedMpeg4Gif
ResultCachedMpeg4Gif creates tgo.InlineQueryResultCachedMpeg4Gif with required fields
func ResultCachedPhoto ¶
func ResultCachedPhoto(id, photoFileID string) *tgo.InlineQueryResultCachedPhoto
ResultCachedPhoto creates tgo.InlineQueryResultCachedPhoto with required fields
func ResultCachedSticker ¶
func ResultCachedSticker(id, stickerFileID string) *tgo.InlineQueryResultCachedSticker
ResultCachedSticker creates tgo.InlineQueryResultCachedSticker with required fields
func ResultCachedVideo ¶
func ResultCachedVideo(id, videoFileID, title string) *tgo.InlineQueryResultCachedVideo
ResultCachedVideo creates tgo.InlineQueryResultCachedVideo with required fields
func ResultCachedVoice ¶
func ResultCachedVoice(id, voiceFileID, title string) *tgo.InlineQueryResultCachedVoice
ResultCachedVoice creates tgo.InlineQueryResultCachedVoice with required fields
func ResultContact ¶
func ResultContact(id, phoneNumber, firstName string) *tgo.InlineQueryResultContact
ResultContact creates tgo.InlineQueryResultContact with required fields
func ResultDocument ¶
func ResultDocument(id, title, documentURL, mimeType string) *tgo.InlineQueryResultDocument
ResultDocument creates tgo.InlineQueryResultDocument with required fields
func ResultGame ¶
func ResultGame(id, gameShortName string) *tgo.InlineQueryResultGame
ResultGame creates tgo.InlineQueryResultGame with required fields
func ResultGif ¶
func ResultGif(id, gifURL, thumbURL string) *tgo.InlineQueryResultGif
ResultGif creates tgo.InlineQueryResultGif with required fields
func ResultLocation ¶
func ResultLocation(id string, latitude, longitude float64, title string) *tgo.InlineQueryResultLocation
ResultLocation creates tgo.InlineQueryResultLocation with required fields
func ResultMpeg4Gif ¶
func ResultMpeg4Gif(id, mpeg4URL, thumbURL string) *tgo.InlineQueryResultMpeg4Gif
ResultMpeg4Gif creates tgo.InlineQueryResultMpeg4Gif with required fields
func ResultPhoto ¶
func ResultPhoto(id, photoURL, thumbURL string) *tgo.InlineQueryResultPhoto
ResultPhoto creates tgo.InlineQueryResultPhoto with required fields
func ResultVenue ¶
func ResultVenue(id string, latitude, longitude float64, title, address string, ) *tgo.InlineQueryResultVenue
ResultVenue creates tgo.InlineQueryResultVenue with required fields
func ResultVideo ¶
func ResultVideo(id, videoURL, mimeType, thumbURL, title string) *tgo.InlineQueryResultVideo
ResultVideo creates tgo.InlineQueryResultVideo with required fields
func ResultVoice ¶
func ResultVoice(id, voiceURL, title string) *tgo.InlineQueryResultVoice
ResultVoice creates tgo.InlineQueryResultVoice with required fields
func ScopeAllChatAdministrators ¶
func ScopeAllChatAdministrators() *tgo.BotCommandScopeAllChatAdministrators
ScopeAllChatAdministrators creates tgo.BotCommandScopeAllChatAdministrators with required fields
func ScopeAllGroupChats ¶
func ScopeAllGroupChats() *tgo.BotCommandScopeAllGroupChats
ScopeAllGroupChats creates tgo.BotCommandScopeAllGroupChats with required fields
func ScopeAllPrivateChats ¶
func ScopeAllPrivateChats() *tgo.BotCommandScopeAllPrivateChats
ScopeAllPrivateChats creates tgo.BotCommandScopeAllPrivateChats with required fields
func ScopeChat ¶
func ScopeChat(chatID tgo.ChatID) *tgo.BotCommandScopeChat
ScopeChat creates tgo.BotCommandScopeChat with required fields
func ScopeChatAdministrators ¶
func ScopeChatAdministrators(chatID tgo.ChatID) *tgo.BotCommandScopeChatAdministrators
ScopeChatAdministrators creates tgo.BotCommandScopeChatAdministrators with required fields
func ScopeChatMember ¶
func ScopeChatMember(chatID tgo.ChatID, userID int64) *tgo.BotCommandScopeChatMember
ScopeChatMember creates tgo.BotCommandScopeChatMember with required fields
func ScopeDefault ¶
func ScopeDefault() *tgo.BotCommandScopeDefault
ScopeDefault creates tgo.BotCommandScopeDefault with required fields
func ShippingOption ¶
func ShippingOption(id, title string, prices ...tgo.LabeledPrice) tgo.ShippingOption
ShippingOption creates tgo.ShippingOption with required parameters
func ShippingQuery ¶
func ShippingQuery(queryID string, ok bool, options ...tgo.ShippingOption) *tgo.AnswerShippingQueryParams
ShippingQuery creates tgo.AnswerShippingQueryParams with required parameters
func TextMessage ¶
func TextMessage(messageText string) *tgo.InputTextMessageContent
TextMessage creates tgo.InputTextMessageContent with required fields
func UpdateProcessor ¶
func UpdateProcessor(updates <-chan tgo.Update, buffer uint, processor func(update tgo.Update) tgo.Update, ) <-chan tgo.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, tgo.Update's Clone() method can panic, please read its comment.
func ValidateWebAppData ¶
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
func VenueMessage ¶
func VenueMessage(latitude, longitude float64, title, address string) *tgo.InputVenueMessageContent
VenueMessage creates tgo.InputVenueMessageContent with required fields
func WebAppQuery ¶
func WebAppQuery(queryID string, result tgo.InlineQueryResult) *tgo.AnswerWebAppQueryParams
WebAppQuery creates tgo.AnswerWebAppQueryParams with required parameters
Types ¶
type MessageEntityCollection ¶
type MessageEntityCollection struct {
// contains filtered or unexported fields
}
MessageEntityCollection represents text and slice of tgo.MessageEntity associated with it
func Entity ¶
func Entity(text string) MessageEntityCollection
Entity creates new MessageEntityCollection with provided text and no entities
func Entityf ¶
func Entityf(format string, args ...interface{}) MessageEntityCollection
Entityf creates new MessageEntityCollection with the provided format and args and no entities
func (MessageEntityCollection) Bold ¶
func (c MessageEntityCollection) Bold() MessageEntityCollection
Bold assigns bold entity and returns new collection
func (MessageEntityCollection) BotCommand ¶
func (c MessageEntityCollection) BotCommand() MessageEntityCollection
BotCommand assigns bot command entity and returns new collection
func (MessageEntityCollection) Cashtag ¶
func (c MessageEntityCollection) Cashtag() MessageEntityCollection
Cashtag assigns cashtag entity and returns new collection
func (MessageEntityCollection) Code ¶
func (c MessageEntityCollection) Code() MessageEntityCollection
Code assigns code entity and returns new collection
func (MessageEntityCollection) CustomEmoji ¶
func (c MessageEntityCollection) CustomEmoji(emojiID string) MessageEntityCollection
CustomEmoji assigns custom emoji entity and returns new collection
func (MessageEntityCollection) Email ¶
func (c MessageEntityCollection) Email() MessageEntityCollection
Email assigns email entity and returns new collection
func (MessageEntityCollection) Entities ¶
func (c MessageEntityCollection) Entities() []tgo.MessageEntity
Entities returns message entities associated with collection
func (MessageEntityCollection) Hashtag ¶
func (c MessageEntityCollection) Hashtag() MessageEntityCollection
Hashtag assigns hashtag entity and returns new collection
func (MessageEntityCollection) Italic ¶
func (c MessageEntityCollection) Italic() MessageEntityCollection
Italic assigns italic entity and returns new collection
func (MessageEntityCollection) Mention ¶
func (c MessageEntityCollection) Mention() MessageEntityCollection
Mention assigns mention entity and returns new collection
func (MessageEntityCollection) PhoneNumber ¶
func (c MessageEntityCollection) PhoneNumber() MessageEntityCollection
PhoneNumber assigns phone number entity and returns new collection
func (MessageEntityCollection) Pre ¶
func (c MessageEntityCollection) Pre(language string) MessageEntityCollection
Pre assigns pre entity with language and returns new collection
func (MessageEntityCollection) SetOffset ¶
func (c MessageEntityCollection) SetOffset(offset int)
SetOffset sets offset for all entities
func (MessageEntityCollection) Spoiler ¶
func (c MessageEntityCollection) Spoiler() MessageEntityCollection
Spoiler assigns spoiler entity and returns new collection
func (MessageEntityCollection) Strikethrough ¶
func (c MessageEntityCollection) Strikethrough() MessageEntityCollection
Strikethrough assigns strikethrough entity and returns new collection
func (MessageEntityCollection) Text ¶
func (c MessageEntityCollection) Text() string
Text returns text associated with collection
func (MessageEntityCollection) TextLink ¶
func (c MessageEntityCollection) TextLink(url string) MessageEntityCollection
TextLink assigns text link entity with URL and returns new collection
func (MessageEntityCollection) TextMention ¶
func (c MessageEntityCollection) TextMention(user *tgo.User) MessageEntityCollection
TextMention assigns text mention entity with user and returns new collection
func (MessageEntityCollection) TextMentionWithID ¶
func (c MessageEntityCollection) TextMentionWithID(userID int64) MessageEntityCollection
TextMentionWithID assigns text mention entity with just user ID and returns new collection
func (MessageEntityCollection) URL ¶
func (c MessageEntityCollection) URL() MessageEntityCollection
URL assigns url entity and returns new collection
func (MessageEntityCollection) Underline ¶
func (c MessageEntityCollection) Underline() MessageEntityCollection
Underline assigns underline entity and returns new collection