royal-handler.js

3.0.1 • Public • Published

Royal-Handler.js

npm i royal-handler.js

npm-searcher package

Why?

Royal Handler allows to make discord bots in a easier and user understable, we provide events handler and command handler in the current version.

How to use?

Royal handler is a discord bot development based package it can be used to easier the work of developers

Example :

const { Client } = require("discord.js");
const { Handler } = require('royal-handler.js');

const client = new Client();
const commands = new Handler({
    commandsDir: './commands',
    Client: client,
    prefix: '!',
    eventsDir: './events',
})
module.exports = client; // required
client.login("TOKEN");
commands.build();

module.exports = client, is required for the events. make a events directory and can use this template -

const client = require('../index');

client.on("ready", async function(){

    console.log("Bot is online")

})

Make a commands directory, then inside the directory make another directory on the topic of the command inside the second directory make the commandname.js file inside that write the following template -

module.exports = {
    name: 'test',

    run: async(client, message, args) => {
        message.channel.send("Hello World")
    }
}

like this you can make 100s of commands!

Contribution

© tsdon0001 2021 | Guitarhost | Github

/royal-handler.js/

    Package Sidebar

    Install

    npm i royal-handler.js

    Weekly Downloads

    0

    Version

    3.0.1

    License

    ISC

    Unpacked Size

    5.67 kB

    Total Files

    3

    Last publish

    Collaborators

    • tsdon0001