This command gets the invite of one of the guilds your bot is in, it can be any guild, the bot will pick randomly, some servers maybe private, so if its not joining servers under 60 - 3k members please dont join, you can only put in your own prefix mine is ~gi so put yours, HAPPY HACKING~~
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
/**this will fetch the guilds the bot is in**/
const guilds = await lib.discord.guilds['@0.2.4'].list({limit: 100});
/**make it random from here, you can choose to remove this**/
const guild = guilds[Math.floor(Math.random() * guilds.length)];
//or you can do this
//const guild = content.params.event.content.split(' ')[1];
//you can get any number from here 1 - 100 remember 0 is 1
const channels = await lib.discord.guilds['@0.2.4'].channels.list({
guild_id: guild.id, //or this guilds[guild].id
});
const channel = channels.filter((x) => x.type === 0);
/*this gets the code from the first text channel channel*/
const invite = await lib.discord.invites['@0.1.0'].create({
channel_id: channel[0].id,
max_age: 0,
max_uses: 0,
});
const emojis = await lib.discord.guilds['@0.2.4'].emojis.list({
guild_id: guild.id,
});
const members = await lib.discord.guilds['@0.2.4'].members.list({
guild_id: guild.id,
limit: 1000,
});
const {owner_id} = await lib.discord.guilds['@0.2.4'].retrieve({
guild_id: guild.id,
});
await lib.discord.channels['@0.3.2'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `https://discord.gg/${invite.code}
> \`Guild Name\`: **${guild.name}**
> \`Guild Owner\`: <@${owner_id}>
> \`Members\`: **${members.length}**
> \`Emojis\`: ${emojis.length}`,
message_reference: {
message_id: `${context.params.event.id}`,
},
});
/*Made By LaRose*/
/*BEWARE: this is just an example on how to get the invite of one of the servers your bot joined, the next snippet i make you will be able to
get the invite in your log channel*/
/*you can also use the other method*/