discord.js-carlo

7777.0.9 • Public • Published

discord.js-carlo

Discord.js BOT Framework

Features

  • Custom command handler
  • Custom Logger
    • Console logging
      • ERRORS
      • PASSES
      • WARNINGS
    • Built in Discord chat logging
      • DM
      • GROUP
      • SERVER

Example

index.js

const Carlo = require('./index');
const carlo = new  Carlo({
    commands: __dirname + '/commands/', //Path to commands folder
    token: '', // BOT token
    prefix: '!', // BOT prefix
    logChat: true  // Built in chat logging
});
 
const client = carlo._getClient(); // _getClient() is the same as Discord.Client()
const logger = carlo._getLogger(); // get custom logger
 
client.on('message', message => {
    logger.pass(`this is a success`);
    logger.error(`this is an erorr`);
    logger.warn(`this is a warning`);
});

Command Example

/commands/ping.js

class PingCommand {
    constructor() {
        this.name = 'ping', // command name
        this.alias = [''], // alias
        this.usage = '!ping' // usage/description
    }
    
    async run(client, message, args) {
        try {
            //do code
            message.channel.send(`${client.ping}ms`);
        } catch(error) { throw error; }
    }
};
 
module.exports = PingCommand;

Custom-logger

Package Sidebar

Install

npm i discord.js-carlo

Weekly Downloads

0

Version

7777.0.9

License

MIT

Unpacked Size

26.1 kB

Total Files

13

Last publish

Collaborators

  • moldy23