Bot Search
By using this method, you can get information about your bot as well as other bots.
An Example Command
const Discord = require("discord.js"); //This is an example bot search command
const client = new Discord.Client();
const cybralist = require("cybralist.js");
const dbl = new cybralist("TOKEN-HERE", client); // This is not your bot token, this token can be found from our website: https://cybralist.com/bots/your_bot_id
client.on("ready", async () => {
console.log(`Logged in as ${client.user.tag}`)
})
client.on("message", async (message) => {
if (!message.guild) return;
if (message.author.bot) return;
const prefix = "!";
const args = message.content.slice(prefix.length).split(" ");
const command = args.shift().toLowerCase();
if (command === "search") {
try {
const query = args.join(" "); // search query must be a bot id
if (!query) return message.channel.send(`Please provide a bot id which is added in cybralist.com`);
const botinfo = await dbl.search(`${query}`);
const embed = new Discord.MessageEmbed()
.setTitle(`${botinfo.username} || Info`)
.setFooter(`Requested by ${message.author.username}`, message.author.displayAvatarURL({ dynamic: true }))
.setColor(`BLURPLE`)
.setThumbnail(botinfo.avatar)
.setDescription(`**Name:** ${botinfo.username}#${botinfo.discrim}\n**ID:** ${botinfo.botID}\n**Avatar:** [\`Click here\`](${botinfo.avatar})\n**Prefix:** ${botinfo.prefix}\n**Owner:** <@${botinfo.ownerID}> (${botinfo.owner})\n**Co-onwers:** ${botinfo.coowners.join(", ")}\n**Tags:** ${botinfo.tags.join(", ")}\n**Verified: **${botinfo.certificate}\n**GitHub: **[\`Click here\`](${botinfo.github})\n**Support Server:** [\`Click here\`](${botinfo.support})\n**Votes:** ${botinfo.votes}\n**Website:** [\`Click here\`](${botinfo.website})`)
.addField(`Short Description`, `${botinfo.shortDesc}`)
//.addField(`Long Description`, ${botinfo.longDesc}) //Adding long description might give you a error beacuse the embed can't handle long fields (6000)
.setTimestamp();
message.channel.send(embed).catch(err => {
message.channel.send(`**Error:** ${err}`) // If the given id was wrong or the api got any issues, then it will return this error
});
} catch (e) {
message.channel.send(`I was unable to find the search results!`)
}
}
})
client.login(process.env.token)
let botFind = await dbl.search("bot id");
console.log(botFind) // This will log the full deatils of the given bot id in json format.
{ // These are the responses from the api.
"avatar": String,
"botID": String,
"username": String,
"discrim": String,
"shortDesc": String,
"prefix": String,
"votes": String,
"ownerID": String,
"owner": String,
"coowners": Array,
"tags": Array,
"longDesc": String,
"certificate": String,
"github": String,
"support": String,
"website": String
// These are the responses from the api.
}
Last updated