mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-12-18 03:12:23 -05:00
31 lines
1.2 KiB
JavaScript
31 lines
1.2 KiB
JavaScript
|
/* eslint-disable max-len */
|
|||
|
const sleep = (t) => new Promise((a) => setTimeout(a, t));
|
|||
|
const {MessageEmbed} = require('discord.js');
|
|||
|
module.exports = {
|
|||
|
name: 'list',
|
|||
|
alias: [],
|
|||
|
description: 'List players',
|
|||
|
usage: '',
|
|||
|
trusted: 0,
|
|||
|
execute: async function(bot) {
|
|||
|
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: 'Players:', color: 'green'}]));
|
|||
|
await sleep(60);
|
|||
|
for (const property of bot.tabcompleteplayers) {
|
|||
|
if (property.match.startsWith('@')) continue;
|
|||
|
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: `${property.match}`, color: 'yellow'}, {text: ' › ', color: 'aqua'}, {text: `${bot.players.getPlayer(property.match).UUID}`, color: 'aqua'}]));
|
|||
|
}
|
|||
|
},
|
|||
|
discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) {
|
|||
|
let players = '';
|
|||
|
for (const property of bot.tabcompleteplayers) {
|
|||
|
if (property.match.startsWith('@')) continue;
|
|||
|
players += `\`${property.match}\` › \`${bot.players.getPlayer(property.match).UUID}\`` + '\n';
|
|||
|
}
|
|||
|
const Embed = new MessageEmbed()
|
|||
|
.setColor('#FFFF00')
|
|||
|
.setTitle('Players')
|
|||
|
.setDescription(players);
|
|||
|
channeldc.send({embeds: [Embed]});
|
|||
|
},
|
|||
|
};
|