mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -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: '',
|
usage: '',
|
||||||
trusted: 0,
|
trusted: 0,
|
||||||
execute: async function(bot) {
|
execute: async function(bot) {
|
||||||
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: 'Players:', color: 'green'}]));
|
try {
|
||||||
await sleep(60);
|
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: 'Players:', color: 'green'}]));
|
||||||
for (const property of bot.tabcompleteplayers) {
|
await sleep(60);
|
||||||
if (property.match.startsWith('@')) continue;
|
for (const property of bot.tabcompleteplayers) {
|
||||||
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'}]));
|
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) {
|
discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) {
|
||||||
let players = '';
|
try {
|
||||||
for (const property of bot.tabcompleteplayers) {
|
let players = '';
|
||||||
if (property.match.startsWith('@')) continue;
|
for (const property of bot.tabcompleteplayers) {
|
||||||
players += `\`${property.match}\` › \`${bot.players.getPlayer(property.match).UUID}\`` + '\n';
|
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