If you have a server that you want to grow so you put it on Top.gg and you want people to vote for your server on Top.gg this might help you. Run the command and your bot will send an embed with a button that links to your Top.gg site. (Read the comments! One of the comments is very important if you want the code to work)
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
if (context.params.event.content.startsWith(`!vote`)) {
// <---- Change !vote to what you want
let info = await lib.discord.users['@0.1.5'].me.list();
let Avatar = info.avatar_url;
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: `Vote link`,
description: `Click the button to vote for our server!`,
color: 0x0093ff, // <---- Change the color if you want
thumbnail: {
url: Avatar,
},
},
components: [
{
type: 1,
components: [
{
style: 5,
label: `Vote Link`,
url: `https://top.gg/servers/`, // <---- Replace the current link with your Top.gg vote link, ex: https://top.gg/servers/12345678910/vote
disabled: false,
type: 2,
},
],
},
],
});
}