telegoutil

package
v0.30.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 12 Imported by: 40

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

View Source
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

View Source
const (
	LoginWidgetID        = "id"
	LoginWidgetFirstName = "first_name"
	LoginWidgetLastName  = "last_name"
	LoginWidgetUsername  = "username"
	LoginWidgetPhotoURL  = "photo_url"
	LoginWidgetAuthDate  = "auth_date"
	LoginWidgetHash      = "hash"
)

Login widget data query names

View Source
const WebAppSecret = "WebAppData"

WebAppSecret represents secret used to hash web app data

Variables

This section is empty.

Functions

func Animation

func Animation(id telego.ChatID, animation telego.InputFile) *telego.SendAnimationParams

Animation creates telego.SendAnimationParams with required parameters

func Audio

Audio creates telego.SendAudioParams with required parameters

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 Document

func Document(id telego.ChatID, document telego.InputFile) *telego.SendDocumentParams

Document creates telego.SendDocumentParams with required parameters

func DownloadFile added in v0.22.1

func DownloadFile(url string) ([]byte, error)

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

func FileFromID(id string) telego.InputFile

FileFromID creates telego.InputFile from file ID

func FileFromURL added in v0.23.0

func FileFromURL(url string) telego.InputFile

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 ID

func ID(id int64) telego.ChatID

ID creates telego.ChatID from user's identifier

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 coverts 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

func Messagef(id telego.ChatID, format string, args ...any) *telego.SendMessageParams

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

func ParseCommand(text string) (cmd string, username string, args []string)

ParseCommand returns command, bot username and its arguments if any

func ParseCommandPayload added in v0.30.0

func ParseCommandPayload(text string) (cmd string, username string, payload string)

ParseCommandPayload returns command, bot username and its payload if any

func Photo

Photo creates telego.SendPhotoParams with required parameters

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 Sticker

func Sticker(id telego.ChatID, sticker telego.InputFile) *telego.SendStickerParams

Sticker creates telego.SendStickerParams 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

func UTF16TextLen(text string) int

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 Username

func Username(username string) telego.ChatID

Username creates telego.ChatID from username

func ValidateLoginWidgetData added in v0.28.0

func ValidateLoginWidgetData(token string, data string) (url.Values, error)

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

func ValidateWebAppData(token string, data string) (url.Values, error)

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 Video

Video creates telego.SendVideoParams with required parameters

func VideoNote

func VideoNote(id telego.ChatID, videoNote telego.InputFile) *telego.SendVideoNoteParams

VideoNote creates telego.SendVideoNoteParams with required parameters

func Voice

Voice creates telego.SendVoiceParams with required parameters

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

Blockquote assigns blockquote entity and returns new collection

func (MessageEntityCollection) Bold added in v0.15.2

Bold assigns bold entity and returns a new collection

func (MessageEntityCollection) BotCommand added in v0.15.2

BotCommand assigns bot command entity and returns a new collection

func (MessageEntityCollection) Cashtag added in v0.15.2

Cashtag assigns cashtag entity and returns a new collection

func (MessageEntityCollection) Code added in v0.15.2

Code assigns code entity and returns new collection

func (MessageEntityCollection) CustomEmoji added in v0.16.0

CustomEmoji assigns custom emoji entity and returns a new collection

func (MessageEntityCollection) Email added in v0.15.2

Email assigns email entity and returns a new collection

func (MessageEntityCollection) Entities added in v0.15.2

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

Hashtag assigns hashtag entity and returns a new collection

func (MessageEntityCollection) Italic added in v0.15.2

Italic assigns italic entity and returns a new collection

func (MessageEntityCollection) Mention added in v0.15.2

Mention assigns mention entity and returns new collection

func (MessageEntityCollection) PhoneNumber added in v0.15.2

PhoneNumber assigns phone number entity and returns a new collection

func (MessageEntityCollection) Pre added in v0.15.2

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

Spoiler assigns spoiler entity and returns new collection

func (MessageEntityCollection) Strikethrough added in v0.15.2

Strikethrough assigns strikethrough entity and returns a new collection

func (MessageEntityCollection) Text added in v0.15.2

Text returns text associated with a collection

TextLink assigns text link entity with URL and returns a new collection

func (MessageEntityCollection) TextMention added in v0.15.2

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

URL assigns url entity and returns a new collection

func (MessageEntityCollection) Underline added in v0.15.2

Underline assigns underline entity and returns new collection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL