Command initialization method

Some commands may require you to run code when they are loaded. You can use the init() method within your command to handle this type of functionality:

typescript
import { Client } from 'discord.js'
import NYXBCommands, { CommandObject, CommandType } from '@nyxb/commands'

export default {
  description: 'Ping pong command',
  type: CommandType.BOTH,

  init: (client: Client, instance: NYXBCommands) => {
    console.log('Ping command has been loaded')
  },

  callback: () => {
    return {
      content: 'Pong!',
    }
  },
} as CommandObject
javascript
const { CommandType } = require('@nyxb/commands')

module.exports = {
  description: 'Ping pong command',
  type: CommandType.BOTH,

  init: (client, instance) => {
    console.log('Ping command has been loaded')
  },

  callback: () => {
    return {
      content: 'Pong!',
    }
  },
}