node-dba.js

0.0.1 • Public • Published

node-dba.js

An API Wrapper For DiscordBotAlchemist (still under development)

Link to discord server

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 (!args[0]) return msg.channel.send("Please Provide a Bot ID");
    let result = await rend.getBot(args[0]);
    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');

Readme

Keywords

Package Sidebar

Install

npm i node-dba.js

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

8.75 kB

Total Files

7

Last publish

Collaborators

  • hanspro