1.2.0 • Published 5 years ago
rdzapi.js v1.2.0
Installation
Windows
npm i rdzapi.js
Linux
sudo npm i rdzapi.js
Usage
const { Client } = require("discord.js")
const bot = new Client();
const RDZ = require("rdzapi.js")
const rdz = new RDZ("Your Id Bot","Your token Bot")
let prefix = "!";
bot.on('ready', async () => {
console.log("Bot has started !")!
})
bot.on("message", async (message) => {
const msg = message.content.toLowerCase()
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 DEV!**')
}
}
})
bot.login("Your bot token Discord")