eu.vendeli.tgbot.interfaces.features.EntitiesFeature.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of telegram-bot Show documentation
Show all versions of telegram-bot Show documentation
Telegram Bot API wrapper, with handy Kotlin DSL.
package eu.vendeli.tgbot.interfaces.features
import eu.vendeli.tgbot.interfaces.IActionState
import eu.vendeli.tgbot.types.MessageEntity
import eu.vendeli.tgbot.utils.builders.EntitiesBuilder
/**
* Entities feature, see [Features article](https://github.com/vendelieu/telegram-bot/wiki/Features)
*
* @param Return Action class itself.
*/
interface EntitiesFeature : IActionState, Feature {
@Suppress("UNCHECKED_CAST")
private val thisAsReturn: Return
get() = this as Return
/**
* Entities adding DSL
*/
fun entities(block: EntitiesBuilder.() -> Unit): Return {
parameters["entities"] = EntitiesBuilder().apply(block).listOfEntities
return thisAsReturn
}
/**
* Add Entities directly
*/
fun entities(entities: List): Return {
parameters["entities"] = entities
return thisAsReturn
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy