What is this?
This is a module developed by Arkade , to make fellow developers life easier. This has prewritten functions , with which you can make a great command handler , and add reaction collectors easily too! We will be adding more features.
Installation
npm i arkade-modules
Usage
const arkadeEngine = require('arkade-modules')
Make a Command Handler
Put this in index.js
const arkadeEngine = require('arkade-modules')
const arkade = new arkadeEngine("YOURTOKEN" , {
cooldown:true,
prefix:'YOURPREFIX'
})
arkade.createHandler();
We recommend storing token in an env file , and prefix in a config file
Default commands
Default commands are a work in progress , and we have only one as of now , which is reload To use Default commands , do this , above arkade.createHandler();
arkade.loadDefault({
});
Later on , when we add mroe default commands , you can pass in addditional parametrs , if you dont want specific commmands
arkade.loadDefault({
reload:false
});
How to use Command handler
Create a folder called commands , and multiple folders inside it as categories The Syntax is really simple , dont worry!
module.exports={
name:"test",
description:"testing",
async run(message , args){
message.channel.send("Hi!")
}
}
With ArkadeHandler you also get option to add cooldown , just under description , write
cooldown:timeinseconds
You can also add aliases
aliases:["alias1" , "alias2"]
See! Its really simple
Reaction Pages
const Discord = require("discord.js");
const engine = require('arkade-modules')
module.exports = {
name:"test",
description:"testing",
async run(message,args){
const arkadeEngine = new engine();
arkadeEngine.createReactionPages(['hi' , 'sup' ,'bro'] , message)
}
}
However here are the two lines to look at
const arkadeEngine = new engine();
arkadeEngine.createReactionPages(['hi' , 'sup' ,'bro'] , message)
The line const arkadeEngine = new engine();
is used to create a new instance of our module , so it will be there in every single command.
arkadeEngine.createReactionPages(['hi' , 'sup' ,'bro'] , message)
The first parameter is an array , in which you will store all your messages , this can be embeds or regular messages , the next parameter is message , which is required for the bot to function
Reaction Collector
const Discord = require("discord.js");
const engine = require('arkade-modules')
module.exports = {
name:"test",
description:"testing",
async run(message,args){
const arkadeEngine = new engine();
arkadeEngine.createReactionCollector('sup' , ['📩'] , ['no u'] , message)
}
}
Here , in arkadeEngine.createReactionCollector('sup' , ['📩'] , ['no u'] , message)
, the first parameter is the original message , The next parameter is an array , which will contain all emojis , after that will be an array of values you want each emoji to respond with , then we will pass in message .
OPTIONAL:
You can also pass in a role , after the message parameter if you want reaction roles
And after that you can also pass in functions as paramaters. However the functions are still in development