Package dev.inmo.tgbotapi.extensions.api

Types

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

Functions

buildBot
Link copied to clipboard
common
fun buildBot(token: String, apiUrl: String = telegramBotAPIDefaultUrl, block: BotBuilder.() -> Unit): RequestsExecutor
close
Link copied to clipboard
common
inline suspend fun TelegramBot.close(): Boolean
delete
Link copied to clipboard
common
suspend fun Message.delete(requestsExecutor: TelegramBot): Boolean
deleteMessage
Link copied to clipboard
common
suspend fun TelegramBot.deleteMessage(message: Message): Boolean
suspend fun TelegramBot.deleteMessage(chatId: ChatIdentifier, messageId: MessageIdentifier): Boolean
suspend fun TelegramBot.deleteMessage(chat: Chat, messageId: MessageIdentifier): Boolean
downloadFile
Link copied to clipboard
common
suspend fun TelegramBot.downloadFile(fileId: FileId): ByteArray
suspend fun TelegramBot.downloadFile(pathedFile: PathedFile): ByteArray
suspend fun TelegramBot.downloadFile(file: TelegramMediaFile): ByteArray
suspend fun TelegramBot.downloadFile(file: MediaContent): ByteArray
suspend fun TelegramBot.downloadFile(filePath: String): ByteArray
forwardMessage
Link copied to clipboard
common
suspend fun TelegramBot.forwardMessage(toChatId: ChatIdentifier, message: Message, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun TelegramBot.forwardMessage(toChat: Chat, message: Message, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun TelegramBot.forwardMessage(fromChatId: ChatIdentifier, toChatId: ChatIdentifier, messageId: MessageIdentifier, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun TelegramBot.forwardMessage(fromChatId: ChatIdentifier, toChat: Chat, messageId: MessageIdentifier, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun TelegramBot.forwardMessage(fromChat: Chat, toChatId: ChatIdentifier, messageId: MessageIdentifier, disableNotification: Boolean = false): PossiblyForwardedMessage
suspend fun TelegramBot.forwardMessage(fromChat: Chat, toChat: Chat, messageId: MessageIdentifier, disableNotification: Boolean = false): PossiblyForwardedMessage
getUpdates
Link copied to clipboard
common
suspend fun TelegramBot.getUpdates(lastUpdate: Update, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, allowed_updates: List<String>? = ALL_UPDATES_LIST): List<Update>
suspend fun TelegramBot.getUpdates(offset: UpdateIdentifier? = null, limit: Int = getUpdatesLimit.last, timeout: Seconds? = null, allowed_updates: List<String>? = ALL_UPDATES_LIST): List<Update>
logOut
Link copied to clipboard
common
inline suspend fun TelegramBot.logOut(): Boolean
replyWithLiveLocation
Link copied to clipboard
common
inline suspend fun TelegramBot.replyWithLiveLocation(to: Message, scope: CoroutineScope, location: StaticLocation, liveTimeMillis: Long = defaultLivePeriodDelayMillis, initHorizontalAccuracy: Meters? = null, initHeading: Degrees? = null, initProximityAlertRadius: Meters? = null, disableNotification: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null): LiveLocationProvider
inline suspend fun TelegramBot.replyWithLiveLocation(to: Message, scope: CoroutineScope, latitude: Double, longitude: Double, liveTimeMillis: Long = defaultLivePeriodDelayMillis, initHorizontalAccuracy: Meters? = null, initHeading: Degrees? = null, initProximityAlertRadius: Meters? = null, disableNotification: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null): LiveLocationProvider
startLiveLocation
Link copied to clipboard
common
suspend fun TelegramBot.startLiveLocation(scope: CoroutineScope, chatId: ChatId, location: StaticLocation, liveTimeMillis: Long = defaultLivePeriodDelayMillis, initHorizontalAccuracy: Meters? = null, initHeading: Degrees? = null, initProximityAlertRadius: Meters? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null): LiveLocationProvider
suspend fun TelegramBot.startLiveLocation(scope: CoroutineScope, chat: Chat, location: StaticLocation, liveTimeMillis: Long = defaultLivePeriodDelayMillis, initHorizontalAccuracy: Meters? = null, initHeading: Degrees? = null, initProximityAlertRadius: Meters? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null): LiveLocationProvider
suspend fun TelegramBot.startLiveLocation(scope: CoroutineScope, chatId: ChatIdentifier, latitude: Double, longitude: Double, liveTimeMillis: Long = defaultLivePeriodDelayMillis, initHorizontalAccuracy: Meters? = null, initHeading: Degrees? = null, initProximityAlertRadius: Meters? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null): LiveLocationProvider
suspend fun TelegramBot.startLiveLocation(scope: CoroutineScope, chat: Chat, latitude: Double, longitude: Double, liveTimeMillis: Long = defaultLivePeriodDelayMillis, initHorizontalAccuracy: Meters? = null, initHeading: Degrees? = null, initProximityAlertRadius: Meters? = null, disableNotification: Boolean = false, replyToMessageId: MessageIdentifier? = null, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null): LiveLocationProvider
stopPoll
Link copied to clipboard
common
suspend fun TelegramBot.stopPoll(chatId: ChatId, message: Message, replyMarkup: InlineKeyboardMarkup? = null): Poll
suspend fun TelegramBot.stopPoll(chatId: ChatIdentifier, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null): Poll
suspend fun TelegramBot.stopPoll(chat: Chat, message: Message, replyMarkup: InlineKeyboardMarkup? = null): Poll
suspend fun TelegramBot.stopPoll(chat: Chat, messageId: MessageIdentifier, replyMarkup: InlineKeyboardMarkup? = null): Poll
telegramBot
Link copied to clipboard
common
fun telegramBot(urlsKeeper: TelegramAPIUrlsKeeper, client: HttpClient): TelegramBot
Allows to create bot using bot urlsKeeper and already prepared client
inline fun telegramBot(urlsKeeper: TelegramAPIUrlsKeeper, noinline clientConfig: HttpClientConfig<*>.() -> Unit): RequestsExecutor
Allows to create bot using bot urlsKeeper and specify HttpClientEngine by configuring HttpClient using clientConfig
inline fun telegramBot(urlsKeeper: TelegramAPIUrlsKeeper, clientEngine: HttpClientEngine, noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}): RequestsExecutor
Allows to create bot using bot urlsKeeper and specify HttpClientEngine by passing clientEngine param and optionally configure HttpClient using clientConfig
inline fun <T : HttpClientEngineConfig> telegramBot(urlsKeeper: TelegramAPIUrlsKeeper, clientFactory: HttpClientEngineFactory<T>, noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}): RequestsExecutor
Allows to create bot using bot urlsKeeper and specify HttpClientEngineFactory by passing clientFactory param and optionally configure it with clientConfig
inline fun telegramBot(token: String, apiUrl: String = telegramBotAPIDefaultUrl, client: HttpClient): TelegramBot
Allows to create bot using bot token, apiUrl (for custom api servers) and already prepared client
inline fun telegramBot(token: String, apiUrl: String = telegramBotAPIDefaultUrl, noinline clientConfig: HttpClientConfig<*>.() -> Unit): RequestsExecutor
Allows to create bot using bot token and apiUrl and specify HttpClientEngine by configuring HttpClient using clientConfig
inline fun telegramBot(token: String, clientEngine: HttpClientEngine, apiUrl: String = telegramBotAPIDefaultUrl, 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
inline fun <T : HttpClientEngineConfig> telegramBot(token: String, clientFactory: HttpClientEngineFactory<T>, apiUrl: String = telegramBotAPIDefaultUrl, noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}): RequestsExecutor

Properties

defaultLivePeriodDelayMillis
Link copied to clipboard
common
val defaultLivePeriodDelayMillis: Long