1.5.4 • Published 2 years ago

robotcord v1.5.4

Weekly downloads
-
License
Apache 2.0
Repository
-
Last release
2 years ago

RobotCord

Robotcord is the updated version of Botcord and AlphaDiscor - is a library to make the development of bots more easy with discord.js ⠀ ⠀


Important 📢

This library is the updated version (djs 13) of https://www.npmjs.com/package/botcord ⠀ ⠀


Import - and use your type of profile 📚

 // Example for use regular bot

 require("robotcord").start("TOKEN").regularify()

 // (mongosify() "for mongo db", replitify() "for replit workers")

⠀ ⠀


Create modules 🎻

You will need to create certain folders for "modules" - modules is the form that robotcord works - basically create the following folders : ("commands", "events", "data") ⠀ ⠀


Commands folder 📗

There is no command per file - there is group of commands per file - where you can export an array of commands data - all commands are slash commands

Every command is representated within an object with the following propertys ⠀

name: <string> / <required> ,

execution: <function> / <required>,

cd: <number> / <optional>,

paremeters: <array {
    
            type: <("member", "string", "channel", "role", "number")> / <required>,

            name: <string> / <required>,

            description: <string> / <optional>

            }> / <optional>,

permissions: <array (permission flag names)> / <optional>,

description: <string> / <optional>,

nsfw: <boolean> / <optional>

The execution function will be given with 2 parameters - response that is a the command interaction data and self that is the data given by robotcord ⠀

 module.exports = [

    {

        name: "ping",

        execution: (response) => response.reply({content: "pong"})

    },

    {

        name: "say",

        paremeters: [{name: "words", type: "string", description: "words to say", required: true}],

        execution: (response) => response.reply({content: response.options.get("words") || "nothing"})

    }

 ]

⠀ ⠀


Events folder 📘

As another normal handlers - you create a file per event with the following data ⠀

type: <string (name of the event)> / <required>,

execution: <function> / <required>

⠀ The execution function will be given with (n) parameters - representating the default djs event parameters + (another robotcord data like functions / tables and more) ⠀

module.exports = {

    type: "messageCreate",

    execution: (message, secondParameter, self) => {

        // self is the robotcord data - secondParamter is the second parameter if there is one

        message.channel.send({content: "message handled"})

    }

}

⠀ ⠀


Data folder 📙

Data folder is a especific place to put your robotcord data and is optional - you can create your handler file or embeds file in another place (however is recommended to save this files on an especific folder) ⠀ ⠀


Example of use 💻

Example index 🎮 ( index.js ) ⠀ ⠀

require("robotcord").start("TOKEN")
.handler("./data/handler")
.regularify()

⠀ ⠀ Example module 👾 ( commands/random.js ) ⠀ ⠀

module.exports = [

    {

        name: "ping",

        cd: 5,

        execution: (response) => response.reply({content: "pong"})
        
    }

]

⠀ ⠀ Example handler 🩹 ( data/handler.js ) ⠀ ⠀

module.exports = {

    onCD(response, cd) => response.reply({content: "you are in a cd of " + cd})

}

⠀ ⠀


Deployement 📦

Only execute the principal file and all will be done - also you can configure the enviroment in the options or whit robotcord (base) methods like mongosify() ⠀ ⠀

1.4.9

2 years ago

1.5.4

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago