royal-handler.js
v3.0.1
Published
An npm package to help discord bot builders
Downloads
3
Maintainers
Readme
Royal-Handler.js
npm i royal-handler.js
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