1.0.0-b1 • Published 3 years ago

discordjs-hangman v1.0.0-b1

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

discordjs-hangman

Make your create hangman game on Discord easy

Installation

npm install discordjs-hangman

Features

  • Super easy to use 😀
  • More than 1000 words ✅

Examples

const Discord = require('discord.js'); // Require discord.js
const HangmanGame = require('discordjs-hangman'); // Require HangmanGame
const bot = new Discord.Client(); // Create client

const hangman = new HangmanGame({
  title: 'Hangman', // Title of the embed while displaying the game. Default: Hangman
  color: 'RANDOM', // Color of the embed. Default: RANDOM
  lang: 'en', // Custom the language for the embeds. Default: en
  overTitle: 'Game Over', // Custom text for the embed title of the game over embed. Default: 'Game Over'
  wins: "You Wins", // Custom text of the message when the chat wins
  losses: "You losses", // Custom text of the message when the chat losses
  words: ["word1", "word2"] // Custom words. Default: our word list
});

// Config

bot.config = {
    token: "TOKEN"
}

// Ready Event

bot.on('ready', () => {
    console.log(`Logged in as ${bot.user.tag}!`);
});

// Message Event

bot.on('message', message => {
    if (message.content.toLowerCase() === '!test') {
        message.reply("Test command work!")
    }

    else if (message.content.toLowerCase() === '!hangman') {
        hangman.newGame(message);
    }
})
 
// Login the bot
bot.login(bot.config.token)

Available languages

  • English -> en
  • Nederlands -> nl (Dutch)
  • Français -> fr (French)
1.0.0-b4

3 years ago

1.0.0-b5

3 years ago

1.0.0-b3

3 years ago

1.0.0-b2

3 years ago

1.0.0-b1

3 years ago