1.0.2 • Published 2 years ago

disgames v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

About

Disgames is a powerful Node.js module that allows you to easily play games in the discord using Discord.js module. Using the Discord API.

Installation

Node.js 16.9.0 or newer is required.

npm install disgames
yarn add disgames
pnpm add disgames

Easily example usage (model used for all games)

const { Client, GatewayIntentBits } = require('discord.js');

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

const { Two, Tic } = require('disgames');

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

client.on('interactionCreate', async (interaction) => {
	if (!interaction.isCommand()) return;

	if (interaction.commandName === '2048') {
		new Two({
            interaction,
            size: 4
        }).play()
	}

    if(interaction.commandName === 'tictactoe') {
        new Tic({
            interaction,
            member: interaction.options.getMember('member_option_name')
        })
    };

    // Use this model to run all games
});

client.login('token');

Links

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago