styling

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 3 Imported by: 41

Documentation

Overview

Package styling contains styling options for Telegram messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Perform

func Perform(builder *entity.Builder, texts ...StyledTextOption) error

Perform performs all options to the given builder.

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 Plain

func Plain(s string) StyledTextOption

Plain formats text without any entities.

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.

Jump to

Keyboard shortcuts

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