This snippet shows the information of your bot, also automatically detects the number of servers the bot is in!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let sleep = async (ms) => {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
};
if (context.params.event.content.startsWith(`${process.env.PREFIX}botinfo`)) {
const count = await getCount();
//REQUIRED INFORMATION (pls replace each and every value to your wish)
let botcreatedate = `DD/MM/YY`;//reqrequired
let botdev = `XYZ`;//the person/group of dev(s) who created the bot.
let invitelink = `invite link of the bot`;//put link only eg: https://blahblahbalh
let botpfp = `link of the bot's pfp or logo`;//recommend to use ibb.co or imgimgur
//REQUIRED INFORMATION EENDS
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embeds: [
{
type: 'rich',
title: `${process.env.BOTNAME} BOT`,
description: `${process.env.BOTNAME}is a bot made by ${botdev} \n\n**No. of servers Metor is in**:\n${count} servers!\n\n**Metor Bot Invite link**\n[Invite](${invitelink})\n\n**${process.env.BOTNAME} was created on:**\n${botcreatedate}`,
color: 0xff0000,
thumbnail: {
url: `${botpfp}`,
height: 0,
width: 0,
},
footer: {
text: `${process.env.BOTNAME} Bot`,
},
},
],
});
async function getCount(id = null) {
await sleep(1000);
let result = await lib.discord.guilds['@0.1.0'].list({
limit: 100,
after: id,
});
let count = result.length;
if (result.length % 100 === 0) count += await getCount(result[99].id);
return count;
}
}
//Made by SRM GRAPHICS
//discordusername : Steve57#0005