try-catch *list

This commit is contained in:
ChomeNS 2022-08-19 11:19:55 +07:00
parent becd6fcf16
commit ad734e0f6a

View file

@ -8,14 +8,19 @@ module.exports = {
usage: '',
trusted: 0,
execute: async function(bot) {
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) {
try {
let players = '';
for (const property of bot.tabcompleteplayers) {
if (property.match.startsWith('@')) continue;
@ -26,5 +31,8 @@ module.exports = {
.setTitle('Players')
.setDescription(players);
channeldc.send({embeds: [Embed]});
} catch (e) {
return;
}
},
};