DEV Community

Cover image for Introducing DevTools Plugin for Enhanced Robo.js Development
WavePlay Staff for WavePlay

Posted on • Originally published at blog.waveplay.com

Introducing DevTools Plugin for Enhanced Robo.js Development

Robo.js is a framework designed for creating Discord.js 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.

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:

npx robo add @roboplay/plugin-devtools
Enter fullscreen mode Exit fullscreen mode

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

npx create-robo <project-name> -p @roboplay/plugin-devtools
Enter fullscreen mode Exit fullscreen mode

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 for practical usage examples.

The above commands are an excellent way to test Robo APIs such as Flashcore, Sage, 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:

export default {
    monitorInterval: 10_000, // Every 10 seconds
    monitorResources: true // Enable resource monitoring
}
Enter fullscreen mode Exit fullscreen mode

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:

npx robo remove @roboplay/plugin-devtools
Enter fullscreen mode Exit fullscreen mode

Join the Robo.js Adventure

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

npx create-robo <name>
Enter fullscreen mode Exit fullscreen mode

âžž Documentation: Getting started

âžž Community: Join our Discord server

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

Top comments (0)