docs / com.github.insanusmokrassar.TelegramBotAPI.extensions.api

Package com.github.insanusmokrassar.TelegramBotAPI.extensions.api

Types

(common)

BotBuilder

data class BotBuilder
(common)

LiveLocation

class LiveLocation : Closeable

Functions

(common)

delete

suspend fun Message.delete(requestsExecutor: RequestsExecutor): Boolean
(common)

deleteMessage

suspend fun RequestsExecutor.deleteMessage(chatId: ChatIdentifier, messageId: MessageIdentifier): Boolean
suspend fun RequestsExecutor.deleteMessage(chat: Chat, messageId: MessageIdentifier): Boolean
suspend fun RequestsExecutor.deleteMessage(message: Message): Boolean
(common)

forwardMessage

suspend fun RequestsExecutor.forwardMessage(fromChatId: ChatIdentifier, toChatId: ChatIdentifier, messageId: MessageIdentifier, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(fromChat: Chat, toChatId: ChatIdentifier, messageId: MessageIdentifier, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(fromChatId: ChatIdentifier, toChat: Chat, messageId: MessageIdentifier, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(fromChat: Chat, toChat: Chat, messageId: MessageIdentifier, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(toChatId: ChatIdentifier, message: Message, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(toChat: Chat, message: Message, disableNotification: Boolean = false): PossiblyForwardedMessage
(common)

getMe

suspend fun RequestsExecutor.getMe(): ExtendedBot
(common)

getUpdates

suspend fun RequestsExecutor.getUpdates(offset: UpdateIdentifier? = null, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, allowed_updates: List<String>? = ALL_UPDATES_LIST): List<Update>
suspend fun RequestsExecutor.getUpdates(lastUpdate: Update, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, allowed_updates: List<String>? = ALL_UPDATES_LIST): List<Update>
(common)

startLiveLocation

suspend fun RequestsExecutor.startLiveLocation(scope: CoroutineScope, chatId: ChatIdentifier, latitude: Double, longitude: Double, liveTimeMillis: Long = livePeriodDelayMillis, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, replyMarkup: KeyboardMarkup? = null): LiveLocation
suspend fun RequestsExecutor.startLiveLocation(scope: CoroutineScope, chat: Chat, latitude: Double, longitude: Double, liveTimeMillis: Long = livePeriodDelayMillis, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, replyMarkup: KeyboardMarkup? = null): LiveLocation
suspend fun RequestsExecutor.startLiveLocation(scope: CoroutineScope, chatId: ChatId, location: Location, liveTimeMillis: Long = livePeriodDelayMillis, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, replyMarkup: KeyboardMarkup? = null): LiveLocation
suspend fun RequestsExecutor.startLiveLocation(scope: CoroutineScope, chat: Chat, location: Location, liveTimeMillis: Long = livePeriodDelayMillis, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, replyMarkup: KeyboardMarkup? = null): LiveLocation
(common)

stopPoll

suspend fun RequestsExecutor.stopPoll(chatId: ChatIdentifier, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null): Poll
suspend fun RequestsExecutor.stopPoll(chat: Chat, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null): Poll
suspend fun RequestsExecutor.stopPoll(chatId: ChatId, message: Message, replyMarkup: InlineKeyboardMarkup? = null): Poll
suspend fun RequestsExecutor.stopPoll(chat: Chat, message: Message, replyMarkup: InlineKeyboardMarkup? = null): Poll
(common)

telegramBot

fun telegramBot(token: String, block: BotBuilder.() -> Unit): RequestsExecutor

Allows to create bot using bot urlsKeeper and already prepared client

fun telegramBot(urlsKeeper: TelegramAPIUrlsKeeper, client: HttpClient): RequestsExecutor

Allows to create bot using bot token

fun telegramBot(token: String): RequestsExecutor

Allows to create bot using bot token and already prepared client

fun telegramBot(token: String, client: HttpClient): RequestsExecutor

Allows to create bot using bot token and specify HttpClientEngine by passing clientEngine param and optionally configure HttpClient using clientConfig

fun telegramBot(token: String, clientEngine: HttpClientEngine, clientConfig: HttpClientConfig<*>.() -> Unit = {}): RequestsExecutor
(common)

telegramBotWithCustomClientConfig

Allows to create bot using bot urlsKeeper and specify HttpClientEngine by passing clientEngine param and optionally configure HttpClient using clientConfig

fun telegramBotWithCustomClientConfig(urlsKeeper: TelegramAPIUrlsKeeper, clientEngine: HttpClientEngine, clientConfig: HttpClientConfig<*>.() -> Unit = {}): RequestsExecutor

Allows to create bot using bot urlsKeeper and optionally configure HttpClient using clientConfig

fun telegramBotWithCustomClientConfig(urlsKeeper: TelegramAPIUrlsKeeper, clientConfig: HttpClientConfig<*>.() -> Unit = {}): RequestsExecutor

Allows to create bot using bot token and configure HttpClient using clientConfig

fun telegramBotWithCustomClientConfig(token: String, clientConfig: HttpClientConfig<*>.() -> Unit): RequestsExecutor