# S4D Guide

First you need to install discord.js 13v by doing this in shell!

```
npm i discord.js@latest
```

{% hint style="info" %}
If in package.json file you already have  got `discord.js  13v` then ignore above.
{% endhint %}

## Installing NodeJS 16v on Replit

Discord.JS v13 requires NodeJS v16 or newer

On replit got to shell tab to execute the command.

{% hint style="danger" %}
Not in Console.
{% endhint %}

```
npm i --save-dev node@16 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH
```

After you are done with this,

Execute this to clean npm cache and reinstall the package in the shell

```
rm -rf node_modules && rm package-lock.json && npm cache clear --force && npm cache clean --force && npm i
```

* [ ] Now on replit make a new file named - .replit
* [ ] To execute node from the shell instead of the console.
* [ ] Put this in the .replit file

```
run="npm start"
```

Make sure to add the start script and other scripts in your package.json file

```
"scripts": {
 "start": "node .",
  "node-update": "npm i --save-dev node@16 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH",
  "node-clean": "rm -rf node_modules && rm package-lock.json && npm cache clear --force && npm cache clean --force && npm i"
}
```

![My main file is index.js your can be different mostly- bot.js or server.js](/files/-Mhx2O6nGpwGJBI3zxQ9)

This is how a normal (without extra packages should look).

After Completing these steps,

You need to export your code and copy everything the premade code too and put in your main file.

To start your bot you need to enter this this in shell and press enter.

```
node .
```

After this your bot will start!

Have Fun making commands!!

For help 👇

{% hint style="success" %}
Ask in help and support channel s4d Community Server
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://odkm.gitbook.io/s4dguide/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
