Skip to content

GroupCatalog ​

The Kohl group's avatar catalog, searched live for the Market tab, so an item uploaded to the group shows in every game without a release.

  • search(keyword) finds the first page (it yields) and more(results) adds the next. Results are kept for CACHE_TTL seconds, callers asking for the same search at once share one request, and a search refused for asking too often makes the next wait COOLDOWN seconds.
  • sellable(info) is the server's check before it prompts an id the client sent: the item must be the group's and on sale.
  • shouldAnnounce(...) decides whether the newest item is news to this player.
  • setSearcher(fn) and setClock(fn) stand in for Roblox and the clock in specs; forget() empties the cache.

Types ​

Item type ​

luau
type Item = {
	id: number,
	name: string,
	bundle: boolean,
	price: number?,
	assetType: number?,
}

Results type ​

luau
type Results = { items: { Item }, finished: boolean, limited: boolean?, next: (() -> ({ Item }, boolean))? }

Searcher type ​

luau
type Searcher = (keyword: string) -> Results

Properties ​

GROUP ​

luau
GroupCatalog.GROUP: number

PAGE ​

luau
GroupCatalog.PAGE: number

DEBOUNCE ​

luau
GroupCatalog.DEBOUNCE: number

COOLDOWN ​

luau
GroupCatalog.COOLDOWN: number

FRESH ​

luau
GroupCatalog.FRESH: number

Functions ​

setSearcher ​

luau
GroupCatalog.setSearcher(fn: Searcher?): Searcher?

setClock ​

luau
GroupCatalog.setClock(fn: (() -> number)?)

forget ​

luau
GroupCatalog.forget()
luau
GroupCatalog.search(keyword: string): (Results?, string?)

more Yields ​

luau
GroupCatalog.more(results: Results): (boolean, string?)

thumbnail ​

luau
GroupCatalog.thumbnail(id: number, bundle: boolean?): string

sellable ​

luau
GroupCatalog.sellable(info: any): boolean

shouldAnnounce ​

luau
GroupCatalog.shouldAnnounce(newestId: number, created: number?, lastSeen: number?, at: number): boolean

Whether the group's newest item is news to a player: it isn't the one they last saw, and it was created within FRESH seconds of at (both in Unix seconds). A missing creation time is never news.