Repository navigation
Weky Overview
@m3rcena/weky (v14.28.1) is the modern minigames and arcade engine for Discord.js v14 bots and web applications.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WekyManager โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ Minigames(17)โ โArcade Suite โ โCanvas Hubโ โContextAdapter โ โ WekyBridge โ
โ 2048, Snake, โ โHub, Tourney, โ โ@napi-rs/ โ โSlash, Prefix, โ โHeadless REST, โ
โ Fight, etc. โ โAI, Brackets โ โcanvas โ โComponents V2 โ โWebSocket Sync โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
WekyManager is the central orchestrator that attaches to your Discord Client and coordinates lifecycle telemetry, audio dispatching, and bridge state synchronization:
import { Client } from "discord.js";
import { WekyManager } from "@m3rcena/weky";
import { M3rcenaBridge } from "@m3rcena/bridge";
// Optional: Connect to shared dashboard bridge
const bridge = new M3rcenaBridge();
export const weky = new WekyManager(client, {
bridge, // Attach to Bridge for web dashboard crossplay
embedColor: "#5865F2", // Default brand accent color
defaultTimeout: 120_000, // Inactivity timeout in ms (2 minutes)
unauthorizedMessage: "โ You cannot interact with this game!",
notifyUpdates: true, // Prints banner when new version is available
});WekyManager extends Node's EventEmitter, broadcasting strongly-typed lifecycle events:
// Game Started
weky.on("gameStart", (data) => {
console.log(`๐น๏ธ [Weky] Started: ${data.game} in channel ${data.channelId}`);
});
// Game Over / Concluded
weky.on("gameOver", (data) => {
console.log(`๐ [Weky] Over: ${data.game} | Outcome: ${data.outcome} | Score: ${data.score}`);
});
// Game Error
weky.on("gameError", (data) => {
console.error(`โ [Weky] Error in ${data.game}:`, data.error);
});
// Unauthorized User Attempted Click
weky.on("unauthorizedClick", (data) => {
console.warn(`โ [Weky] ${data.user.username} tried interacting with ${data.game}`);
});@m3rcena/weky minigames work identically with Slash Command Interactions (ChatInputCommandInteraction), Button Interactions, Select Menus, or legacy Prefix Messages (Message).
The internal ContextAdapter normalizes replies, ephemeral messages, edits, and component updates automatically:
// 1. With Slash Command
client.on("interactionCreate", async (interaction) => {
if (interaction.isChatInputCommand() && interaction.commandName === "play2048") {
new Game2048(weky, { context: interaction }).start();
}
});
// 2. With Prefix Message
client.on("messageCreate", async (message) => {
if (message.content.startsWith("!2048")) {
new Game2048(weky, { context: message }).start();
}
});Every minigame in @m3rcena/weky v14.28.1 utilizes Discord's Components V2 containers (ContainerBuilder with type 17 and MessageFlags.IsComponentsV2).
- Visual accent borders matching your bot's color scheme.
- Media galleries (
MediaGalleryBuilder) for clean canvas board rendering. - Interactive action rows with buttons, select menus, and modals.
- Zero deprecation warnings on Discord.js v14.
GitHub: M3rcena/m3rcena-weky โข NPM: @m3rcena/weky