node-dba.js v0.0.1
node-dba.js
An API Wrapper For DiscordBotAlchemist (still under development)
Example With Async/Await
const Discord = require('discord.js'); const client = new Discord.Client(); const DBA = require("node-dba.js"); const rend = new DBA("your bot id", "your user id")
client.on('ready', () => {
console.log(Logged in as ${client.user.tag}!
);
});
client.on('message', async msg => {
var PREFIX = "!";
if (msg.author.bot) return;
if (!msg.content.startsWith(PREFIX));
let args = message.content.slice(PREFIX.length).trim().split(" ");
let command args.shift().toLowerCase();
if (command === "dba") {
if (!args0) return msg.channel.send("Please Provide a Bot ID");
let result = await rend.getBot(args0);
if (!result) return msg.channel.send("Sorry, maybe the bot isn't registered in DBA");
msg.channel.send(**${result.bot.tag}** owned by **${result.owner.tag}** with prefix **${result.prefix}**
);
return;
};
});
client.login('token');
4 years ago