# com.github.insanusmokrassar.TelegramBotAPI.utils - docs

docs / com.github.insanusmokrassar.TelegramBotAPI.utils

## Package com.github.insanusmokrassar.TelegramBotAPI.utils

### Types

(common)

#### MatrixBuilder

`class MatrixBuilder<T>`

#### MimeType

(common, js) `class MimeType`
(jvm) `class MimeType : MimeType`

(common)

#### RowBuilder

`class RowBuilder<T>`

(common)

#### StorageFile

`data class StorageFile`

(common)

#### StorageFileInfo

`data class StorageFileInfo`

(common)

#### TelegramAPIUrlsKeeper

`class TelegramAPIUrlsKeeper`

### Annotations

(common)

#### PreviewFeature

`annotation class PreviewFeature`

### Extensions for External Classes

(common)

#### kotlin.collections.List

(common)

#### kotlin.collections.Map

(common)

#### kotlin.Pair

(common)

#### kotlin.String

(common)

#### kotlinx.serialization.json.JsonArray

(common)

#### kotlinx.serialization.json.JsonObject

### Properties

(common)

#### htmlBoldControl

`const val htmlBoldControl: String`

(common)

#### htmlCodeControl

`const val htmlCodeControl: String`

(common)

#### htmlItalicControl

`const val htmlItalicControl: String`

(common)

#### htmlPreControl

`const val htmlPreControl: String`

(common)

#### htmlStrikethroughControl

`const val htmlStrikethroughControl: String`

(common)

#### htmlUnderlineControl

`const val htmlUnderlineControl: String`

(common)

#### markdownBoldControl

`const val markdownBoldControl: String`

(common)

#### markdownCodeControl

`const val markdownCodeControl: String`

(common)

#### markdownItalicControl

`const val markdownItalicControl: String`

(common)

#### markdownPreControl

`const val markdownPreControl: String`

(common)

#### markdownV2ItalicEndControl

`const val markdownV2ItalicEndControl: String`

(common)

#### markdownV2ItalicUnderlineDelimiter

`const val markdownV2ItalicUnderlineDelimiter: String`

(common)

#### markdownV2StrikethroughControl

`const val markdownV2StrikethroughControl: String`

(common)

#### markdownV2UnderlineControl

`const val markdownV2UnderlineControl: String`

(common)

#### markdownV2UnderlineEndControl

`const val markdownV2UnderlineEndControl: String`

### Functions

(common)

#### createFormattedText

`fun createFormattedText(entities: FullTextSourcesList, partLength: Int = 4096, mode: ParseMode = MarkdownParseMode): List<String>`

(common)

#### createHtmlText

`fun createHtmlText(entities: FullTextSourcesList, partLength: Int = 4096): List<String>`

(common)

#### createMarkdownText

`fun createMarkdownText(entities: FullTextSourcesList, partLength: Int = 4096): List<String>`

(common)

#### createMarkdownV2Text

`fun createMarkdownV2Text(entities: FullTextSourcesList, partLength: Int = 4096): List<String>`

(common)

#### handleSafely

It will run block inside of supervisorScope to avoid problems with catching of exceptions

`suspend fun <T> handleSafely(onException: suspend (Exception) -> T = { throw it }, block: suspend CoroutineScope.() -> T): T`

(common)

#### makeLinkToMessage

`fun makeLinkToMessage(username: String, messageId: MessageIdentifier): String`
`fun makeLinkToMessage(chat: ExtendedChat, messageId: MessageIdentifier): String?`

(common)

#### mapOfNotNull

`fun <K, V> mapOfNotNull(vararg pairs: Pair<K, V?>): Map<K, V>`

(common)

#### matrix

`fun <T> matrix(block: MatrixBuilder<T>.() -> Unit): Matrix<T>`

(common)

#### row

`fun <T> row(block: RowBuilder<T>.() -> Unit): List<T>`
`fun <T> MatrixBuilder<T>.row(block: RowBuilder<T>.() -> Unit): Unit`

(jvm)

#### StorageFile

`fun StorageFile(file: File): StorageFile`

(common)

#### toHtmlCaptions

`fun CaptionedInput.toHtmlCaptions(): List<String>`

(common)

#### toHtmlExplanations

`fun ExplainedInput.toHtmlExplanations(): List<String>`

(common)

#### toHtmlTexts

`fun TextContent.toHtmlTexts(): List<String>`

(common)

#### toJson

`fun <T : Any> T.toJson(serializer: SerializationStrategy<T>): JsonObject`

(common)

#### toJsonWithoutNulls

`fun <T : Any> T.toJsonWithoutNulls(serializer: SerializationStrategy<T>): JsonObject`

(common)

#### toMarkdownCaptions

`fun CaptionedInput.toMarkdownCaptions(): List<String>`

(common)

#### toMarkdownExplanations

`fun ExplainedInput.toMarkdownExplanations(): List<String>`

(common)

#### toMarkdownTexts

`fun TextContent.toMarkdownTexts(): List<String>`

(common)

#### toMarkdownV2Captions

`fun CaptionedInput.toMarkdownV2Captions(): List<String>`

(common)

#### toMarkdownV2Explanations

`fun ExplainedInput.toMarkdownV2Explanations(): List<String>`

(common)

#### toMarkdownV2Texts

`fun TextContent.toMarkdownV2Texts(): List<String>`