Search bot.gg with the bots name! You will have to go to https://autocode.com/tools/discord/command-builder/ to create up the slash command for the command to work.
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const interaction = require('autocode-discord-interaction');
await interaction.callback.command_defer(context.params.event)
let event = context.params.event;
let string = context.params.event.data.options[0].value
try {
let result = await lib.botgg.bots['@0.0.4'].retrieve({
bot_username: `${string}`
});
await interaction.followup.edit_original(context.params.event, {
content: `Here is what I found matching \`${string}\``,
"components": [
{
"type": 1,
"components": [
{
"style": 5,
"label": `Link to ${result.bot_username}`,
"url": `https://bot.gg/bot/${result.bot_username}`,
"disabled": false,
"type": 2
},
{
"style": 5,
"label": `Avatar URL`,
"url": `${result.full_avatar_url}`,
"disabled": false,
"type": 2
},
{
"style": 5,
"label": `Cover Image`,
"url": `${result.cover_image}`,
"disabled": false,
"type": 2
},
]
}
],
"embeds": [
{
"type": "rich",
"title": `bot.gg Search`,
"description": `Here is some other bot information\n\n[Profile Picture](${result.full_avatar_url})\n\nViews: \`${result.views_count}\` Upvotes: \`${result.upvotes_count}\` Approx Member Count: \`${result.member_count}\` Approx Server Count: \`${result.server_count}\` Average Rating: \`${result.average_rating}\`\n\nShort Description: \`${result.short_description}\`\n\nLong Description: \`\`\`${result.full_description}\`\`\`\n\n`,
"footer": {
"text": `Searched by ${event.member.user.username}`,
},
"image": {
"url": `${result.full_avatar_url}`,
"height": 0,
"width": 0
}
}
]
});
} catch (e) {
await interaction.followup.edit_original(context.params.event, {
content: `Woops, I could not find any bots matching: \`${string}\`\nThis is a case sensitive search make sure you do not use any capital letters.\n\nTry searching the ID of the bot you want to look for if the name did not work.`,
});
}