# robotcord

> botcord - alphadiscor - final version release

Latest version **1.5.4** (published 2022-10-13) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install robotcord
pnpm add robotcord
yarn add robotcord
bun add robotcord
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.4 |
| Published | 2022-10-13 |
| First published | 2022-10-13 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 30.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Wuarranian |
| Maintainers | n__n |
| Keywords | bots, bot, discordjs, discord, botcord |

## Links

- npm: https://www.npmjs.com/package/robotcord
- npm.io page: https://npm.io/package/robotcord

## Dependencies (3)

- [discord.js](https://npm.io/package/discord.js.md) ^13.3.1
- [@discordjs/rest](https://npm.io/package/@discordjs/rest.md) ^0.1.0-canary.0
- [discord-api-types](https://npm.io/package/discord-api-types.md) ^0.24.0

## Recent versions

- 1.5.4 (latest) — 2022-10-13

## README

# 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()
⠀
⠀

---
_Source: https://npm.io/package/robotcord · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
