# simple-djs-framework

> ---

Latest version **2.1.1** (published 2023-05-09) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install simple-djs-framework
pnpm add simple-djs-framework
yarn add simple-djs-framework
bun add simple-djs-framework
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2023-05-09 |
| First published | 2023-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16.0.0 |
| Dependencies | 2 |
| Unpacked size | 18.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | alex* |
| Maintainers | alexasterisk |
| Keywords | discord.js, discord, discord bot, framework, djs, simple |

## Links

- npm: https://www.npmjs.com/package/simple-djs-framework
- Repository: https://github.com/alexasterisk/simple-djs-framework
- Homepage: https://github.com/alexasterisk/simple-djs-framework#readme
- Issues: https://github.com/alexasterisk/simple-djs-framework/issues
- npm.io page: https://npm.io/package/simple-djs-framework

## Dependencies (2)

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

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 2.1.1 (latest) — 2023-05-09
- 2.1.0 — 2023-05-09
- 2.0.0 — 2023-01-22
- 1.6.0 — 2023-01-21
- 1.5.0 — 2023-01-20
- 1.4.2 — 2023-01-14
- 1.4.1 — 2023-01-14
- 1.4.0 — 2023-01-14
- 1.3.4 — 2023-01-14
- 1.3.3 — 2023-01-14
- 1.3.2 — 2023-01-14
- 1.3.1 — 2023-01-14
- 1.3.0 — 2023-01-14
- 1.2.2 — 2023-01-14
- 1.2.1 — 2023-01-14
- … 4 more at https://npm.io/package/simple-djs-framework/versions

## README

# Moved to @made-simple/discord.js

# Simple Discord.JS Framework

---

Makes it extremely easy to create and get a bot up and running with [Discord.JS](https://discord.js.org/#/). This framework is designed to get a bot up and running as quickly as possible with minimal effort.

## Installation

```bash
npm install simple-djs-framework
```

## Example Usage

```js
const { Client, SlashCommandBuilder } = require("simple-djs-framework")
const client = new Client([ "Guilds" ])

client.addCommand("ping", {
    description: "Pings the bot.",
    execute: (client, interaction) => {
        interaction.reply("Pong!")
    }
})

client.addEvent("ready", () => console.log("Ready!"))

client.registerCommands() // registers the commands globally
client.start("token")
```

## Examples

### Adding a command

```js
client.addCommand("ping", {
    description: "Pings the bot.",
    execute: (client, interaction) => {
        interaction.reply("Pong!")
    }
})

// commands also support adding more fields

client.addCommand("userjoined", {
    description: "Tells you when a user joined.",
    allowedInDMs: false,
    args: [{
        name: "user",
        type: "user",
        description: "The user to check.",
        required: true
    }],
    execute: (client, interaction) => {
        const user = interaction.options.getUser("user")
        interaction.reply(`${user.username} joined on ${user.createdAt}`)
    }
})
```

### Registering a command

```js
client.registerCommands() // registers the commands globally
client.registerCommands("guildID") // registers the commands in a guild
```

### Adding an event

```js
client.addEvent("ready", (client) => console.log("Ready!"))
```

### Using folders instead of a single file

```js
client.addCommandsFolder("./commands")
client.addEventsFolder("./events")
client.addModalsFolder("./modals")
```

#### Creating a command file

```js
// commands/ping.js

const { SlashCommandBuilder } = require("simple-djs-framework")

export const builder = new SlashCommandBuilder()
    .setName("ping")
    .setDescription("Pings the bot.")

export const execute = (client, interaction) => {
    interaction.reply("Pong!")
}
```

### Creating an event file

```js
// events/ready.js

export const execute = (client) => console.log("Ready!")
```

### Using `dotenv`

```js
require("dotenv").config()
client.start() // token will be read from .env as DISCORD_TOKEN or TOKEN
```

---

## License

[MIT](https://choosealicense.com/licenses/mit/)

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
[Repository](https://github.com/alexasterisk/simple-djs-framework)

## Contributors

[@alexasterisk](https://github.com/alexasterisk)

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