Coder Social home page Coder Social logo

melbot.js's Introduction

Melbot.js is a bot template using discord.js

Adding commands

The commands must follow a certain format

/**
 * This method should return the response directly to the channel
 * @param {*string array} params 
 * @param {*message} message
 */
async function command(params, message) {
    /**
      Command logic
    */
}
/**
 * description of the command
 */
const description = "plays ping pong";
/**
 * Define Exports
 */
module.exports = {
    execute: command,
    description: description
};

The next step is to map it in commandlist.js

Adding Modules

Modules is bot code that is independent of the commands To add a module, just declare it under modules and require it in modules.js

Settings

All settings should be put under settings.json Sample settings.json is already provided

{
    "token": "TOKEN_HERE",
    "owners": [
        "184547913509109761"
    ],
    "identifier": "~",
    "delimiter": " "
}

Reaction Nav

Using the reaction nav provided is simple

    msg.react('▶').then(
    msg.react('◀')).then(
    msg.react('⏩')).then(
    msg.react('⏪')
    );
bot.emit('addNav', { message: msg, exec: p2str, arr: plist, index: 0 });
/**
message => is the sent message
exec => is a function that works on the values in arr[index] to give a text
arr => array of data
index => start index
**/

Complex music module

Melbot.js comes with a complex music module which spawns new instances of itself and manages the music overload. This makes sure that you have maximum performance always

melbot.js's People

Contributors

meldsza avatar okeplazma avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.