0.1.1 • Published 5 years ago
powerds v0.1.1
###About PowerDS
This is a package-based discord.js addon (Now in beta)
##Why PowerDS
This addon has a easy usage. You can easily manage packets and catching commands
###Documentation
##Loging in
For loging in you just need to create a object of PowerClient
const $ = require('powerds');
const client = $.PowerClient('token', 'prefix');
You will automatially login in
##Packages
#Create a package
Packages (or Asset Packages) is a objects which contains a declarations of different events like OnCommandSendedEvent(event)
For declare a package use PowerClient.CreatePackage(name, callback)
client.CreatePackage('main', pkg => { //pkg is our package object
pkg.OnCommandSendedEvent(event => { //Event declaration
//Event implementation
})
//Other events
})
##Events
#OnCommandSendedEvent
This event using for make command implementations. Callback value is Command object
const $ = require('powerds');
const client = $.PowerClient('token'); //Prefix is automatiallsy setted to '$'
client.CreatePackage('main', pkg => {
pkg.OnCommandSendedEvent(event => { //Event here is a Command object
event.OnCommand('hello').then((message, args) => { //Definition of command
$.printf(message.channel, 'world'); //Send 'world' to a channel
});
event.OnCommand('text').argMinCount(1, 'I nead at lest one argument').then((message, args) => { //Definition of command with minimum one argument
$.printf(message.channel, args[1]); //Argument array startr from 1
});
})
})