chomens-bot-js/commands/end.js
2022-11-16 18:41:30 +07:00

22 lines
671 B
JavaScript

/* eslint-disable max-len */
module.exports = {
name: 'end',
alias: [],
description: 'Ends the bot\'s client',
usage: '<hash>',
trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (args[0] === hash) {
bot.end('end command');
} 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')) {
bot.end('end command');
} else {
throw new Error('You\'re not in the trusted role!');
}
},
};