TibiaKtClient

Tibia.com client with engine-agnostic construction.

This class accepts a prebuilt HttpClient, an engine factory, or a concrete engine. Defaults (timeouts, compression, user-agent, no redirects) are applied via defaultConfig unless explicitly disabled where supported.

Constructors

Link copied to clipboard
constructor(baseClient: HttpClient, applyDefaults: Boolean = true, userAgent: String? = null, additionalConfig: HttpClientConfig<*>.() -> Unit = {})

Create a client from a caller-provided HttpClient.

constructor(engineFactory: HttpClientEngineFactory<*>, userAgent: String? = null, additionalConfig: HttpClientConfig<*>.() -> Unit = {})

Create a client using a specific engine factory (e.g., OkHttp, CIO, Apache, Darwin).

constructor(engine: HttpClientEngine, userAgent: String? = null, additionalConfig: HttpClientConfig<*>.() -> Unit = {})

Create a client using a specific engine instance.

constructor(client: HttpClient, ownsClient: Boolean)

Functions

Link copied to clipboard
open override fun close()

Close the underlying HttpClient if this instance owns it.

Link copied to clipboard
open suspend override fun fetchAuction(auctionId: Int, skipDetails: Boolean, fetchItems: Boolean, fetchOutfits: Boolean, fetchMounts: Boolean): TibiaResponse<Auction?>

Fetch an auction from Tibia.com.

Link copied to clipboard
open suspend override fun fetchAuctionDetailsPage(auctionId: Int, type: AuctionPagesType, page: Int): TimedResult<AjaxResponse>

Fetch a single page from the auction pagination endpoint.

Link copied to clipboard
open suspend override fun fetchBazaar(type: BazaarType, filters: BazaarFilters?, page: Int): TibiaResponse<CharacterBazaar>

Fetch the character bazaar.

Link copied to clipboard
open suspend override fun fetchBoostableBosses(): TibiaResponse<BoostableBosses>

Fetch the boosted boss of the day as well as the list of bosstable bosses from Tibia.com.

Link copied to clipboard
open suspend override fun fetchCharacter(name: String): TibiaResponse<CharacterInfo?>

Fetch a character.

Link copied to clipboard
open suspend override fun fetchCMPostArchive(startOn: LocalDate, endOn: LocalDate, page: Int): TibiaResponse<CMPostArchive>

Fetch CM posts between two dates.

Link copied to clipboard

Fetch the creatures section, containing the boosted creature.

Link copied to clipboard
open suspend override fun fetchEventsSchedule(): TibiaResponse<EventsSchedule>

Fetch the events schedule for the current month.

open suspend override fun fetchEventsSchedule(yearMonth: YearMonth): TibiaResponse<EventsSchedule>

Fetch the events schedule for a specific year and month.

Link copied to clipboard
open suspend override fun fetchForumAnnouncement(announcementId: Int): TibiaResponse<ForumAnnouncement?>

Fetches a thread from the Tibia.com forum.

Link copied to clipboard
open suspend override fun fetchForumBoard(boardId: Int, page: Int, threadAge: Int?): TibiaResponse<ForumBoard?>

Fetches a board from the Tibia.com forum.

Link copied to clipboard
open suspend override fun fetchForumPost(postId: Int): TibiaResponse<ForumThread?>

Fetches a forum thread containing the specified post.

Link copied to clipboard
open suspend override fun fetchForumSection(section: AvailableForumSection): TibiaResponse<ForumSection?>

Fetches a specific forum section.

open suspend override fun fetchForumSection(sectionId: Int): TibiaResponse<ForumSection?>

Fetches a forum section by its internal sectionId.

Link copied to clipboard
open suspend override fun fetchForumThread(threadId: Int, page: Int): TibiaResponse<ForumThread?>

Fetches a forum thread from Tibia.com.

Link copied to clipboard
open suspend override fun fetchGuild(name: String): TibiaResponse<Guild?>

Fetch a guild by its name.

Link copied to clipboard
suspend fun fetchHighscores(world: String?, category: HighscoresCategory, vocation: HighscoresProfession = HighscoresProfession.ALL, battlEyeType: HighscoresBattlEyeType = HighscoresBattlEyeType.ANY_WORLD, pvpTypes: Set<PvpType>? = null): TibiaResponse<Highscores?>
Link copied to clipboard
open suspend override fun fetchHighscoresPage(world: String?, category: HighscoresCategory, vocation: HighscoresProfession, page: Int, battlEyeType: HighscoresBattlEyeType, pvpTypes: Set<PvpType>?): TibiaResponse<Highscores?>

Fetch a page of the highscores.

Link copied to clipboard
open suspend override fun fetchHouse(houseId: Int, world: String): TibiaResponse<House?>

Fetch a house by its houseId in a specific world.

Link copied to clipboard
open suspend override fun fetchHousesSection(world: String, town: String, type: HouseType?, status: HouseStatus?, order: HouseOrder?): TibiaResponse<HousesSection?>

Fetch the houses section for a world and town.

Link copied to clipboard
open suspend override fun fetchKillStatistics(world: String): TibiaResponse<KillStatistics?>

Fetch the kill statistics for a world.

Link copied to clipboard
open suspend override fun fetchLeaderboard(world: String, rotation: Int?, page: Int): TibiaResponse<Leaderboard?>

Fetches the Tibia Drome leaderboards for a world.

Link copied to clipboard
open suspend override fun fetchNewsArchive(startAt: LocalDate, endAt: LocalDate, categories: Set<NewsCategory>?, types: Set<NewsType>?): TibiaResponse<NewsArchive>

Fetch the news for a given interval.

Link copied to clipboard
open suspend override fun fetchNewsArticleById(newsId: Int): TibiaResponse<NewsArticle?>

Fetch a specific news article by its newsId.

Link copied to clipboard
open suspend override fun fetchWorld(name: String): TibiaResponse<World?>

Fetch a world's information.

Link copied to clipboard
open suspend override fun fetchWorldGuilds(world: String): TibiaResponse<GuildsSection?>

Fetch active and in formation guilds in a world.

Link copied to clipboard
open suspend override fun fetchWorldOverview(): TibiaResponse<WorldOverview>

Fetch the world overview, containing the list of worlds.

Link copied to clipboard
suspend fun request(method: HttpMethod, url: String, data: List<Pair<String, Any>> = emptyList(), headers: List<Pair<String, Any>> = emptyList()): HttpResponse

Perform a request using the required headers.