chomens-bot-js/commands/ayunsudo.js

23 lines
762 B
JavaScript
Raw Normal View History

2022-10-14 04:46:41 -04:00
/* eslint-disable max-len */
2022-08-14 05:51:45 -04:00
module.exports = {
name: 'ayunsudo',
alias: [],
description: 'Sudo everyone on Ayunboom!',
trusted: 1,
usage: '<hash> <c:|command>',
2022-11-16 06:41:30 -05:00
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
2022-11-16 06:09:37 -05:00
if (args[0] === hash) {
2022-10-17 04:54:24 -04:00
bot.core.run(`essentials:sudo * ${args.slice(1).join(' ')}`);
2022-08-14 05:51:45 -04:00
} else {
throw new Error('Invalid hash');
}
},
2022-10-14 04:46:41 -04:00
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
2022-10-17 04:54:24 -04:00
bot.core.run(`essentials:sudo * ${args.join(' ')}`);
2022-10-14 04:46:41 -04:00
} else {
throw new Error('You\'re not in the trusted role!');
}
},
2022-08-14 05:51:45 -04:00
};