robotcord v1.5.4
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() ⠀ ⠀
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago