mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
botvisibility update + self care beautify
This commit is contained in:
parent
7055c5e0d7
commit
a251eac621
2 changed files with 30 additions and 8 deletions
|
@ -4,18 +4,29 @@ module.exports = {
|
||||||
name: 'botvisibility',
|
name: 'botvisibility',
|
||||||
alias: [],
|
alias: [],
|
||||||
description: 'Changes the bot\'s visibility',
|
description: 'Changes the bot\'s visibility',
|
||||||
usage: '<hash> <true|false>',
|
usage: [
|
||||||
|
'<hash> <true|false>',
|
||||||
|
'<hash> <on|off>',
|
||||||
|
'<hash>',
|
||||||
|
],
|
||||||
trusted: 1,
|
trusted: 1,
|
||||||
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
|
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
|
||||||
if (args[0] === hash) {
|
if (args[0] === hash) {
|
||||||
if (args[1] === 'true') {
|
if (args[1] === 'true' || args[1] === 'on') {
|
||||||
bot.visibility = true;
|
bot.visibility = true;
|
||||||
bot.chat('/essentials:vanish disable');
|
bot.chat('/essentials:vanish disable');
|
||||||
bot.tellraw(selector, [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'visible', color: 'green'}]);
|
bot.tellraw(selector, [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'visible', color: 'green'}]);
|
||||||
} else if (args[1] === 'false') {
|
} else if (args[1] === 'false' || args[1] === 'off') {
|
||||||
bot.visibility = false;
|
bot.visibility = false;
|
||||||
bot.chat('/essentials:vanish enable');
|
bot.chat('/essentials:vanish enable');
|
||||||
bot.tellraw(selector, [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'invisible', color: 'gold'}]);
|
bot.tellraw(selector, [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'invisible', color: 'gold'}]);
|
||||||
|
} else if (!args[1]) {
|
||||||
|
bot.visibility = !bot.visibility;
|
||||||
|
const greenOrGold = bot.visibility ? 'green' : 'gold';
|
||||||
|
const visibleOrInvisible = bot.visibility ? 'visible' : 'invisible';
|
||||||
|
const enableOrDisable = bot.visibility ? 'disable' : 'enable';
|
||||||
|
bot.chat(`/essentials:vanish ${enableOrDisable}`);
|
||||||
|
bot.tellraw(selector, [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: visibleOrInvisible, color: greenOrGold}]);
|
||||||
} else {
|
} else {
|
||||||
throw new SyntaxError('Invalid argument');
|
throw new SyntaxError('Invalid argument');
|
||||||
}
|
}
|
||||||
|
@ -25,7 +36,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
|
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
|
||||||
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
|
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
|
||||||
if (args[0] === 'true') {
|
if (args[0] === 'true' || args[0] === 'on') {
|
||||||
bot.visibility = true;
|
bot.visibility = true;
|
||||||
bot.chat('/essentials:vanish disable');
|
bot.chat('/essentials:vanish disable');
|
||||||
const Embed = new MessageEmbed()
|
const Embed = new MessageEmbed()
|
||||||
|
@ -33,7 +44,7 @@ module.exports = {
|
||||||
.setTitle('Bot\'s Visibility')
|
.setTitle('Bot\'s Visibility')
|
||||||
.setDescription('The bot\'s visibility is now visible');
|
.setDescription('The bot\'s visibility is now visible');
|
||||||
channeldc.send({embeds: [Embed]});
|
channeldc.send({embeds: [Embed]});
|
||||||
} else if (args[0] === 'false') {
|
} else if (args[0] === 'false' || args[0] === 'off') {
|
||||||
bot.visibility = false;
|
bot.visibility = false;
|
||||||
bot.chat('/essentials:vanish enable');
|
bot.chat('/essentials:vanish enable');
|
||||||
const Embed = new MessageEmbed()
|
const Embed = new MessageEmbed()
|
||||||
|
@ -41,6 +52,16 @@ module.exports = {
|
||||||
.setTitle('Bot\'s Visibility')
|
.setTitle('Bot\'s Visibility')
|
||||||
.setDescription('The bot\'s visibility is now invisible');
|
.setDescription('The bot\'s visibility is now invisible');
|
||||||
channeldc.send({embeds: [Embed]});
|
channeldc.send({embeds: [Embed]});
|
||||||
|
} else if (!args[0]) {
|
||||||
|
bot.visibility = !bot.visibility;
|
||||||
|
const visibleOrInvisible = bot.visibility ? 'visible' : 'invisible';
|
||||||
|
const enableOrDisable = bot.visibility ? 'disable' : 'enable';
|
||||||
|
bot.chat(`/essentials:vanish ${enableOrDisable}`);
|
||||||
|
const Embed = new MessageEmbed()
|
||||||
|
.setColor('#FFFF00')
|
||||||
|
.setTitle('Bot\'s Visibility')
|
||||||
|
.setDescription(`The bot\'s visibility is now ${visibleOrInvisible}`);
|
||||||
|
channeldc.send({embeds: [Embed]});
|
||||||
} else {
|
} else {
|
||||||
throw new SyntaxError('Invalid argument');
|
throw new SyntaxError('Invalid argument');
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,10 @@ function inject(bot, dcclient, config) {
|
||||||
|
|
||||||
bot.on('parsed_chat', (data) => {
|
bot.on('parsed_chat', (data) => {
|
||||||
if (data.toString() === 'You are now completely invisible to normal users, and hidden from in-game commands.') vanish = true;
|
if (data.toString() === 'You are now completely invisible to normal users, and hidden from in-game commands.') vanish = true;
|
||||||
if (!bot.visibility) {
|
if (!bot.visibility &&
|
||||||
if (data.toString().startsWith('Vanish for ') && data.toString().endsWith('disabled')) vanish = false;
|
data.toString().startsWith('Vanish for ') &&
|
||||||
}
|
data.toString().endsWith('disabled')
|
||||||
|
) vanish = false;
|
||||||
if (data.toString() === 'Successfully enabled CommandSpy' || data.toString() === ' Enabled your command spy.' || data.toString() === ' Your command spy is already enabled.') cspy = true;
|
if (data.toString() === 'Successfully enabled CommandSpy' || data.toString() === ' Enabled your command spy.' || data.toString() === ' Your command spy is already enabled.') cspy = true;
|
||||||
if (data.toString() === 'Successfully disabled CommandSpy' || data.toString() === ' Disabled your command spy.') cspy = false;
|
if (data.toString() === 'Successfully disabled CommandSpy' || data.toString() === ' Disabled your command spy.') cspy = false;
|
||||||
if (data.toString() === 'You now have the tag: [ChomeNS Bot]') {
|
if (data.toString() === 'You now have the tag: [ChomeNS Bot]') {
|
||||||
|
|
Loading…
Reference in a new issue