entity

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 4 Imported by: 21

Documentation

Overview

Package entity contains message formatting and styling helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder builds message string and text entities.

func (*Builder) BankCard

func (b *Builder) BankCard(s string) *Builder

BankCard formats message as formats message entity. See https://core.telegram.org/constructor/messageEntityBankCard.

func (*Builder) Blockquote

func (b *Builder) Blockquote(s string) *Builder

Blockquote formats message as Blockquote message entity. See https://core.telegram.org/constructor/messageEntityBlockquote.

func (*Builder) Bold

func (b *Builder) Bold(s string) *Builder

Bold formats message as Bold message entity. See https://core.telegram.org/constructor/messageEntityBold.

func (*Builder) BotCommand

func (b *Builder) BotCommand(s string) *Builder

BotCommand formats message as BotCommand message entity. See https://core.telegram.org/constructor/messageEntityBotCommand.

func (*Builder) Cashtag

func (b *Builder) Cashtag(s string) *Builder

Cashtag formats message as Cashtag message entity. See https://core.telegram.org/constructor/messageEntityCashtag.

func (*Builder) Code

func (b *Builder) Code(s string) *Builder

Code formats message as Code message entity. See https://core.telegram.org/constructor/messageEntityCode.

func (*Builder) Complete

func (b *Builder) Complete() (string, []tg.MessageEntityClass)

Complete returns build result and resets builder.

func (*Builder) Email

func (b *Builder) Email(s string) *Builder

Email formats message as Email message entity. See https://core.telegram.org/constructor/messageEntityEmail.

func (*Builder) GrowEntities

func (b *Builder) GrowEntities(n int)

GrowEntities grows internal buffer capacity.

func (*Builder) GrowText

func (b *Builder) GrowText(n int)

GrowText grows internal buffer capacity.

func (*Builder) Hashtag

func (b *Builder) Hashtag(s string) *Builder

Hashtag formats message as Hashtag message entity. See https://core.telegram.org/constructor/messageEntityHashtag.

func (*Builder) Italic

func (b *Builder) Italic(s string) *Builder

Italic formats message as Italic message entity. See https://core.telegram.org/constructor/messageEntityItalic.

func (*Builder) Mention

func (b *Builder) Mention(s string) *Builder

Mention formats message as Mention message entity. See https://core.telegram.org/constructor/messageEntityMention.

func (*Builder) MentionName

func (b *Builder) MentionName(s string, userID int) *Builder

MentionName formats message as MentionName message entity. See https://core.telegram.org/constructor/messageEntityMentionName.

func (*Builder) Phone

func (b *Builder) Phone(s string) *Builder

Phone formats message as Phone message entity. See https://core.telegram.org/constructor/messageEntityPhone.

func (*Builder) Plain

func (b *Builder) Plain(s string) *Builder

Plain formats message as plain text.

func (*Builder) Pre

func (b *Builder) Pre(s, lang string) *Builder

Pre formats message as Pre message entity. See https://core.telegram.org/constructor/messageEntityPre.

func (*Builder) Strike

func (b *Builder) Strike(s string) *Builder

Strike formats message as Strike message entity. See https://core.telegram.org/constructor/messageEntityStrike.

func (*Builder) TextURL

func (b *Builder) TextURL(s, url string) *Builder

TextURL formats message as TextUrl message entity. See https://core.telegram.org/constructor/messageEntityTextUrl.

func (*Builder) URL

func (b *Builder) URL(s string) *Builder

URL formats message as Url message entity. See https://core.telegram.org/constructor/messageEntityUrl.

func (*Builder) Underline

func (b *Builder) Underline(s string) *Builder

Underline formats message as Underline message entity. See https://core.telegram.org/constructor/messageEntityUnderline.

Jump to

Keyboard shortcuts

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