# Initiators

### about initiators&#x20;

initiators are 3-5 lines of code and are required on all NeXos Modules.&#x20;

initiators are what identify each specific module on NeXos. As NeXos's library of Modules grow, its important to have a simple and quick way to identify one's module.

initiators should look like this \\/

```
module.exports = {
	name: 'the name of your module and or command',
	description: 'an awesome and descriptive description!', 
		
```

## Variables&#x20;

`OPTIONS` `UniConnect - Modules, Initiators`

​As of 22/10/2020. you do not need to review the Response section, however, it is useful to know how the bot will behave.\
\
Your command's Initiator must have a name, alias, and description. Arguments checker and Cooldown is optional.

#### Headers

| Name        | Type    | Description                                                                                                |
| ----------- | ------- | ---------------------------------------------------------------------------------------------------------- |
| Name        | object  | Name of your module to be displayed to the user when the user runs ne.help                                 |
| Aliases     | boolean | Not currently documented.                                                                                  |
| Args        | integer | Arguments either, True, or False.                                                                          |
| Description | object  | Description of your Module, also displayed to the user when the user requests help for a specific command. |
| Cooldown    | number  | Cooldown Variable, default is 3 seconds, which should be good for most commands.                           |

{% tabs %}
{% tab title="100 Continue with process, once Dependency Manager requests command info, or process." %}

```
unifiton/depmag > req cominfo
```

{% endtab %}

{% tab title="101 Switch from Dependency Manager to Initiator Manager. Goes through transfer manager." %}

```
unifiton/transfermanager > end depmag


...


process init initmag

  _           _   _                               
 (_)  _ __   (_) | |_   _ __ ___     __ _    __ _ 
 | | | '_ \  | | | __| | '_ ` _ \   / _` |  / _` |
 | | | | | | | | | |_  | | | | | | | (_| | | (_| |
 |_| |_| |_| |_|  \__| |_| |_| |_|  \__,_|  \__, |
                                            |___/ V1

initmag v0.0.1 

initmag/client > init checks

connection...OK
initmag...OK
ping...OK


clear 

init process
```

{% endtab %}

{% tab title="102 Processing any background changes, errors will be catched at this stage and will not proceed to next stage. Will proceed to Code 400 if errors are catched." %}

```
checks, background checks,

errors 
warns
missing files
corrupted files
modified files
background changes
```

{% endtab %}

{% tab title="200 The Initiator Manager has not found any errors and proceed to initiate. Initiator Manager transfers to NeXos." %}

```
      ___           ___           ___            ___           ___     
     /\  \         /\__\         /|  |          /\  \         /\__\    
     \:\  \       /:/ _/_       |:|  |         /::\  \       /:/ _/_   
      \:\  \     /:/ /\__\      |:|  |        /:/\:\  \     /:/ /\  \  
  _____\:\  \   /:/ /:/ _/_   __|:|__|       /:/  \:\  \   /:/ /::\  \ 
 /::::::::\__\ /:/_/:/ /\__\ /::::\__\_____ /:/__/ \:\__\ /:/_/:/\:\__\
 \:\~~\~~\/__/ \:\/:/ /:/  / ~~~~\::::/___/ \:\  \ /:/  / \:\/:/ /:/  /
  \:\  \        \::/_/:/  /      |:|~~|      \:\  /:/  /   \::/ /:/  / 
   \:\  \        \:\/:/  /       |:|  |       \:\/:/  /     \/_/:/  /  
    \:\__\        \::/  /        |:|__|        \::/  /        /:/  /   
     \/__/         \/__/         |/__/          \/__/         \/__/    by Friendsy
     
Checks Cleared, NeXos V17 M2

Command Run 
```

{% endtab %}

{% tab title="201 Completed request and end cycle." %}

```
Request Fufilled 

init end cycle

cycle end...

clear and standby - V17 M2
```

{% endtab %}

{% tab title="400 Also known as exit code 1. With NeXos V18 M2, NeXos will dismiss errors and seamlessly reboot, causing no downtime. In the case the Error Manager cannot seamlessly reboot, it will shutdown and restart, if it fails again afterwards, it will completely shutdown. " %}

```
exit code 1 - close process
```

{% endtab %}

{% tab title="403 Not Documented." %}

```
RESOURCE ACCESS DENIED
```

{% endtab %}

{% tab title="404 Not Found, should give the following response." %}

```
reponse client: there was an error trying to execute that command!
```

{% endtab %}
{% endtabs %}
