# ffg-discord-framework

> - FFGFlash

Latest version **6.4.4** (published 2022-12-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install ffg-discord-framework
pnpm add ffg-discord-framework
yarn add ffg-discord-framework
bun add ffg-discord-framework
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.4.4 |
| Published | 2022-12-28 |
| First published | 2021-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 40.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Drake Taylor |
| Maintainers | ffgflash |
| Keywords | discord, discord.js, typescript, javascript, ts, js, bot, framework |

## Links

- npm: https://www.npmjs.com/package/ffg-discord-framework
- Repository: https://github.com/FFGFlash/ffg-discord-framework
- Homepage: https://github.com/FFGFlash/ffg-discord-framework#readme
- Issues: https://github.com/FFGFlash/ffg-discord-framework/issues
- npm.io page: https://npm.io/package/ffg-discord-framework

## Dependencies (1)

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

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 6.4.4 (latest) — 2022-12-28
- 5.0.0-alpha.5 (alpha) — 2021-11-22
- 6.4.3 — 2022-12-28
- 6.4.2 — 2022-12-28
- 6.4.1 — 2022-12-28
- 6.4.0 — 2022-12-28
- 6.3.1 — 2022-12-28
- 6.3.0 — 2022-12-28
- 6.2.0 — 2022-12-28
- 6.1.4 — 2022-12-28
- 6.1.3 — 2022-12-28
- 6.1.2 — 2022-12-28
- 6.1.1 — 2022-12-28
- 6.1.0 — 2022-12-28
- 6.0.0 — 2022-12-28
- … 21 more at https://npm.io/package/ffg-discord-framework/versions

## README

# ffg-discord-framework
### Powered by [Discord.JS](https://discord.js.org)
#### Authors
- FFGFlash

## Table of Contents
- [Installing](#-installing)
- [Examples](#-examples)
    - [Client](#-client)
    - [Command](#-command)

## <small>[<](#table-of-contents)</small> Installing
```bat
> npm install --save ffg-discord-framework
```

## <small>[<](#table-of-contents)</small> Examples
#### <small>[<](#table-of-contents)</small> Client
```js
const Client = require('ffg-discord-framework')

const client = new Client({ 
    intents: [ 'MessageContent', 'GuildMessages', 'DirectMessages' ],
    prefix: '!', // The prefix used to identify commands
    cleanupAfter: 5000 // How long to wait before deleting message responses
})

client.login('bot-token')
```

#### <small>[<](#table-of-contents)</small> Command
```js
const { Command } = require('ffg-discord-framework')

@Command
class Ping {
    constructor() {
        this.name = 'ping' // all lowercase name of the command
        this.description = 'A simple test command' // description of the command
        this.arguments = [] // argument list
        this.aliases = [ 'p' ] // alternative names for identifying the command
        this.permissions = 'Administrator' // permissions required to execute the command
        this.guildOnly = false // whether this command can only be used inside of a guild
    }

    /**
     * Function used to pass the client to the command
     * 
     * @param {Client} client - The bot client
     */
    initialize(client) {
        this.client = client
    }

    /**
     * Execute function which can either return undefined, message or a Promise,
     * if returned with a message or a Promise that resolves to a message
     * it'll cleanup the message after a specified amount of time
     * 
     * @param {Message} message - Discord Message Object
     * @param {...} args - List of arguments
     * @returns {undefined | Message | Promise<undefined | Message>} The response made by the command to cleanup after the specified amount of time
     */
    execute(message, ...args) {
        console.log('Client:', this.client)
        console.log('Arguments:', args.join(' '))
        return message.reply('Pong!')
    }
}
```

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