Package dev.inmo.tgbotapi.extensions.utils.formatting

Types

EntitiesBuilder
Link copied to clipboard

This builder can be used to provide building of TextSources List

common
class EntitiesBuilder

Functions

bold
Link copied to clipboard
common
inline fun EntitiesBuilder.bold(vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.bold(text: String)
inline fun EntitiesBuilder.bold(parts: List<TextSource>)
infix fun String.bold(parseMode: ParseMode): String
boldHTML
Link copied to clipboard
common
fun String.boldHTML(): String
boldMarkdown
Link copied to clipboard
common
fun String.boldMarkdown(): String
boldMarkdownV2
Link copied to clipboard
common
fun String.boldMarkdownV2(): String
botCommand
Link copied to clipboard
common
inline fun EntitiesBuilder.botCommand(command: String)
buildEntities
Link copied to clipboard
common
fun buildEntities(init: EntitiesBuilder.() -> Unit): List<TextSource>
cashTag
Link copied to clipboard
common
infix fun String.cashtag(parseMode: ParseMode): String
cashTagHtml
Link copied to clipboard
common
fun String.cashTagHtml(): String
cashTagMarkdown
Link copied to clipboard
common
fun String.cashTagMarkdown(): String
cashTagMarkdownV2
Link copied to clipboard
common
fun String.cashTagMarkdownV2(): String
code
Link copied to clipboard
common
inline fun EntitiesBuilder.code(code: String)
infix fun String.code(parseMode: ParseMode): String
codeHTML
Link copied to clipboard
common
fun String.codeHTML(): String
codeMarkdown
Link copied to clipboard
common
fun String.codeMarkdown(): String
codeMarkdownV2
Link copied to clipboard
common
fun String.codeMarkdownV2(): String
command
Link copied to clipboard
common
infix fun String.command(parseMode: ParseMode): String
fun String.command(adapt: String.() -> String): String
commandHTML
Link copied to clipboard
common
fun String.commandHTML(): String
commandMarkdown
Link copied to clipboard
common
fun String.commandMarkdown(): String
commandMarkdownV2
Link copied to clipboard
common
fun String.commandMarkdownV2(): String
createFormattedText
Link copied to clipboard
common
fun createFormattedText(entities: List<TextSource>, partLength: Int, mode: ParseMode): List<String>
createHtmlText
Link copied to clipboard
common
fun createHtmlText(entities: List<TextSource>, partLength: Int): List<String>
createMarkdownText
Link copied to clipboard
common
fun createMarkdownText(entities: List<TextSource>, partLength: Int): List<String>
createMarkdownV2Text
Link copied to clipboard
common
fun createMarkdownV2Text(entities: List<TextSource>, partLength: Int): List<String>
email
Link copied to clipboard
common
inline fun EntitiesBuilder.email(vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.email(emailAddress: String)
inline fun EntitiesBuilder.email(parts: List<TextSource>)
infix fun String.email(parseMode: ParseMode): String
emailHTML
Link copied to clipboard
common
fun String.emailHTML(): String
emailMarkdown
Link copied to clipboard
common
fun String.emailMarkdown(): String
emailMarkdownV2
Link copied to clipboard
common
fun String.emailMarkdownV2(): String
hashTag
Link copied to clipboard
common
inline fun EntitiesBuilder.hashtag(vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.hashtag(hashtag: String)
inline fun EntitiesBuilder.hashtag(parts: List<TextSource>)
hashTagHTML
Link copied to clipboard
common
fun String.hashTagHTML(): String
hashTagMarkdown
Link copied to clipboard
common
fun String.hashTagMarkdown(): String
hashTagMarkdownV2
Link copied to clipboard
common
fun String.hashTagMarkdownV2(): String
italic
Link copied to clipboard
common
inline fun EntitiesBuilder.italic(vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.italic(text: String)
inline fun EntitiesBuilder.italic(parts: List<TextSource>)
infix fun String.italic(parseMode: ParseMode): String
italicHTML
Link copied to clipboard
common
fun String.italicHTML(): String
italicMarkdown
Link copied to clipboard
common
fun String.italicMarkdown(): String
italicMarkdownV2
Link copied to clipboard
common
fun String.italicMarkdownV2(): String
link
Link copied to clipboard
common
inline fun EntitiesBuilder.link(url: String)
infix fun Pair<String, String>.link(parseMode: ParseMode): String
inline fun EntitiesBuilder.link(text: String, url: String)
linkHTML
Link copied to clipboard
common
fun String.linkHTML(link: String): String
linkMarkdown
Link copied to clipboard
common
fun String.linkMarkdown(link: String): String
linkMarkdownV2
Link copied to clipboard
common
fun String.linkMarkdownV2(link: String): String
makeLink
Link copied to clipboard
common
inline fun makeLink(username: Username): String
makeLinkToMessage
Link copied to clipboard
common
fun makeLinkToMessage(username: Username, messageId: Long): String
fun makeLinkToMessage(chat: UsernameChat, messageId: Long): String?
fun makeLinkToMessage(username: String, messageId: Long): String

Link which can be used as by any user to get access to Message. Returns null in case when there are no known way to build link (for PrivateChats, for example)

common
fun makeLinkToMessage(chat: Chat, messageId: Long): String?
makeUsernameLink
Link copied to clipboard
common
fun makeUsernameLink(username: String): String
mention
Link copied to clipboard
common
inline fun EntitiesBuilder.mention(vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.mention(whoToMention: String)
inline fun EntitiesBuilder.mention(parts: List<TextSource>)
infix fun Pair<String, ChatId>.mention(parseMode: ParseMode): String
infix fun String.mention(parseMode: ParseMode): String
inline fun EntitiesBuilder.mention(user: User, vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.mention(text: String, user: User)
inline fun EntitiesBuilder.mention(parts: List<TextSource>, user: User)
mentionHTML
Link copied to clipboard
common
fun String.mentionHTML(): String
mentionMarkdown
Link copied to clipboard
common
fun String.mentionMarkdown(): String
mentionMarkdownV2
Link copied to clipboard
common
fun String.mentionMarkdownV2(): String
phone
Link copied to clipboard
common
inline fun EntitiesBuilder.phone(vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.phone(number: String)
inline fun EntitiesBuilder.phone(parts: List<TextSource>)
infix fun String.phone(parseMode: ParseMode): String
phoneHTML
Link copied to clipboard
common
fun String.phoneHTML(): String
phoneMarkdown
Link copied to clipboard
common
fun String.phoneMarkdown(): String
phoneMarkdownV2
Link copied to clipboard
common
fun String.phoneMarkdownV2(): String
pre
Link copied to clipboard
common
infix fun String.pre(parseMode: ParseMode): String
inline fun EntitiesBuilder.pre(code: String, language: String?)
fun String.pre(parseMode: ParseMode, language: String?): String
preHTML
Link copied to clipboard
common
fun String.preHTML(language: String?): String
preMarkdown
Link copied to clipboard
common
fun String.preMarkdown(language: String?): String
preMarkdownV2
Link copied to clipboard
common
fun String.preMarkdownV2(language: String?): String
regular
Link copied to clipboard
common
inline fun EntitiesBuilder.regular(text: String)
infix fun String.regular(parseMode: ParseMode): String
regularHtml
Link copied to clipboard
common
fun String.regularHtml(): String
regularMarkdown
Link copied to clipboard
common
fun String.regularMarkdown(): String
regularMarkdownV2
Link copied to clipboard
common
fun String.regularMarkdownV2(): String
strikethrough
Link copied to clipboard
common
inline fun EntitiesBuilder.strikethrough(vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.strikethrough(text: String)
inline fun EntitiesBuilder.strikethrough(parts: List<TextSource>)
infix fun String.strikethrough(parseMode: ParseMode): String
strikethroughHTML
Link copied to clipboard
common
fun String.strikethroughHTML(): String
strikethroughMarkdown
Link copied to clipboard

Crutch for support of strikethrough in default markdown. Simply add modifier, but it will not look like correct

common
fun String.strikethroughMarkdown(): String
strikethroughMarkdownV2
Link copied to clipboard
common
fun String.strikethroughMarkdownV2(): String
textMentionHTML
Link copied to clipboard
common
fun String.textMentionHTML(userId: ChatId): String
textMentionMarkdown
Link copied to clipboard
common
fun String.textMentionMarkdown(userId: ChatId): String
textMentionMarkdownV2
Link copied to clipboard
common
fun String.textMentionMarkdownV2(userId: ChatId): String
toHtmlCaptions
Link copied to clipboard
common
fun CaptionedInput.toHtmlCaptions(): List<String>
fun List<TextSource>.toHtmlCaptions(): List<String>
toHtmlExplanations
Link copied to clipboard
common
fun ExplainedInput.toHtmlExplanations(): List<String>
fun List<TextSource>.toHtmlExplanations(): List<String>
toHtmlTexts
Link copied to clipboard
common
fun TextContent.toHtmlTexts(): List<String>
fun List<TextSource>.toHtmlTexts(): List<String>
toMarkdownCaptions
Link copied to clipboard
common
fun CaptionedInput.toMarkdownCaptions(): List<String>
fun List<TextSource>.toMarkdownCaptions(): List<String>
toMarkdownExplanations
Link copied to clipboard
common
fun ExplainedInput.toMarkdownExplanations(): List<String>
fun List<TextSource>.toMarkdownExplanations(): List<String>
toMarkdownTexts
Link copied to clipboard
common
fun TextContent.toMarkdownTexts(): List<String>
fun List<TextSource>.toMarkdownTexts(): List<String>
toMarkdownV2Captions
Link copied to clipboard
common
fun CaptionedInput.toMarkdownV2Captions(): List<String>
fun List<TextSource>.toMarkdownV2Captions(): List<String>
toMarkdownV2Explanations
Link copied to clipboard
common
fun ExplainedInput.toMarkdownV2Explanations(): List<String>
fun List<TextSource>.toMarkdownV2Explanations(): List<String>
toMarkdownV2Texts
Link copied to clipboard
common
fun TextContent.toMarkdownV2Texts(): List<String>
fun List<TextSource>.toMarkdownV2Texts(): List<String>
underline
Link copied to clipboard
common
inline fun EntitiesBuilder.underline(vararg parts: Array<Out TextSource>)
inline fun EntitiesBuilder.underline(text: String)
inline fun EntitiesBuilder.underline(parts: List<TextSource>)
infix fun String.underline(parseMode: ParseMode): String
underlineHTML
Link copied to clipboard
common
fun String.underlineHTML(): String
underlineMarkdown
Link copied to clipboard

Crutch for support of underline in default markdown. Simply add modifier, but it will not look like correct

common
fun String.underlineMarkdown(): String
underlineMarkdownV2
Link copied to clipboard
common
fun String.underlineMarkdownV2(): String

Properties

htmlBoldControl
Link copied to clipboard
const val htmlBoldControl: String
htmlCodeControl
Link copied to clipboard
const val htmlCodeControl: String
htmlItalicControl
Link copied to clipboard
const val htmlItalicControl: String
htmlPreControl
Link copied to clipboard
const val htmlPreControl: String
htmlStrikethroughControl
Link copied to clipboard
const val htmlStrikethroughControl: String
htmlUnderlineControl
Link copied to clipboard
const val htmlUnderlineControl: String
link
Link copied to clipboard
val Username.link: String
link
Link copied to clipboard

val Message.link: String?
link
Link copied to clipboard

Link which can be used as by any user to get access to Chat. Returns null in case when there are no known way to build link

val Chat.link: String?
markdownBoldControl
Link copied to clipboard
const val markdownBoldControl: String
markdownCodeControl
Link copied to clipboard
const val markdownCodeControl: String
markdownItalicControl
Link copied to clipboard
const val markdownItalicControl: String
markdownPreControl
Link copied to clipboard
const val markdownPreControl: String
markdownV2ItalicEndControl
Link copied to clipboard
const val markdownV2ItalicEndControl: String
markdownV2ItalicUnderlineDelimiter
Link copied to clipboard
const val markdownV2ItalicUnderlineDelimiter: String
markdownV2StrikethroughControl
Link copied to clipboard
const val markdownV2StrikethroughControl: String
markdownV2UnderlineControl
Link copied to clipboard
const val markdownV2UnderlineControl: String
markdownV2UnderlineEndControl
Link copied to clipboard
const val markdownV2UnderlineEndControl: String
stickerSetLink
Link copied to clipboard
val String.stickerSetLink: TextLinkTextSource