npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

revolthandler.js

v2.4.31

Published

Handle your code for revolt.js

Readme

revolthandler.js

Description

Easy command handling for revolt.js

Table of contents

About

command handler for revolt.js bot project

Badges

NPM Downloads

Install

npm i revolthandler.js

Example

Handler

Setup

CommonJS

const revolt = require("revolt.js");
const client = new revolt.Client();
const revoltHandler = require("revolthandler.js");
const handler = new revoltHandler.Handler({
    client: client, //required
    prefix: "!", //required
    owners: ["Your Revolt ID"], //optional , optional add more owner Id
    path: "./commands", //optional, (default : "./commands")
});
client.once("ready", () => {
    handler.start();
});
client.loginBot("YOUR_BOT_TOKEN_HERE");

EsModule

//...
import { Handler } from "revolthandler.js";
const handler = new Handler({
    client: client, //required
    prefix: "!", //required
    owners: ["Your Revolt ID"], //optional , optional add more owner Id
    path: "./commands", //optinal, (default : "./commands")
});
//...

Standart using example

CommonJS

//"./commands/general/ping.js"
exports.default = {
    name: "ping",
    description: "Ping!", //description :P
    //Be careful
    code(message, args, client) {
        //Your code here
        message.channel.sendMessage("Pong");
    },
};

EsModule

export default {
  name:"ping",
  description:"Ping!"
  code(message:any,args:string[],client:any){
    //Your code here
  }
}

Aliases example

//"./commands/general/ping.js"
exports.default = {
    name: ["ping", "delay"],
    description: "Ping!", //description :P
    //Be careful
    code(message, args, client /*,command*/) {
        //Your code here
    },
};

Only owner command example

//"./commands/owner/test.js"
exports.default = {
    name: ["eval", "deneme"],
    ownerOnly: {
        errorMsg(message, args, client, command) {
            //optional
            message.reply("You can't use this command");
        },
    },
    code(message, args, client) {
        //your code here
    },
};

Only perms command example

//"./commands/moderate/perm.js"
exports.default = {
    name: "perm",
    permissions: {
        perms: {
            user: ["KickMembers"],
            bot: ["KickMembers"],
        }, //You can see the perm names in : https://revolt.js.org/classes/ServerMember.html#hasPermission
        errorMsg(message, args, client, command) {
            //optional
            message.reply(
                `You must have ${command.permission.perms.user.join(
                    ","
                )} permission(s) to use this command`
            );
        },
        botErrorMsg(message, args, client, command) {
            //optional
            message.reply(
                `I need the ${command.permission.perms.bot.join(
                    ","
                )} permission(s) to execute this command`
            );
        },
    },
    code(msg, args, client) {
        //Your code here
    },
};

Guild Only

//"./commands/general/indm.js"
exports.default = {
    name: "in-server",
    guildOnly: {
        errorMsg(message, author, client) {
            //optional
            message.reply("You can't use this commmand in dm or group");
        },
    },
    code(message, args, client) {
        //Your code here
    },
};

Non Prefixed

//"./commands/general/nonprefixed.js"
exports.default = {
    name: "withoutprefix", //WARN : The command name is case sensitive here!
    nonPrefixed: true,
    code(message, args, client) {
        //Your code here
    },
};

Embed Builder & Uploader

All in one

const { EmbedBuilder, Uploader } = require("revolthandler.js");
exports.default = {
    name: "coolembed",
    async code(message, args, client) {
        const myuploader = new Uploader(client);
        const myemb = new EmbedBuilder();
        myemb
            .setDescription("Cool describe")
            .setColour("red") //hex code or name is acceptable
            .setTitle("Cool title")
            .setMedia(
                await myuploader.upload("imagelink/imagebuffer", "filename.png")
            ) ////You can add an big picture or file
            .setUrl("https://www.npmjs.com/package/revolthandler.js")
            .setIconUrl("imagelink"); //You can add an picture in front of the title
        message.channel.sendMessage({ embeds: [myemb] });
    },
};

Will add new features in the future