A simple command to search any bot on the bot.gg website for the global user count. !guc <bot-name>
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const event = context.params.event;
let botName = context.params.event.content.split(' ')[1];
try {
let botgg = await lib.botgg.bots['@0.0.3'].retrieve({
bot_slug: `${botName}`,
}); // get's the bot data
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: event.channel_id,
content: ``,
tts: false,
embeds: [
{
type: 'rich',
title: '',
description: `> **Bot:** ${botName}
> **Global User's:** ${botgg.member_count}`,
color: 0x110e30,
timestamp: new Date().toISOString(),
author: {
name: `Global User Count`,
icon_url: `${botgg.full_avatar_url}`,
},
},
],
});
} catch (e) {
return lib.discord.channels['@0.3.0'].messages.create({
channel_id: event.channel_id,
content: `> **Couldn't find bot name: \`${botName}\`**
- Use lowercase.
- Use the exact bot name.
- When spacing do **\`name-name\`** not **\`name name\`**`,
});
}