Package Exports
- @evodev/discord.plus
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@evodev/discord.plus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Discord.Plus
Is a wrapper package of Discord.JS that can make bots can communicate with other bots throught our site (We use socket.io for this) and the bots must those use this package. And also this package have command handler that can help Devs set their bots' commands!
How To Use
Command Handler Example
const { CommandHandler } = require("discord.plus");
const { Client } = require("discord.js");
const prefix = "!";
CommandHandler.set("say", {
name: "say",
run: async (client, message, args) => {
return message.channel.send(args.join(" "));
}
});
client.on("message", async msg => {
const args = msg.content
.trim()
.slice(prefix.length)
.split(/ +/g);
const cmd = args.shift().toLowerCase();
if (cmd.charAt(0) !== prefix) return;
// Running command based on input
if (!CommandHandler.has(cmd)) return;
CommandHandler.get(cmd)(client, message, args);
});
Communication Example
let BetterDiscord = require("discord.plus");
let cBD = new BetterDiscord.Communicate("your_bot_token"); //you can put DiscordClient object here tho.
cBD.on("ready", () => {
cBD.on("message", res => {
console.log(`${res.user.id}: ${res.message.content}`);
cBD.sendMessage(
"message",
({ message: "Received your message dude!", id: res.user.id },
msg => {
//you can use this msg object for anything you want.
})
);
});
});
Support
Developer
- Gaia#7541 (Discord)
- Hyp3r#0001 (Discord)
- Odd Stranger#7957 (Discord)
Want to support us?
- Gaia's PayPal: nekomaru76