Skip to content

A useful package which allows you to add minigames to your discord.js bot easily

License

Notifications You must be signed in to change notification settings

andrewthederp/Disgames-djs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

disgames is an easy-to-use fully customizable npm package made to allow you to easily add games to your discord.js bot!


Contents

Installation

npm i disgames-js

To install the development version, you need git installed. After installing it, run

npm i npm i andrewthederp/Disgames-djs

Example

const Discord = require("discord.js")
const disgames = require("disgames-js")

const client = new Discord.Client({ intents: ['Guilds', 'GuildMessages', 'MessageContent'] })

client.on('interactionCreate', async interaction => {
	if (!interaction.isCommand()) return
	new disgames.TicTacToe(interaction, await client.users.fetch(interaction.options.get("opponent",true).value)).start()
})

client.login('token')

Documentation

Akinator

The Akinator constructor takes two parameters. Interaction (required) and options (default:{childMode: false,region: 'people'}). options is expected to be an Object containing childMode (default:false) and region (default:'people') region may be any of "people"/"animals"/"objects".

new disgames.Akinator(interaction,{false,'region'}).start()

Checkers

The Checkers constructor takes two parameters. Interaction (required) and opponent (required). opponent is expected to be a User object.

new disgames.Checkers(interaction,await client.users.fetch(interaction.options.get("opponent",true).value).start()

Chess

The Chess constructor takes two parameters. Interaction (required) and opponent (required). opponent is expected to be a User object.

new disgames.Chess(interaction,await client.users.fetch(interaction.options.get("opponent",true).value).start()

Hangman

The Hangman constructor takes two parameters. Interaction (required) and options (default:{min: 3, max: 7, word:undefined}). options is expected to be an Object containing min (default:3) and max (default:7) and word (default:undefined) if a word is provided it will be used regardless of whether a min/max was provided or not.

new disgames.Hangman(interaction,{min:3, max:7, word:undefined}).start()

Madlibs

The Madlibs constructor takes three parameters. Interaction (required) and min (default:5) and max (default:25).

new disgames.Madlibs(interaction,5,25).start()

Minesweeper

The Minesweeper constructor takes two parameters. Interaction (required) and chance (default:.17). chance determines the amount of bombs that will be on the board, .17 does not necessarily mean that there will be 17 bombs.

new disgames.Minesweeper(interaction,.17).start()

RussianRoulette

The RussianRoulette constructor takes two parameters. Interaction (required) and opponent (required).

new disgames.RussianRoulette(interaction,await client.users.fetch(interaction.options.get("opponent",true).value).start()

RPS

The RPS constructor takes two parameters. Interaction (required) and opponent (default: undefined). If no opponent is passed then the player plays against the bot.

new disgames.RPS(interaction,await client.users.fetch(interaction.options.get("opponent",true).value).start()

Snake

The Snake constructor takes one parameter. Interaction (required).

new disgames.Snake(interaction).start()

Sokoban

The Sokoban constructor takes two parameters. Interaction (required) and options (default: {player:'😳','playerOnTask':'😳',task:'❎',box:'🟫',boxOnTask:'✅'}). options will be used to format the board.

new disgames.Sokoban(interaction).start()

TicTacToe

The TicTacToe constructor takes two parameters. Interaction (required) and opponent (required).

new disgames.TicTacToe(interaction, await client.users.fetch(interaction.options.get("opponent",true).value).start()

Wordle

The Wordle constructor takes two parameters. Interaction (required) and player (required) and word (default:a random word from words.txt).

new disgames.Wordle(interaction, interaction.user, 'hello').start()

Discord

Need help? join our discord server!

About

A useful package which allows you to add minigames to your discord.js bot easily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published