Introducing DevTools Plugin for Enhanced Robo.js Development
Tags: javascript, programming, node, discord
Published: 2023-12-03 19:37:01

> **[Robo.js](https://github.com/Wave-Play/robo.js)** is a framework designed for creating **[Discord.js](https://discord.js.org)** bots with ease and best practices by default. Plugins extend your bot's features right away!

---

We're happy to introduce `@roboplay/plugin-devtools`, a comprehensive development toolkit designed specifically for debugging **Discord.js** bots created with the **[Robo.js framework](https://github.com/Wave-Play/robo)**.

Whether you're testing APIs, monitoring resources, or emulating specific behaviors, this plugin streamlines the process, making development with Robo.js more efficient and enjoyable.

## Installation 💻

To add this plugin to your Robo.js project:

```bash
npx robo add @roboplay/plugin-devtools
```

New to Robo.js? Start your project with this plugin pre-installed:

```bash
npx create-robo <project-name> -p @roboplay/plugin-devtools
```

## Development-Focused Commands

The plugin offers a variety of commands to enhance your development workflow:

- `/devtools example defer`: Demonstrates Sage's auto deferral feature with different behaviors.
- `/devtools example error`: Intentionally triggers errors, useful for testing Sage's debug mode.
- `/devtools example permission-dm`: Shows how slash commands work outside direct messages.
- `/devtools flashcore clear`: Clears all values in Flashcore (use with caution!).
- `/devtools flashcore delete`: Deletes a specific key from Flashcore.
- `/devtools flashcore get`: Retrieves the current value of a specific Flashcore key.
- `/devtools flashcore set`: Sets a value for a given Flashcore key.
- `/devtools flashcore watch`: Monitors changes to Flashcore keys, sending notifications on updates.
- `/devtools module check`: Checks if a specific module is active.
- `/devtools module set`: Toggles the active state of a module.
- `/devtools state get`: Fetches a state value.
- `/devtools state set`: Sets a state value.

Dive into the [plugin's source code](https://github.com/Wave-Play/robo.js/tree/main/packages/plugin-devtools) for practical usage examples.

The above commands are an excellent way to test Robo APIs such as [Flashcore](https://docs.roboplay.dev/docs/basics/flashcore), [Sage](https://docs.roboplay.dev/docs/basics/sage), [States](https://docs.roboplay.dev/docs/basics/states), and more. They also provide a glimpse into the inner workings of Robo.js, helping you understand the framework better.

## Essential Resource Monitoring

Stay ahead of performance issues with the resource monitoring feature. This function allows you to keep track of your Robo's CPU and RAM usage, helping you identify and address any performance bottlenecks.

Enable it in the plugin configuration:

```js
export default {
	monitorInterval: 10_000, // Every 10 seconds
	monitorResources: true // Enable resource monitoring
}
```

## A Note on Deployment

`@roboplay/plugin-devtools` is tailored for development environments. Remember to remove it before deploying your Robo to safeguard your server and database:

```bash
npx robo remove @roboplay/plugin-devtools
```


## Join the Robo.js Adventure

New to Robo.js? Start building your own feature-rich Discord.js bot today:

```bash
npx create-robo <name>
```

➞ [**Documentation:** Getting started](https://roboplay.dev/docs)

➞ [**Community:** Join our Discord server](https://roboplay.dev/discord)

Upgrade your Robo.js development with `@roboplay/plugin-devtools` and experience a streamlined, efficient development process.