1.0.3 • Published 3 years ago
commandcord.js v1.0.3
Commandcord.js
A javascript/node.js discord API wrapper making commands easier than current wrappers.
Support Server
Table Of Contents
Commandcord.js Stats Install Command Example On Message Example
Stats
Install
npm i commandcord.js
Basic Commands Bot
Simple !ping
pong bot using commands
const Discord = require("commandcord.js")
const bot = new Discord.commands.Bot(command_prefix="!")
bot.cmd.on("ping", (ctx) => {
ctx.send("pong!")
})
/*
When '!ping' is typed, then the bot will reply with 'pong!'.
*/
bot.run("BOT_TOKEN")
Basic on_message Bot
const Discord = require("commandcord.js")
const bot = new Discord.commands.Bot()
bot.events.on("message", (m) => {
if(m.content === "!ping"){
await m.channel.send("pong!")
}
})
/*
When '!ping' is typed, then the bot will reply with 'pong!'.
*/
bot.run("BOT_TOKEN")