UNPKG

loriapi

Version:

A simple library for fetching information from Loritta, a popular Discord bot made by the Brazilian developer MrPowerGamerBR.

44 lines (43 loc) 1.73 kB
/** * Options for initializing the Loritta API. */ type ApiOptions = { loriKey: string; }; interface UserData { id: string; xp: number; sonhos: number; aboutMe: string; gender: string; emojiFightEmoji: string; } interface UserHeaders { LorittaCluster?: string; LorittaTokenCreator?: string; LorittaTokenUser?: string; } declare class LoriApi { loriKey: string; constructor(options: ApiOptions); getUserData(userId: string): Promise<UserData & UserHeaders>; /** * Fetches user transactions with optional filters for transaction types and date ranges. * * @param userId - The ID of the user * @param transactionTypes - An array of allowed transaction types (e.g., ["PAYMENT", "SPARKLYPOWER_LSX"]) * @param beforeDate - The end date for filtering transactions, in ISO string or Unix timestamp * @param afterDate - The start date for filtering transactions, in ISO string or Unix timestamp * @returns An object containing transaction data and headers */ getUserDataTransactions(userId: string, transactionTypes?: Array<"PAYMENT" | "DAILY_REWARD" | "COINFLIP_BET" | "COINFLIP_BET_GLOBAL" | "EMOJI_FIGHT_BET" | "RAFFLE" | "HOME_BROKER" | "SHIP_EFFECT" | "SPARKLYPOWER_LSX" | "SONHOS_BUNDLE_PURCHASE" | "INACTIVE_DAILY_TAX" | "DIVINE_INTERVENTION" | "BOT_VOTE" | "POWERSTREAM" | "EVENTS" | "LORI_COOL_CARDS" | "LORITTA_ITEM_SHOP" | "BOM_DIA_E_CIA" | "GARTICOS">, beforeDate?: string | number, afterDate?: string | number): Promise<{ transactions: any; headers: { LorittaCluster: any; LorittaTokenCreator: any; LorittaTokenUser: any; }; paging: any; }>; } export { ApiOptions, LoriApi };