mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 02:44:53 -05:00
try-catch *list
This commit is contained in:
parent
becd6fcf16
commit
ad734e0f6a
1 changed files with 22 additions and 14 deletions
|
@ -8,23 +8,31 @@ module.exports = {
|
|||
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'}]));
|
||||
try {
|
||||
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'}]));
|
||||
}
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
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';
|
||||
try {
|
||||
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]});
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
const Embed = new MessageEmbed()
|
||||
.setColor('#FFFF00')
|
||||
.setTitle('Players')
|
||||
.setDescription(players);
|
||||
channeldc.send({embeds: [Embed]});
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue