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

Functions

Link copied to clipboard
infix fun String.bold(parseMode: ParseMode): String
Link copied to clipboard
fun String.boldHTML(): String
Link copied to clipboard
fun String.boldMarkdown(): String
Link copied to clipboard
fun String.boldMarkdownV2(): String
Link copied to clipboard
infix fun String.cashtag(parseMode: ParseMode): String
Link copied to clipboard
fun String.cashTagHtml(): String
Link copied to clipboard
fun String.cashTagMarkdown(): String
Link copied to clipboard
fun String.cashTagMarkdownV2(): String
Link copied to clipboard
infix fun String.code(parseMode: ParseMode): String
Link copied to clipboard
fun String.codeHTML(): String
Link copied to clipboard
fun String.codeMarkdown(): String
Link copied to clipboard
fun String.codeMarkdownV2(): String
Link copied to clipboard
infix fun String.command(parseMode: ParseMode): String
fun String.command(adapt: String.() -> String): String
Link copied to clipboard
fun String.commandHTML(): String
Link copied to clipboard
fun String.commandMarkdown(): String
Link copied to clipboard
fun String.commandMarkdownV2(): String
Link copied to clipboard
fun createFormattedText(    entities: TextSourcesList,     partLength: Int = textLength.last,     mode: ParseMode = defaultParseMode): List<String>
Link copied to clipboard
fun createHtmlText(entities: TextSourcesList, partLength: Int = textLength.last): List<String>
Link copied to clipboard
fun createMarkdownText(entities: TextSourcesList, partLength: Int = textLength.last): List<String>
Link copied to clipboard
fun createMarkdownV2Text(entities: TextSourcesList, partLength: Int = textLength.last): List<String>
Link copied to clipboard
infix fun String.email(parseMode: ParseMode): String
Link copied to clipboard
fun String.emailHTML(): String
Link copied to clipboard
fun String.emailMarkdown(): String
Link copied to clipboard
fun String.emailMarkdownV2(): String
Link copied to clipboard
infix fun String.hashTag(parseMode: ParseMode): String
Link copied to clipboard
fun String.hashTagHTML(): String
Link copied to clipboard
fun String.hashTagMarkdown(): String
Link copied to clipboard
fun String.hashTagMarkdownV2(): String
Link copied to clipboard
infix fun String.italic(parseMode: ParseMode): String
Link copied to clipboard
fun String.italicHTML(): String
Link copied to clipboard
fun String.italicMarkdown(): String
Link copied to clipboard
fun String.italicMarkdownV2(): String
Link copied to clipboard
infix fun Pair<String, String>.link(parseMode: ParseMode): String
Link copied to clipboard
fun String.linkHTML(link: String): String
Link copied to clipboard
fun String.linkMarkdown(link: String): String
Link copied to clipboard
fun String.linkMarkdownV2(link: String): String
Link copied to clipboard
inline fun makeDeepLink(username: Username, startParameter: String): String
Link copied to clipboard
inline fun makeLink(username: Username): String
Link copied to clipboard
fun makeLinkToMessage(username: Username, messageId: MessageId): String
fun makeLinkToMessage(chat: UsernameChat, messageId: MessageId): String?
fun makeLinkToMessage(username: String, messageId: MessageId): String

fun makeLinkToMessage(chat: Chat, messageId: MessageId): 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)

Link copied to clipboard
inline fun makeTelegramDeepLink(username: Username, startParameter: String): String
inline fun makeTelegramDeepLink(username: String, startParameter: String): String
Link copied to clipboard
inline fun makeTelegramStartattach(username: Username, data: String? = null): String
inline fun makeTelegramStartattach(username: String, data: String? = null): String
Link copied to clipboard
fun makeUsernameDeepLinkPrefix(username: String): String
Link copied to clipboard
fun makeUsernameLink(username: String): String
Link copied to clipboard
fun makeUsernameStartattachLink(username: String, data: String? = null): String
Link copied to clipboard
fun makeUsernameStartattachPrefix(username: String): String
Link copied to clipboard
infix fun Pair<String, ChatId>.mention(parseMode: ParseMode): String
infix fun String.mention(parseMode: ParseMode): String
Link copied to clipboard
fun String.mentionHTML(): String
Link copied to clipboard
fun String.mentionMarkdown(): String
Link copied to clipboard
fun String.mentionMarkdownV2(): String
Link copied to clipboard
infix fun String.phone(parseMode: ParseMode): String
Link copied to clipboard
fun String.phoneHTML(): String
Link copied to clipboard
fun String.phoneMarkdown(): String
Link copied to clipboard
fun String.phoneMarkdownV2(): String
Link copied to clipboard
infix fun String.pre(parseMode: ParseMode): String
fun String.pre(parseMode: ParseMode, language: String? = null): String
Link copied to clipboard
fun String.preHTML(language: String? = null): String
Link copied to clipboard
fun String.preMarkdown(language: String? = null): String
Link copied to clipboard
fun String.preMarkdownV2(language: String? = null): String
Link copied to clipboard
infix fun String.regular(parseMode: ParseMode): String
Link copied to clipboard
fun String.regularHtml(): String
Link copied to clipboard
fun String.regularMarkdown(): String
Link copied to clipboard
fun String.regularMarkdownV2(): String
Link copied to clipboard
infix fun String.strikethrough(parseMode: ParseMode): String
Link copied to clipboard
fun String.strikethroughHTML(): String
Link copied to clipboard
fun String.strikethroughMarkdown(): String

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

Link copied to clipboard
fun String.strikethroughMarkdownV2(): String
Link copied to clipboard
fun String.textMentionHTML(userId: UserId): String
Link copied to clipboard
fun String.textMentionMarkdown(userId: UserId): String
Link copied to clipboard
fun String.textMentionMarkdownV2(userId: UserId): String
Link copied to clipboard
fun TextSourcesList.toHtmlCaptions(): List<String>
Link copied to clipboard
fun TextSourcesList.toHtmlExplanations(): List<String>
Link copied to clipboard
fun TextContent.toHtmlTexts(): List<String>
fun TextSourcesList.toHtmlTexts(): List<String>
Link copied to clipboard
fun TextSourcesList.toMarkdownCaptions(): List<String>
Link copied to clipboard
fun TextSourcesList.toMarkdownExplanations(): List<String>
Link copied to clipboard
fun TextContent.toMarkdownTexts(): List<String>
fun TextSourcesList.toMarkdownTexts(): List<String>
Link copied to clipboard
fun TextSourcesList.toMarkdownV2Captions(): List<String>
Link copied to clipboard
fun TextSourcesList.toMarkdownV2Explanations(): List<String>
Link copied to clipboard
fun TextContent.toMarkdownV2Texts(): List<String>
fun TextSourcesList.toMarkdownV2Texts(): List<String>
Link copied to clipboard
infix fun String.underline(parseMode: ParseMode): String
Link copied to clipboard
fun String.underlineHTML(): String
Link copied to clipboard
fun String.underlineMarkdown(): String

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

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

Properties

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

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

Link copied to clipboard
const val markdownBoldControl: String
Link copied to clipboard
const val markdownCodeControl: String
Link copied to clipboard
const val markdownItalicControl: String
Link copied to clipboard
const val markdownPreControl: String
Link copied to clipboard
const val markdownV2ItalicEndControl: String
Link copied to clipboard
const val markdownV2ItalicUnderlineDelimiter: String
Link copied to clipboard
const val markdownV2StrikethroughControl: String
Link copied to clipboard
const val markdownV2UnderlineControl: String
Link copied to clipboard
const val markdownV2UnderlineEndControl: String
Link copied to clipboard
val Username.startattachPrefix: String
Link copied to clipboard
val StickerSetName.stickerSetLink: TextLinkTextSource