1.1.0 • Published 5 years ago
discord-minesweeper v1.1.0
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
Parameter | Description |
---|---|
X | Width |
Y | Height |
mines | Number of mines |
char | Character to use internally to represent bombs. If formatted == false, this will be used to represent bombs in the output array. |
formatted | Whether 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););
}
});