player list features

This commit is contained in:
SowinskiBraeden committed 2023-03-20 16:44:56 -07:00
1 parent 6a9c74af68
commit dc00e964af
4 files changed
+106 -10

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: "stats",
debug: true,
global: true,
description: "check bot statistics",
usage: "",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
options: [],
SlashCommand: {
/**
*
* @param {require("../structures/QuarksBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }, start) => {
let activePlayers = GuildDB.playerstats.filter(p => p.connected);
let des = ``;
for (let i = 0; i < activePlayers.length; i++) {
des += `**- ${activePlayers[i].gamertag}\n`;
}
const activePlayersEmbed = new EmbedBuilder()
.setColor(this.config.Colors.Default)
.setTitle(`Online List - ${activePlayers.length} Player${(activePlayers.length>1||activePlayers.length==0)?'s':''} Online`)
.setDescription(des);
return interaction.send({ embeds: [activePlayersEmbed] });
},
},
}