Package dev.inmo.tgbotapi.extensions.api

Types

BotBuilder
Link copied to clipboard
common
data class BotBuilder
LiveLocationProvider
Link copied to clipboard
class LiveLocationProvider : Closeable
class LiveLocationProvider : Closeable

Functions

close
Link copied to clipboard
common
inline suspend fun RequestsExecutor.close(): Boolean
delete
Link copied to clipboard
common
suspend fun Message.delete(requestsExecutor: RequestsExecutor): Boolean
deleteMessage
Link copied to clipboard
common
suspend fun RequestsExecutor.deleteMessage(message: Message): Boolean
suspend fun RequestsExecutor.deleteMessage(chatId: ChatIdentifier, messageId: Long): Boolean
suspend fun RequestsExecutor.deleteMessage(chat: Chat, messageId: Long): Boolean
downloadFile
Link copied to clipboard
common
suspend fun RequestsExecutor.downloadFile(fileId: FileId): ByteArray
suspend fun RequestsExecutor.downloadFile(pathedFile: PathedFile): ByteArray
suspend fun RequestsExecutor.downloadFile(file: TelegramMediaFile): ByteArray
suspend fun RequestsExecutor.downloadFile(filePath: String): ByteArray
forwardMessage
Link copied to clipboard
common
suspend fun RequestsExecutor.forwardMessage(toChatId: ChatIdentifier, message: Message, disableNotification: Boolean): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(toChat: Chat, message: Message, disableNotification: Boolean): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(fromChatId: ChatIdentifier, toChatId: ChatIdentifier, messageId: Long, disableNotification: Boolean): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(fromChatId: ChatIdentifier, toChat: Chat, messageId: Long, disableNotification: Boolean): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(fromChat: Chat, toChatId: ChatIdentifier, messageId: Long, disableNotification: Boolean): PossiblyForwardedMessage
suspend fun RequestsExecutor.forwardMessage(fromChat: Chat, toChat: Chat, messageId: Long, disableNotification: Boolean): PossiblyForwardedMessage
getUpdates
Link copied to clipboard
common
suspend fun RequestsExecutor.getUpdates(lastUpdate: Update, limit: Int, timeout: Int?, allowed_updates: List<String>?): List<Update>
suspend fun RequestsExecutor.getUpdates(offset: Long?, limit: Int, timeout: Int?, allowed_updates: List<String>?): List<Update>
logOut
Link copied to clipboard
common
inline suspend fun RequestsExecutor.logOut(): Boolean
replyWithLiveLocation
Link copied to clipboard
common
inline suspend fun RequestsExecutor.replyWithLiveLocation(to: Message, scope: CoroutineScope, location: StaticLocation, liveTimeMillis: Long, initHorizontalAccuracy: Float?, initHeading: Int?, initProximityAlertRadius: Float?, disableNotification: Boolean, allowSendingWithoutReply: Boolean?, replyMarkup: KeyboardMarkup?): LiveLocationProvider
inline suspend fun RequestsExecutor.replyWithLiveLocation(to: Message, scope: CoroutineScope, latitude: Double, longitude: Double, liveTimeMillis: Long, initHorizontalAccuracy: Float?, initHeading: Int?, initProximityAlertRadius: Float?, disableNotification: Boolean, allowSendingWithoutReply: Boolean?, replyMarkup: KeyboardMarkup?): LiveLocationProvider
startLiveLocation
Link copied to clipboard
common
suspend fun RequestsExecutor.startLiveLocation(scope: CoroutineScope, chatId: ChatId, location: StaticLocation, liveTimeMillis: Long, initHorizontalAccuracy: Float?, initHeading: Int?, initProximityAlertRadius: Float?, disableNotification: Boolean, replyToMessageId: Long?, allowSendingWithoutReply: Boolean?, replyMarkup: KeyboardMarkup?): LiveLocationProvider
suspend fun RequestsExecutor.startLiveLocation(scope: CoroutineScope, chat: Chat, location: StaticLocation, liveTimeMillis: Long, initHorizontalAccuracy: Float?, initHeading: Int?, initProximityAlertRadius: Float?, disableNotification: Boolean, replyToMessageId: Long?, allowSendingWithoutReply: Boolean?, replyMarkup: KeyboardMarkup?): LiveLocationProvider
suspend fun RequestsExecutor.startLiveLocation(scope: CoroutineScope, chatId: ChatIdentifier, latitude: Double, longitude: Double, liveTimeMillis: Long, initHorizontalAccuracy: Float?, initHeading: Int?, initProximityAlertRadius: Float?, disableNotification: Boolean, replyToMessageId: Long?, allowSendingWithoutReply: Boolean?, replyMarkup: KeyboardMarkup?): LiveLocationProvider
suspend fun RequestsExecutor.startLiveLocation(scope: CoroutineScope, chat: Chat, latitude: Double, longitude: Double, liveTimeMillis: Long, initHorizontalAccuracy: Float?, initHeading: Int?, initProximityAlertRadius: Float?, disableNotification: Boolean, replyToMessageId: Long?, allowSendingWithoutReply: Boolean?, replyMarkup: KeyboardMarkup?): LiveLocationProvider
stopPoll
Link copied to clipboard
common
suspend fun RequestsExecutor.stopPoll(chatId: ChatId, message: Message, replyMarkup: InlineKeyboardMarkup?): Poll
suspend fun RequestsExecutor.stopPoll(chatId: ChatIdentifier, messageId: Long, replyMarkup: InlineKeyboardMarkup?): Poll
suspend fun RequestsExecutor.stopPoll(chat: Chat, message: Message, replyMarkup: InlineKeyboardMarkup?): Poll
suspend fun RequestsExecutor.stopPoll(chat: Chat, messageId: Long, replyMarkup: InlineKeyboardMarkup?): Poll
telegramBot
Link copied to clipboard

Allows to create bot using bot urlsKeeper

common
fun telegramBot(urlsKeeper: TelegramAPIUrlsKeeper): RequestsExecutor

Allows to create bot using bot urlsKeeper and already prepared client

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

Allows to create bot using bot urlsKeeper and specify HttpClientEngine by configuring HttpClient using clientConfig

common
inline fun telegramBot(urlsKeeper: TelegramAPIUrlsKeeper, noinline clientConfig: HttpClientConfig<*>.() -> Unit): RequestsExecutor
common
fun telegramBot(token: String, block: BotBuilder.() -> Unit): RequestsExecutor
inline fun <T : HttpClientEngineConfig> telegramBot(token: String, clientFactory: HttpClientEngineFactory<T>, apiUrl: String, noinline clientConfig: HttpClientConfig<T>.() -> Unit): RequestsExecutor

Allows to create bot using bot token, apiUrl (for custom api servers) and already prepared client

common
inline fun telegramBot(token: String, apiUrl: String): RequestsExecutor

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

common
inline fun telegramBot(urlsKeeper: TelegramAPIUrlsKeeper, clientEngine: HttpClientEngine, noinline clientConfig: HttpClientConfig<*>.() -> Unit): RequestsExecutor

Allows to create bot using bot urlsKeeper and specify HttpClientEngineFactory by passing clientFactory param and optionally configure it with clientConfig

common
inline fun <T : HttpClientEngineConfig> telegramBot(urlsKeeper: TelegramAPIUrlsKeeper, clientFactory: HttpClientEngineFactory<T>, noinline clientConfig: HttpClientConfig<T>.() -> Unit): RequestsExecutor

Allows to create bot using bot token, apiUrl (for custom api servers) and already prepared client

common
inline fun telegramBot(token: String, apiUrl: String, client: HttpClient): RequestsExecutor

Allows to create bot using bot token and apiUrl and specify HttpClientEngine by configuring HttpClient using clientConfig

common
inline fun telegramBot(token: String, apiUrl: String, noinline clientConfig: HttpClientConfig<*>.() -> Unit): RequestsExecutor

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

common
inline fun telegramBot(token: String, clientEngine: HttpClientEngine, apiUrl: String, noinline clientConfig: HttpClientConfig<*>.() -> Unit): RequestsExecutor

Properties

defaultLivePeriodDelayMillis
Link copied to clipboard
val defaultLivePeriodDelayMillis: Long