12.1.1 • Published 4 years ago
discordbot.ed v12.1.1
Discordbot.ed
Lightweight yet powerful Node.js module to develop discord bots!
Get Started
const discord = require("discord.ed")//installing discord.ed package
const client = new discord.Client()//creating a client
client.on('ready', () => {//ready event
console.log(`Logged in as ${client.user.tag}`)
client.user.setActivity("Test Activity")
client.user.setStatus("dnd")//set status for your bot
});
client.on('message', message => {//message event
if(message.content === "+Test"){
message.reply("Hello World")
}
});
client.login("YOUR SUPER SECRET BOT TOKEN HERE")//login to make you bot online
Define Args
var prefix = '+';
const args = message.content.slice(prefix.length).split().trim(/ + g/)
const command = args.shift().toLowerCase()
if(command === "Test"){
message.reply("Hello World")
}
Use Args
var prefix = '+';
client.on('message', message => {
const args = message.content.slice(prefix.length).split().trim(/ + g/);
const command = args.shift().toLowerCase()
if(command === "say"){
if(args[0]) return message.channel.send("You must say something for me to repeat")
message.channel.send(args[0])
}
})
- Special Thanks To Discord.js
- Forked and Developed by Unique / Dev and Sudhan
12.1.1
4 years ago