drdevapi.js

0.2.6 • Public • Published

drapi.js

An API Wrapper For DR Development (still under development)

Link to discord server

Example With Async/Await

const Discord = require('discord.js');
const client = new Discord.Client();
const DRDev = require("drapi.js");
const DR = new DRDev("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 === "dr") {
    if (!args[0]) return msg.channel.send("Please Provide a Bot ID");
    let result = await DR.getBot(args[0]);
    if (!result) return msg.channel.send("Sorry, maybe the bot isn't registered in DR Development");
    msg.channel.send(`**${result.bot.tag}** owned by **${result.owner.tag}** with prefix **${result.prefix}**`);
    return;
  };
});

client.login('token');

Package Sidebar

Install

npm i drdevapi.js

Weekly Downloads

2

Version

0.2.6

License

MIT

Unpacked Size

8.96 kB

Total Files

7

Last publish

Collaborators

  • faiqgamingyt