mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-04-28 00:20:38 +00:00
3ac06bffaa
Closes deferred phases 04 + 05 of loldle-new-modes plan. - loldle-ability: 5 guesses, DDragon ability icon as photo. State pins slot (P/Q/W/E/R) so the same icon shows every turn. Abilities pulled from DDragon per-champion — same source loldle.net uses at runtime. - loldle-splash: 4 guesses, random skin splash as photo. Skin pool scraped from loldle.net bundle (var Ad=[…] — 172 champs × 1939 skins, non-chroma, matches their splash mode exactly). URLs from Riot DDragon CDN (no version segment, stable across patches). - fetch-ddragon-data.js: extended to write all four JSONs in one run. Shares a single DDragon per-champion fetch cycle (concurrency 10). - Credits loldle.net + Riot Games in all loldle-family READMEs. 19 new tests (503 total). Lint clean. register:dry reports 12 loldle_* commands with no conflicts.
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
/**
|
|
* @file loldle-splash — guess the champion from splash art (random skin).
|
|
* Skin pool scraped from loldle.net, splash URLs from Data Dragon CDN.
|
|
*/
|
|
|
|
import { handleGiveup, handleSplash, handleStats } from "./handlers.js";
|
|
|
|
/** @type {import("../../db/kv-store-interface.js").KVStore | null} */
|
|
let db = null;
|
|
|
|
/** @type {import("../registry.js").BotModule} */
|
|
const loldleSplashModule = {
|
|
name: "loldle-splash",
|
|
init: async ({ db: store }) => {
|
|
db = store;
|
|
},
|
|
commands: [
|
|
{
|
|
name: "loldle_splash",
|
|
visibility: "public",
|
|
description: "Splash loldle — guess the champion from splash art",
|
|
handler: (ctx) => handleSplash(ctx, db),
|
|
},
|
|
{
|
|
name: "loldle_splash_giveup",
|
|
visibility: "public",
|
|
description: "Reveal the current splash loldle answer",
|
|
handler: (ctx) => handleGiveup(ctx, db),
|
|
},
|
|
{
|
|
name: "loldle_splash_stats",
|
|
visibility: "public",
|
|
description: "Show your splash loldle stats (wins, streak)",
|
|
handler: (ctx) => handleStats(ctx, db),
|
|
},
|
|
],
|
|
};
|
|
|
|
export default loldleSplashModule;
|