UNPKG

@aidarkezio/main-func

Version:
15 lines (13 loc) • 431 B
import got from 'got' import { TebakLirik } from './types' export let tebaklirikjson: TebakLirik[] export default async function tebaklirik (): Promise<TebakLirik> { if (!tebaklirikjson) { tebaklirikjson = await got( 'https://raw.githubusercontent.com/BochilTeam/database/master/games/tebaklirik.json' ).json() } return tebaklirikjson[ Math.floor(Math.random() * tebaklirikjson.length) ] as TebakLirik }