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

View file

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