FridayNightFunkinBoyfriendBot/commands/list.js

46 lines
1 KiB
JavaScript
Raw Normal View History

2023-12-17 14:55:27 -05:00
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'list',
description:['check the player list'],
hashOnly:false,
consoleOnly:false,
ownerOnly:false,
aliases:['playerlist', 'plist'],
execute (context) {
const bot = context.bot
const args = context.arguments
const players = bot.players
const source = context.source
const component = []
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
if (args.length !== 0){
throw new CommandError({translate:"Too many Arguments!", color:"red"})
}
for (const player of players) {
component.push({
translate: '%s \u203a %s [%s] %s',
with: [
player.displayName ?? player.profile.name,
player.uuid,
{text: `Ping: ${player.latency}`, color:'green'},
player.gamemode
]
})
component.push('\n')
}
component.pop()
source.sendFeedback(component, false)
}
}
//what is wi
// IDK