2022-10-14 04:46:41 -04:00
|
|
|
/* eslint-disable max-len */
|
2022-10-15 04:59:18 -04:00
|
|
|
const sleep = require('sleep-promise');
|
|
|
|
|
|
|
|
async function crash(bot) {
|
|
|
|
bot.core.run('data merge storage crash {data:[0]}');
|
|
|
|
|
|
|
|
await sleep(1000);
|
|
|
|
|
|
|
|
for (let i = 0; i < 256; i++) bot.core.run('data modify storage crash data append from storage crash data[]');
|
|
|
|
}
|
2022-10-14 04:46:41 -04:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: 'crashserver',
|
|
|
|
alias: [],
|
|
|
|
description: 'Crashes the server',
|
|
|
|
usage: '<hash>',
|
|
|
|
trusted: 1,
|
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-15 04:59:18 -04:00
|
|
|
crash(bot);
|
2022-10-14 04:46:41 -04:00
|
|
|
} else {
|
|
|
|
throw new Error('Invalid hash');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
|
2022-11-07 08:53:45 -05:00
|
|
|
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
|
2022-10-15 04:59:18 -04:00
|
|
|
crash(bot);
|
2022-10-14 04:46:41 -04:00
|
|
|
} else {
|
|
|
|
throw new Error('You\'re not in the trusted role!');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|