With just a simple move: !invite <BOT's ID> you may get any BOT's invite link! If you don't know how to get BOT/user's ID, you can type !id - either watch a video on how to get it or getting it by !getid @user !
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let message = context.params.event.content;
let invite = context.params.event.content.split(' ').slice(1).join('_');
let link = `https://discord.com/oauth2/authorize?client_id=${invite}&scope=bot&permissions=0`;
if(message.startsWith(`!invite`)) {
await lib.discord.channels['@0.1.0'].messages.create({
channel_id: context.params.event.channel_id,
content: ``,
embed: {
title: `Invite link.`,
description: `Invite link for: ||<@!${invite}>||`,
color: 0x00AA00, // Green color - can be changed
url: `${link}`,
}
});
}
if(message.startsWith(`!id`)) {
await lib.discord.channels['@0.1.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
title: `Here is video link about how to get discord IDs`,
description: `Or do \`!getid @user\``,
color: 0x00AA00, // Green color - can be changed
url: `https://www.youtube.com/watch?v=OS2rp7wHVTI`
}
});
}
let getid = context.params.event.mentions[0].id;
if(message.startsWith(`!getid`)) {
await lib.discord.channels['@0.1.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
title: ``,
description: `<@!${getid}>'s ID: \`${getid}\``,
color: 0x00AA00,
}
});
}