6.4.4 • Published 2 years ago
ffg-discord-framework v6.4.4
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
2 years ago
6.0.0
2 years ago
6.3.0
2 years ago
6.1.2
2 years ago
6.2.0
2 years ago
6.1.1
2 years ago
6.4.1
2 years ago
6.1.4
2 years ago
6.4.0
2 years ago
6.3.1
2 years ago
6.1.3
2 years ago
6.4.3
2 years ago
6.4.2
2 years ago
6.4.4
2 years ago
5.0.0-alpha.5
4 years ago
5.0.0-alpha.4
4 years ago
4.0.1
4 years ago
4.0.0
4 years ago
5.0.0-alpha.3
4 years ago
5.0.0-alpha.2
4 years ago
5.0.0-alpha.1
4 years ago
5.0.0-alpha.0
4 years ago
4.0.0-alpha.7
4 years ago
4.0.0-alpha.8
4 years ago
4.0.0-alpha.5
4 years ago
4.0.0-alpha.6
4 years ago
4.0.0-alpha.3
4 years ago
4.0.0-alpha.4
4 years ago
4.0.0-alpha.1
4 years ago
4.0.0-alpha.2
4 years ago
3.1.0
4 years ago
3.0.0
4 years ago
2.1.0
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago