toowake

Discord Bot Server Count

Mar 25th, 2023
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. const { SlashCommandBuilder } = require("discord.js");
  2.  
  3. module.exports= {
  4. data: new SlashCommandBuilder()
  5. .setName("servers")
  6. .setDescription("Get my Discord Server invites"),
  7.  
  8. async execute (interaction, client) {
  9. const ID = "Here your ID";
  10. if (interaction.user.id != ID) return interaction.reply("You dumbass!");
  11. await client.guilds.cache.forEach((guild) => {
  12. console.log(guild.name);
  13. });
  14.  
  15. await interaction.reply("Servers are in console!")
  16. }
  17. }
Add Comment
Please, Sign In to add comment