@aidarkezio/main-func
Version:
📦 It has my funcs
15 lines (13 loc) • 420 B
text/typescript
import got from 'got'
import { TebakKata } from './types'
export let tebakkatajson: TebakKata[]
export default async function tebakkata (): Promise<TebakKata> {
if (!tebakkatajson) {
tebakkatajson = await got(
'https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkata.json'
).json()
}
return tebakkatajson[
Math.floor(Math.random() * tebakkatajson.length)
] as TebakKata
}