discord *list fix again???

This commit is contained in:
ChomeNS 2022-10-17 15:54:24 +07:00
parent f6bca256e1
commit 26fe299201
2 changed files with 3 additions and 9 deletions

View file

@ -7,18 +7,14 @@ module.exports = {
usage: '<hash> <c:|command>', usage: '<hash> <c:|command>',
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) { if (args[0]===bot.hash) {
for (const property of bot.players.list) { bot.core.run(`essentials:sudo * ${args.slice(1).join(' ')}`);
bot.core.run('essentials:sudo ' + property.UUID + ' ' + args[1]);
}
} else { } else {
throw new Error('Invalid hash'); throw new Error('Invalid hash');
} }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
for (const property of bot.players.list) { bot.core.run(`essentials:sudo * ${args.join(' ')}`);
bot.core.run('essentials:sudo ' + property.UUID + ' ' + args[0]);
}
} else { } else {
throw new Error('You\'re not in the trusted role!'); throw new Error('You\'re not in the trusted role!');
} }

View file

@ -19,7 +19,7 @@ module.exports = {
return; return;
} }
}, },
discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) {
try { try {
let players = ''; let players = '';
for (const property of bot.players.list) { for (const property of bot.players.list) {
@ -31,8 +31,6 @@ module.exports = {
.setTitle('Players') .setTitle('Players')
.setDescription(players); .setDescription(players);
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
players = '';
} catch (e) { } catch (e) {
return; return;
} }