mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-18 04:50:20 +00:00
rework in part of text message entities
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.MessageEntity
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.fullListOfSubSource
|
||||
|
||||
interface Captioned {
|
||||
val caption: String?
|
||||
@@ -12,5 +12,7 @@ interface CaptionedOutput : Captioned {
|
||||
}
|
||||
|
||||
interface CaptionedInput : Captioned {
|
||||
val captionEntities: List<MessageEntity>
|
||||
val captionEntities: List<TextPart>
|
||||
}
|
||||
|
||||
fun CaptionedInput.fullEntitiesList() = caption ?.fullListOfSubSource(captionEntities) ?.map { it.source } ?: emptyList()
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
|
||||
|
||||
interface TextSource {
|
||||
val rawSource: String
|
||||
val asMarkdownSource: String
|
||||
val asMarkdownV2Source: String
|
||||
val asHtmlSource: String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface MultilevelTextSource : TextSource {
|
||||
val textParts: List<TextPart>
|
||||
}
|
||||
|
||||
data class TextPart(
|
||||
val range: IntRange,
|
||||
val source: TextSource
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user