renzyh-api.js
v1.4.0
Published
Renzyh Bots List's API Package
Downloads
11
Maintainers
Readme
renzyh-api.js
How to Install Renzyh-API
Windows
npm i renzyh-api.js
Linux
sudo npm i renzyh-api.js
How to Use Renzyh-API
const { Client } = require("discord.js");
const bot = new Client();
const RBL = require("renzyh-api.js");
const rbl = new RBL("Your bot id", "Your rbl bot token");
let prefix = "!";
rbl.updateStats(client.guilds.cache.size, client.users.cache.size)
bot.on('ready', async () => {
console.log("Bot has started !");
});
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 === "rbl") {
const id = args[0];
if (!id) return message.reply("Provided some id bot");
try {
rbl.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 **Renzyh Bots List!**')
};
};
});
bot.login("Your bot token discord!");
getBot Function
rbl.getBot("835494926031519755").then(data => {
console.log(data)
)};
{
botName: 'Zeavyer',
botID: '835494926031519755',
botTag: 'Zeavyer#5946',
botAuthorID: [ '472293676542984193' ],
serverCount: 2,
userCount: 0,
voteCount: 1,
certified: false,
prefix: 'z! <Custom>',
status: true
}
fetchUser Function
rbl.fetchUser("472293676542984193").then(user => {
console.log(user)
})
{
username: 'ItzTeduhYt',
tag: 'ItzTeduhYt#0929',
discriminator: '#0929',
avatar: 'https://cdn.discordapp.com/avatars/472293676542984193/d58554e1f358a986d62fc87b1b35aa4c.webp',
displayAvatarURL: 'https://cdn.discordapp.com/avatars/472293676542984193/d58554e1f358a986d62fc87b1b35aa4c.webp',
bot: false
}
isVoteMe Function
rbl.isVoteMe("472293676542984193").then(isVoteMe => {
if (isVoteMe === false) return console.log(`This user is not vote me!`)
if (isVoteMe === true) return console.log(`This user is vote me!`)
})
This user is not vote me!