0.2.0 • Published 2 years ago
djswrapper v0.2.0
Discord.js Wrapper
A wrapper and handler for the discord.js package
Installing
Via the terminal \ shell :
npm i djswrapper
And then in your code :
const djswrapper = require('djswrapper');
Example
const { Client } = require('discord.js');
//The discord.js package
const { easyDjsClient, easyDjsLogin, easyDjsCommand, easyDjsLogOnReady, easyDjsIntents } = require('djswrapper')
//The easydjs package, with all of the latest methods
const client = new Client({ intents: easyDjsIntents({
intenets: "default"
// Default / Messages / Guild
})
});
easyDjsClient(client);
//Sets the easyDjs client as the main bot client
easyDjsLogOnReady({
log: "Online!"
//console.log('Online!') when the bot is ready
})
easyDjsCommand({
method: "message",
name: "!ping",
code: "<@$authorID> Pong! (\`$pingms.\`) 🏓"
}); //A simple ping-pong example command, which in message and not in interaction.
easyDjsCommand({
method: "startWith",
name: "!say",
code: `$message \n||Sent By $authorFullUsername||`
//A simple say command, that is also says who ran the command.
});
easyDjsLogin('Your Bot Token');
//Login with the easyDjs login method
Functions
A list of the functions you can use in the easyDjsCommand
.
- $authorID : The author id
- $ping : The ping of the bot, in ms. Returns only int, without the ms.
- $message : Works only in the
startWith
method. The arguments of the command. If there are none, it will return the command itself. - $fullCmd : The full command, with all of the arguments.
- $authorUsername : The username of the author.
- $authorFullTag : The full tag of the author (username + discriminator).
Methods
The methods you can use in easyDjsCommand
.
startWith
Check if the message of the user starts with the command name used.
message
Check if the specifed command is exect like the user message.
License
This package is under the MIT license.