silvanus/dot-commands/servers.js

22 lines
703 B
JavaScript
Raw Normal View History

2023-05-16 17:24:42 +00:00
const fn = require('../modules/functions.js');
module.exports = {
name: "servers",
description: "Get a list of servers the bot is in",
usage: ".servers",
2023-06-03 19:40:12 +00:00
permission: "owner",
2023-05-16 17:24:42 +00:00
async execute(message, commandData) {
2023-06-03 19:40:12 +00:00
if (fn.dotCommands.checkPermissions(this.permission, message.author.id)) {
try {
let servers = [];
const count = JSON.stringify(message.client.guilds.cache.size);
servers.push("I'm currently in " + count + " servers.");
const guilds = await message.client.guilds.cache;
await message.reply(servers.join("\n"));
} catch (err) {
console.error(err);
await message.reply(fn.builders.errorEmbed("There was an error running the command."));
}
}
2023-05-16 17:24:42 +00:00
}
}