# disgames

> [Disgames](https://github.com/SrWhale/disgames) is a powerful [Node.js](https://nodejs.org) module that allows you to easily play games in the discord using [Discord.js](https://github.com/discordjs/discord.js) module. Using the [Discord API](https://dis

Latest version **1.0.2** (published 2022-02-16) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install disgames
pnpm add disgames
yarn add disgames
bun add disgames
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-02-16 |
| First published | 2022-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 46.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | SrWhale |
| Maintainers | srwhale |
| Keywords | discord.js, discord, games, discord.js-games, 2048, tictactoe, checkers, chess, connectfour |

## Links

- npm: https://www.npmjs.com/package/disgames
- Repository: https://github.com/SrWhale/disgames
- Homepage: https://github.com/SrWhale/disgames#readme
- Issues: https://github.com/SrWhale/disgames/issues
- npm.io page: https://npm.io/package/disgames

## Dependencies (1)

- [discord.js](https://npm.io/package/discord.js.md) ^13.6.0

## Recent versions

- 1.0.2 (latest) — 2022-02-16
- 1.0.1 — 2022-02-16
- 1.0.0 — 2022-02-16
- 0.0.9 — 2022-02-13
- 0.0.8 — 2022-02-13
- 0.0.7 — 2022-02-13
- 0.0.6 — 2022-02-11
- 0.0.5 — 2022-02-11
- 0.0.4 — 2022-02-11
- 0.0.3 — 2022-02-11
- 0.0.2 — 2022-02-11
- 0.0.1 — 2022-02-09

## README

## About

[Disgames](https://github.com/SrWhale/disgames) is a powerful [Node.js](https://nodejs.org) module that allows you to easily play games in the discord using [Discord.js](https://github.com/discordjs/discord.js) module.
Using the [Discord API](https://discord.com/developers/docs/intro).

## Installation

**Node.js 16.9.0 or newer is required.**

```sh-session
npm install disgames
yarn add disgames
pnpm add disgames
```

## Easily example usage (model used for all games)

```js
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

- [Discord API Discord server](https://discord.gg/discord-api)
- [GitHub](https://github.com/discordjs/discord.js)
- [npm](https://www.npmjs.com/package/disgames)

---
_Source: https://npm.io/package/disgames · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
