nesbro.js v1.0.8
Nesbro.js
Nesbro.js is a easy way to use discord.js, bare in mind it uses discord.js version 12.5.1
Installation
$ npm i nesbro.js
What It Includes
ClientCreate
It creates client variables like client.prefix, client.token etc. In all it has prefix, token and embedColor
Example:
const djs = require('discord.js')
const simply = require('nesbro.js')
const client = new djs.Client()
simply.clientCreate(client, 'your bot token', 'Embed Color Here', 'Prefix Here' )
ClientLogin
Logins to the discord bot with the token you provided in ClientCreate
.
Example:
const djs = require('discord.js')
const simply = require('nesbro.js')
const client = new djs.Client()
simply.clientCreate(client, 'your bot token', 'Embed Color Here', 'Prefix Here')
simply.clientLogin(client)
ClientReady
Dose the client.on('ready')
function with the parameters client, typeT, description, statusT
typeT is for what type like WATCHING, LISTENING, PLAYING.
description is for what do you want it to say after the type. statusT is what do you want status of bot to be like dnd, idle, online
!
Example:
const djs = require('discord.js')
const simply = require('nesbro.js')
const client = new djs.Client()
simply.clientCreate(client, 'your bot token', 'Embed Color Here', 'Prefix Here' )
simply.clientReady(client, 'WATCHING', 'your bot status', 'dnd')
simply.clientLogin(client)
ClientMessage
Dose the client.on('message')
function, use it with CreateHandler
for it to work proberly.
Example:
const djs = require('discord.js')
const simply = require('nesbro.js')
const client = new djs.Client()
simply.clientCreate(client, 'your bot token', 'Embed Color Here', 'prefix here' )
simply.clientReady(client, 'WATCHING', 'your bot status', 'dnd')
simply.clientMessage(client)
simply.clientLogin(client)
CreateHandler
It Creates a command handler for the bot. Use it along with ClientMessage
for it to work..
Example:
const djs = require('discord.js')
const simply = require('nesbro.js')
const client = new djs.Client()
simply.clientCreate(client, 'your bot token', 'Red', 'Prefix Here' )
simply.clientReady(client, 'WATCHING', 'Your Status', 'dnd')
simply.createHandler(client, 'your commands folder name like commands, cmds etc')
simply.clientMessage(client)
simply.clientLogin(client)
// A command file in your directory folder Like commands/ping.js. Ping Command example:
const Discord = require('discord.js');
module.exports = {
name: 'ping',
description: 'Shows ping of the bot.',
async execute(message, args, client) {
message.reply('Pinging...').then(resultMessage => {
const ping = resultMessage createdTimestamp - message.createdTimestamp;
message.reply(`**Bot latency: \n ${ping}ms \n API latency: \n ${client.ws.ping}ms**`)
})
}
};