Package dev. inmo. tgbotapi. bot. multiserver
Types
Link copied to clipboard
class SimpleMultiServerRequestsExecutor( bots: List<TelegramBot>, botSelector: suspend List<TelegramBot>.(currentBotIndex: Int, t: Throwable?) -> TelegramBot = { i, _ ->
getOrElse(i + 1) { first() }
}, onClose: () -> Unit = {
bots.forEach(TelegramBot::close)
}) : RequestsExecutor
Content copied to clipboard
This type of RequestsExecutor (aka TelegramBot) has been created to aggregate several bots under the hood and make requests, for example, with changing of api url
Functions
Link copied to clipboard
inline fun telegramBot( bots: List<TelegramBot>, noinline botSelector: suspend List<TelegramBot>.(currentBotIndex: Int, t: Throwable?) -> TelegramBot = { i, _ ->
getOrElse(i + 1) { first() }
}, noinline onClose: () -> Unit = {
bots.forEach(TelegramBot::close)
}): TelegramBot
Content copied to clipboard
inline fun telegramBot( keepers: Iterable<TelegramAPIUrlsKeeper>, crossinline builder: KtorRequestsExecutorBuilder.(TelegramAPIUrlsKeeper) -> Unit = {}, noinline botSelector: suspend List<TelegramBot>.(currentBotIndex: Int, t: Throwable?) -> TelegramBot = { i, _ ->
getOrElse(i + 1) { first() }
}, noinline onClose: (List<TelegramBot>) -> Unit? = null): TelegramBot
Content copied to clipboard
inline fun telegramBot( tokens: Iterable<Pair<String, String>>, crossinline builder: KtorRequestsExecutorBuilder.(Pair<String, String>) -> Unit = {}, noinline botSelector: suspend List<TelegramBot>.(currentBotIndex: Int, t: Throwable?) -> TelegramBot = { i, _ ->
getOrElse(i + 1) { first() }
}, noinline onClose: (List<TelegramBot>) -> Unit? = null): TelegramBot
Content copied to clipboard
inline fun telegramBot( tokens: Iterable<String>, crossinline builder: KtorRequestsExecutorBuilder.(String) -> Unit = {}, noinline botSelector: suspend List<TelegramBot>.(currentBotIndex: Int, t: Throwable?) -> TelegramBot = { i, _ ->
getOrElse(i + 1) { first() }
}, noinline onClose: (List<TelegramBot>) -> Unit? = null): TelegramBot
Content copied to clipboard