Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Create botguild.js
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLSNAKES committed Nov 2, 2021
1 parent 7b2bb03 commit f615e0e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions commands/Bot/botguild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const Discord = require("discord.js")
require("dotenv").config()

module.exports = {
name: "botguild",
description: "bot guild list",
timeout: 10000,
run: async (interaction, client) => {
if (interaction.member.id !== process.env.Admin) {
return interaction.reply({ content: "AdminBot Only" })
}
const guilds = client.guilds.cache
.sort((a, b) => b.memberCount - a.memberCount)
.first(50)
const description = guilds.map((guild, index) => {
return `${index + 1}) ${guild.name}: ${guild.memberCount} members|ID:${guild.id} `
}).join("\n")
const embed = new Discord.MessageEmbed()
.setTitle(`${client.user.username}'s top Guild:`)
.setThumbnail(client.user.displayAvatarURL())
.setColor("RANDOM")
.setDescription(description)
interaction.reply({ embeds: [embed] })
}
}

0 comments on commit f615e0e

Please sign in to comment.