This library was made as a replacement for discord-gamecord which is unmaintained (and partially broken) and has no TypeScript support. While the game options are mostly similar, this library offers more features to customize and handle your games. Also, this module does not contain all games from the original.
The module supports both slash commands and message commands!
Node.js 18 or newer is required.
npm install @sodiumlabs/gamecordYou can find the docs here: https://docs.sodiumlabs.xyz/docs/packages/gamecord/stable
If you need help, ask on our support server.
const { Game2048 } = require("@sodiumlabs/gamecord");
const game = new Game2048(interaction, {
embed: {
title: "2048",
color: 0x5865f2,
},
notPlayerMessage: game => `Only ${game.player} can use this menu.`,
timeout: 60_000,
emojis: {
up: "🔼",
down: "🔽",
right: "▶️",
left: "◀️"
}
});
game.on("error", err => console.error("Error!", err));
game.on("gameOver", result => console.log("Result:", result));
await game.start();Note: every embeds can be fully customized.
end or gameOver event)..on("error"), errors will emit an uncaughtException in your process.$gamecord-.You need help with the module? Ask on our support server!