chomens-bot-js/commands/ayunsudo.js
2022-10-14 15:46:41 +07:00

26 lines
862 B
JavaScript

/* eslint-disable max-len */
module.exports = {
name: 'ayunsudo',
alias: [],
description: 'Sudo everyone on Ayunboom!',
trusted: 1,
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]);
}
} 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]);
}
} else {
throw new Error('You\'re not in the trusted role!');
}
},
};