1.1.0 • Published 5 years ago

discord-minesweeper v1.1.0

Weekly downloads
4
License
ISC
Repository
-
Last release
5 years ago

Discord Minesweeper

Create games of minesweeper using Discords Spoiler Tags.

Usage

const mines = require('discord-minesweeper');

let output = mines(X, Y, mines, char, formatted);

Parameters

ParameterDescription
XWidth
YHeight
minesNumber of mines
charCharacter to use internally to represent bombs. If formatted == false, this will be used to represent bombs in the output array.
formattedWhether to output as a formatted message (with line breaks and emojis) or as a 2D array.

Example

const Discord = require('discord.js');
const client = new Discord.Client();

...

client.on('message', msg => {
  if (msg.content === '!mines') {
    msg.author.send(mines(14, 14, 20, 'X', true););
  }
});