toowake

index.js

Sep 10th, 2023
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //check guilds
  2. client.on('ready', () => {
  3.     console.log(`Logged in as ${client.user.tag}`);
  4.    
  5.     const guildIds = client.guilds.cache.map(guild => guild.id);
  6.    
  7.     const guildNames = [];
  8.    
  9.     guildIds.forEach(guildId => {
  10.       const guild = client.guilds.cache.get(guildId);
  11.       if (guild) {
  12.         console.log("+", guild.name, "+")
  13.         console.log("ID:", guild.id)
  14.         console.log("Owner:", guild.ownerId)
  15.         console.log("Member Count:", guild.memberCount)
  16.         console.log("Afk Channel")
  17.       } else {
  18.         console.log(`Bot is not a member of the guild with ID ${guildId}`);
  19.       }
  20.     });
  21.    
  22.     console.log(`Guild Names: ${guildNames.join(', ')}`);
  23. });
Advertisement
Add Comment
Please, Sign In to add comment