> For the complete documentation index, see [llms.txt](https://prodigous.gitbook.io/prodigo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prodigous.gitbook.io/prodigo/methods.md).

# Commands

{% hint style="warning" %}
For this to work make sure to install [discord.js](https://www.npmjs.com/package/discord.js)
{% endhint %}

## Basic Setup

```javascript
const Discord = require('discord.js') //npm i discord.js
const client = new Discord.Client()
const prodigous = require('prodigous') //npm i prodigous
const prefix = "!"
client.on('ready', () => {
console.log(`logged in as ${client.user.username}`)
})
client.on('message', async(message) => {
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'commandName') {
message.channel.send("working")
}
})
client.login("TOKEN")
```

### Have a advance command handler?

The function all works the same way just import the package on every file where you want to use the package

## Command list

### Economy

{% hint style="danger" %}
Before using any of these methods do the following:
{% endhint %}

```javascript
await prodigous.connect("MONGO_DB_URI") //Put this at the bottom in index.js or your main file
```

#### Balance Command

```javascript
if(command === 'balance') {
let member = message.mentions.users.first() || message.author;
await prodigous.balanceCommand(message, member.id)
}
//Four lines
```

#### Reset all command

```javascript
if(command === "resetall") {
await prodigous.resetAll(message) //Resets all the currency to 0
} 
```

#### Leaderboard command

```javascript
if(command === 'leaderboard') {
await prodigous.leaderboardCommand(message, client)
}
```

#### Add money command

```javascript
if(command === 'add') {
let member = message.mentions.users.first()
if(!member) return message.channel.send("Invalid member")
if(!args[1]) return message.channel.send("Need a amount")
await prodigous.addCommand(member.id, args[1])
}
```

{% hint style="danger" %}
The following commands are still in **Beta**
{% endhint %}

**Blackjack command**

```javascript
if(command === 'blackjack') {
await prodigous.blackjackCommand(message)
}
```

## Voice Tracker

{% hint style="danger" %}
Before using any of these method do the following
{% endhint %}

```javascript
client.on('voiceStateUpdate', async(oldState, newState) => {
await prodigous.voiceStart(oldState, newState)
})
```

{% hint style="danger" %}
These methods are still in beta so use it at your own risk
{% endhint %}

#### Time command

```javascript
if(command === 'time') {
let member = message.mentions.users.first() || message.author;
await prodigous.timeCommand(member.id, message) //get user time spend in vc
}
```

#### Voice leaderboard command

```javascript
if(command === 'voice-lb') {
await prodigous.voiceLeaderboard(client, message)
}
```

#### More command coming soon...


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://prodigous.gitbook.io/prodigo/methods.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.
