1.1.2 • Published 1 year ago

discord-minesweeper-game v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Installations

npm i discord-minesweeper-game

What ?

This package is to make a minesweeper game for your discord bot. Now only supports discord JS 14

Why ?

  • Easy to use.
  • Highly Customizable. ( works with 0 configuration too )
  • Fast and advanced.
  • Supports discord.js@13.x.x

How ?

const game = require('discord-minesweeper-game').default;
// import game from 'discord-minesweeper'; // for ts

// interaction = command interaction, we get on slash commands
// for options check below
const result = await game.start(interaction, options);

/* Example result object
 * {
 *  endReason: 0, // -1 => time (took too long to respond), 0 => lost the game, 1 => won the game
 *  score: 10, // Amount of points they won
 *  win: true, // Whether they won or not
 * board: "the game board in string format (the game window made via emojis)"
 * }
 */

Customization with options

  • Settings

game.start(interaction, {
    size: 3, // Size of game board
    bombs: 3, // Number of bombs
    prefix: "", // The prefix
    timer: 60000, // Time after which game ends
})
  • Custom replies

game.start(ineraction, {
    // Message to add just below the game board
    embedMessage: "ey nerd, use \`{prefix} block-id\` to open a block, block id is like \`A1\`, you just have {timer} time left"

    // Message when bomb is blasted
    bombMessage: "the bombs blasted, you died/lost xd nerddd",

    // Message when timer ends
    timerMessage: "The bomb timer ended, you ded nerd",

    // Message when user wins the game
    winMessage: "You successfully digged the area, gg boi",
})

Images

  • Gameboard

    image

  • Win Message

    image

  • Bomb Message

    image

Supports

For support or issues or queries contace me on my discord server.