rdz-api.js

5.0.0 • Public • Published

Installation

Windows

  • npm i rdz-api.js

Linux

  • sudo npm i rdz-api.js

Usage

const { Client } = require("discord.js");
const bot = new Client();
const RDZ = require("rdz-api.js");
const rdz = new RDZ("Your bot id", "Your bot token");
let prefix = "!";


bot.on('ready', async () => {
  console.log("Bot has started !");
  rdz.updateStats(bot.guilds.size); // Post your server count!
});

bot.on('guildCreate', async () => {
  console.log('Someone added your bot in here!');
  rdz.updateStats(bot.guilds.size); // Post your server count!
});

bot.on('guildDelete', async () => {
  console.log('Someone remove your bot!');
  rdz.updateStats(bot.guilds.size); // Post your server count!
});

bot.on('message', async (message) => {
  if (message.author.bot) return;
  if (message.channel.type === "dm") return;

  const messageArray = message.content.split(' ');
  if (!message.content.startsWith(prefix)) return;
  const args = message.content.slice(prefix.length).trim().split(/ +/g);
  const command = args.shift().toLowerCase();

  if (command === "rdz") {
    const id = args[0];
    if (!id) return message.reply("Provided some id bot");

    try {
      rdz.getBot(id).then(data => {
        message.channel.send(`
        Name: ${data.botName}
        Owner : ${data.AuthorTag}
        Prefix : ${data.prefix}
        Approved : ${data.status}
        `);
      });
    } catch (e) {
      message.channel.send('This bot is not registered in **RDZ Bot List!**')
    };
  };
});

bot.login("Your bot token discord!");

Readme

Keywords

Package Sidebar

Install

npm i rdz-api.js

Weekly Downloads

0

Version

5.0.0

License

MIT

Unpacked Size

8.55 kB

Total Files

7

Last publish

Collaborators

  • faiqgamingyt