1.0.2 • Published 2 years ago

planetbots v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Define Module & Client

const Discord = require("discord.js");
const client = new Discord.Client();
const PlanetBots = require("planetbots");
const dbl = new PlanetBots("TOKEN-HERE", client);

client.login("TOKEN");

Server Count & Shard Count Posting

client.on("ready", async () => {
  dbl.serverCount();
  /* 
   Sends the servers where the bot is located to the PlanetBots servers.
  */

});
let botFind = await dbl.search("");
console.log(botFind.username) 

Embed info

// You can also create embeds where all the PlanetBots info comes out such as how many votes your bot has

client.on('message', async message => {
	if (message.content.startsWith(`${prefix}PlanetBots`)) {
                        const args = message.content.trim().split(/ +/g);
                 if(!args[1]) {
                         const id = new Discord.MessageEmbed()
                         .setTitle("Put id of a bot that is on PlanetBots")
                         .setColor("RED")
                         return message.channel.send(id)
                 }
                let serverplanet = await dbl.search(`${args[1]}`);
                const infoPlanetBots = new Discord.MessageEmbed()
                .setTitle(`Info of ${serverplanet.username} on PlanetBots`)
                .setDescription(`Name bot: ${serverplanet.username} \n Vote on planetbots: ${serverplanet.votes} \n Bot tag: ${serverplanet.tags} \n Bot owner: <@${serverplanet.ownerID}> \n Website bot: ${serverplanet.website}`)
                .setImage(serverplanet.avatar)
                .setColor("RANDOM")
                message.channel.send(infoPlanetBots) 
        }
});

// below you find all the functions you can put after serverplanet.

All functions after serverplanet.

// avatar
// botID
// username
// discrim
// shortDesc
// prefix
// votes
// ownerID
// coowner
// tags
// logDesc
// certificate
// support
// website
// github