6.4.4 • Published 1 year ago

ffg-discord-framework v6.4.4

Weekly downloads
13
License
MIT
Repository
github
Last release
1 year ago

ffg-discord-framework

Powered by Discord.JS

Authors

  • FFGFlash

Table of Contents

< Installing

> npm install --save ffg-discord-framework

< Examples

< Client

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')

< Command

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!')
    }
}
6.1.0

1 year ago

6.0.0

1 year ago

6.3.0

1 year ago

6.1.2

1 year ago

6.2.0

1 year ago

6.1.1

1 year ago

6.4.1

1 year ago

6.1.4

1 year ago

6.4.0

1 year ago

6.3.1

1 year ago

6.1.3

1 year ago

6.4.3

1 year ago

6.4.2

1 year ago

6.4.4

1 year ago

5.0.0-alpha.5

2 years ago

5.0.0-alpha.4

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

5.0.0-alpha.3

3 years ago

5.0.0-alpha.2

3 years ago

5.0.0-alpha.1

3 years ago

5.0.0-alpha.0

3 years ago

4.0.0-alpha.7

3 years ago

4.0.0-alpha.8

3 years ago

4.0.0-alpha.5

3 years ago

4.0.0-alpha.6

3 years ago

4.0.0-alpha.3

3 years ago

4.0.0-alpha.4

3 years ago

4.0.0-alpha.1

3 years ago

4.0.0-alpha.2

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago