1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { lichessGameAscii } from "https://esm.town/v/jdan/lichessGameAscii";
import { lichessTVGames } from "https://esm.town/v/jdan/lichessTVGames";
type GameType =
| "Bot"
| "UltraBullet"
| "Bullet"
| "Computer"
| "Rapid"
| "Top Rated"
| "Blitz"
| "Classical";
export const topLichess = async (gameType: GameType) => {
const games = await lichessTVGames();
return await lichessGameAscii(games[gameType].gameId);
};