7a04f298d2
- update to latest telegram layer - remove some references to fields in tg.Entities that don't exist in the schema - originally added here: https://github.com/beeper/td/commit/820929062a2ba0104397bc01235ab58a9cff780e - referenced here - https://github.com/mautrix/telegramgo/commit/124f0967ed195b5a380c9bd02e170ada9710dde3 - https://github.com/mautrix/telegramgo/commit/4205047aab2e0639217148b5d125bfaab668bd8e
214 lines
5.1 KiB
Go
Generated
214 lines
5.1 KiB
Go
Generated
// Code generated by mkentity, DO NOT EDIT.
|
|
package styling
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tg"
|
|
)
|
|
|
|
var (
|
|
_ = tg.Invoker(nil)
|
|
_ = context.Context(nil)
|
|
)
|
|
|
|
// Unknown formats text as Unknown entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityUnknown.
|
|
func Unknown(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Unknown(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Mention formats text as Mention entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityMention.
|
|
func Mention(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Mention(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Hashtag formats text as Hashtag entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityHashtag.
|
|
func Hashtag(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Hashtag(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// BotCommand formats text as BotCommand entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityBotCommand.
|
|
func BotCommand(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.BotCommand(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// URL formats text as URL entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityUrl.
|
|
func URL(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.URL(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Email formats text as Email entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityEmail.
|
|
func Email(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Email(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Bold formats text as Bold entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityBold.
|
|
func Bold(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Bold(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Italic formats text as Italic entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityItalic.
|
|
func Italic(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Italic(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Code formats text as Code entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityCode.
|
|
func Code(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Code(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Pre formats text as Pre entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityPre.
|
|
func Pre(s string, language string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Pre(s, language)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// TextURL formats text as TextURL entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityTextUrl.
|
|
func TextURL(s string, uRL string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.TextURL(s, uRL)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// MentionName formats text as MentionName entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/inputMessageEntityMentionName.
|
|
func MentionName(s string, userID tg.InputUserClass) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.MentionName(s, userID)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Phone formats text as Phone entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityPhone.
|
|
func Phone(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Phone(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Cashtag formats text as Cashtag entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityCashtag.
|
|
func Cashtag(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Cashtag(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Underline formats text as Underline entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityUnderline.
|
|
func Underline(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Underline(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Strike formats text as Strike entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityStrike.
|
|
func Strike(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Strike(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// BankCard formats text as BankCard entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityBankCard.
|
|
func BankCard(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.BankCard(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Spoiler formats text as Spoiler entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntitySpoiler.
|
|
func Spoiler(s string) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Spoiler(s)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// CustomEmoji formats text as CustomEmoji entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityCustomEmoji.
|
|
func CustomEmoji(s string, documentID int64) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.CustomEmoji(s, documentID)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
// Blockquote formats text as Blockquote entity.
|
|
//
|
|
// See https://core.telegram.org/constructor/messageEntityBlockquote.
|
|
func Blockquote(s string, collapsed bool) StyledTextOption {
|
|
return styledTextOption(s, func(b *textBuilder) error {
|
|
b.Blockquote(s, collapsed)
|
|
return nil
|
|
})
|
|
}
|