chomens-bot-js/commands/end.js

24 lines
663 B
JavaScript
Raw Normal View History

2022-08-18 19:42:14 -04:00
/* eslint-disable max-len */
2022-08-18 22:36:34 -04:00
const config = require('../config');
2022-08-14 05:51:45 -04:00
module.exports = {
name: 'end',
alias: [],
description: 'Ends the bot\'s client',
usage: '<hash>',
trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) {
2022-08-18 20:44:50 -04:00
bot.end('end command');
2022-08-14 05:51:45 -04:00
} else {
throw new Error('Invalid hash');
}
},
2022-08-18 19:42:14 -04:00
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
if (message.member._roles.at(0)===config.discord.trustedRoleID) {
2022-08-18 20:44:50 -04:00
bot.end('end command');
2022-08-18 19:42:14 -04:00
} else {
throw new Error('You\'re not in trusted role!');
}
},
2022-08-14 05:51:45 -04:00
};