Documentation ¶
Overview ¶
Package styling contains styling options for Telegram messages.
Index ¶
- func Perform(builder *entity.Builder, texts ...StyledTextOption) error
- type StyledTextOption
- func BankCard(s string) StyledTextOption
- func Blockquote(s string) StyledTextOption
- func Bold(s string) StyledTextOption
- func BotCommand(s string) StyledTextOption
- func Cashtag(s string) StyledTextOption
- func Code(s string) StyledTextOption
- func Custom(cb func(eb *entity.Builder) error) StyledTextOption
- func Email(s string) StyledTextOption
- func Hashtag(s string) StyledTextOption
- func Italic(s string) StyledTextOption
- func Mention(s string) StyledTextOption
- func MentionName(s string, userID tg.InputUserClass) StyledTextOption
- func Phone(s string) StyledTextOption
- func Plain(s string) StyledTextOption
- func Pre(s string) StyledTextOption
- func PreLang(s, lang string) StyledTextOption
- func Strike(s string) StyledTextOption
- func TextURL(s, url string) StyledTextOption
- func URL(s string) StyledTextOption
- func Underline(s string) StyledTextOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StyledTextOption ¶
type StyledTextOption struct {
// contains filtered or unexported fields
}
StyledTextOption is a option for styling text.
func BankCard ¶
func BankCard(s string) StyledTextOption
BankCard formats text as BankCard entity. See https://core.telegram.org/constructor/messageEntityBankCard.
func Blockquote ¶
func Blockquote(s string) StyledTextOption
Blockquote formats text as Blockquote entity. See https://core.telegram.org/constructor/messageEntityBlockquote.
func Bold ¶
func Bold(s string) StyledTextOption
Bold formats text as Bold entity. See https://core.telegram.org/constructor/messageEntityBold.
func BotCommand ¶
func BotCommand(s string) StyledTextOption
BotCommand formats text as BotCommand entity. See https://core.telegram.org/constructor/messageEntityBotCommand.
func Cashtag ¶
func Cashtag(s string) StyledTextOption
Cashtag formats text as Cashtag entity. See https://core.telegram.org/constructor/messageEntityCashtag.
func Code ¶
func Code(s string) StyledTextOption
Code formats text as Code entity. See https://core.telegram.org/constructor/messageEntityCode.
func Custom ¶
func Custom(cb func(eb *entity.Builder) error) StyledTextOption
Custom formats text using given callback.
func Email ¶
func Email(s string) StyledTextOption
Email formats text as Email entity. See https://core.telegram.org/constructor/messageEntityEmail.
func Hashtag ¶
func Hashtag(s string) StyledTextOption
Hashtag formats text as Hashtag entity. See https://core.telegram.org/constructor/messageEntityHashtag.
func Italic ¶
func Italic(s string) StyledTextOption
Italic formats text as Italic entity. See https://core.telegram.org/constructor/messageEntityItalic.
func Mention ¶
func Mention(s string) StyledTextOption
Mention formats text as Mention entity. See https://core.telegram.org/constructor/messageEntityMention.
func MentionName ¶
func MentionName(s string, userID tg.InputUserClass) StyledTextOption
MentionName formats text as MentionName entity. See https://core.telegram.org/constructor/messageEntityMentionName.
func Phone ¶
func Phone(s string) StyledTextOption
Phone formats text as Phone entity. See https://core.telegram.org/constructor/messageEntityPhone.
func Pre ¶
func Pre(s string) StyledTextOption
Pre formats text as Pre entity (without language). See https://core.telegram.org/constructor/messageEntityPre.
Use PreLang to pass language.
func PreLang ¶ added in v0.32.0
func PreLang(s, lang string) StyledTextOption
PreLang formats text as Pre entity with language. See https://core.telegram.org/constructor/messageEntityPre.
func Strike ¶
func Strike(s string) StyledTextOption
Strike formats text as Strike entity. See https://core.telegram.org/constructor/messageEntityStrike.
func TextURL ¶
func TextURL(s, url string) StyledTextOption
TextURL formats text as TextURL entity. See https://core.telegram.org/constructor/messageEntityUrl.
func URL ¶
func URL(s string) StyledTextOption
URL formats text as URL entity. See https://core.telegram.org/constructor/messageEntityUrl.
func Underline ¶
func Underline(s string) StyledTextOption
Underline formats text as Underline entity. See https://core.telegram.org/constructor/messageEntityUnderline.
func (StyledTextOption) Zero ¶
func (s StyledTextOption) Zero() bool
Zero returns true if option is zero value.