Closed msami789 closed 3 years ago
Getting the members of another server or getting an invite to it seems like an invasion of privacy. But, you could just leave it with code like this:
async function leaveGuild(){
let guild = await client.guilds.fetch('GUILD ID');
guild.leave();
}
leaveGuild();
That could be ran through eval or put in a ready event.
Getting the members of another server or getting an invite to it seems like an invasion of privacy. But, you could just leave it with code like this:
async function leaveGuild(){ let guild = await client.guilds.fetch('GUILD ID'); guild.leave(); } leaveGuild();
That could be ran through eval or put in a ready event.
How can I add an eval, can’t seem to find the custom commands list?
do I have to put the guild id that the bot should leave in “GUILD ID” because I dont have it
client.guilds.cache.map(g => g.id)
it says that the code complied, where do i find the result?
Restart the bot and see how many servers it's in.
You could console.log that code that Ieuan provided.
Sorry about that I wasn't thinking properly 😅
Did you manage to solve this?
Just do this
client.on('ready', async() => {
let guilds = client.guilds.cache.array();
for(var i = 0; i < guilds.length; i++) {
if(guilds[i].id !== "GUILD ID HERE") {
guild[i].leave();
}
}
});
Please could you close this issue if you've solved it now.
I know this isn’t specific to qbot but for those who don’t know, my bot was on public invite and my group got raided as the bot is in another server.
Does anyone know how I could run a command, (maybe an eval?) to figure out the members of the other server or even get an invite to it.
Thanks.