rel fix much again

This commit is contained in:
ChomeNS 2022-11-07 20:08:29 +07:00
parent e6455a25fc
commit b1f8f28f4e
18 changed files with 77 additions and 119 deletions

View file

@ -7,7 +7,7 @@ module.exports = {
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot) { execute: function(bot) {
bot.tellraw('@a', ['', {text: 'The bot\'s username is: ', color: 'white'}, {text: `${bot.username}`, color: 'gold', clickEvent: {action: 'copy_to_clipboard', value: `${bot.username}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the username to your clipboard', color: 'green'}]}}, {text: ' and the UUID is: '}, {text: `${bot.uuid}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${bot.uuid}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the uuid to your clipboard', color: 'green'}]}}]); bot.tellraw('@a', [{text: 'The bot\'s username is: ', color: 'white'}, {text: `${bot.username}`, color: 'gold', clickEvent: {action: 'copy_to_clipboard', value: `${bot.username}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the username to your clipboard', color: 'green'}]}}, {text: ' and the UUID is: '}, {text: `${bot.uuid}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${bot.uuid}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the uuid to your clipboard', color: 'green'}]}}]);
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -11,11 +11,11 @@ module.exports = {
if (args[1] === 'true') { if (args[1] === 'true') {
bot.visibility = true; bot.visibility = true;
bot.chat('/essentials:vanish disable'); bot.chat('/essentials:vanish disable');
bot.tellraw('@a', ['', {text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'visible', color: 'green'}]); bot.tellraw('@a', [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'visible', color: 'green'}]);
} else if (args[1] === 'false') { } else if (args[1] === 'false') {
bot.visibility = false; bot.visibility = false;
bot.chat('/essentials:vanish enable'); bot.chat('/essentials:vanish enable');
bot.tellraw('@a', ['', {text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'invisible', color: 'gold'}]); bot.tellraw('@a', [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'invisible', color: 'gold'}]);
} else { } else {
throw new SyntaxError('Invalid argument'); throw new SyntaxError('Invalid argument');
} }
@ -24,7 +24,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') {
bot.visibility = true; bot.visibility = true;
bot.chat('/essentials:vanish disable'); bot.chat('/essentials:vanish disable');

View file

@ -63,87 +63,48 @@ module.exports = {
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (!bot.cloops) bot.cloops = []; if (!bot.cloops) bot.cloops = [];
if (args[1] === 'add') { if (args[0] === bot.hash) {
if (args[0] === bot.hash) { if (args[1] === 'add' && args[3]) {
if (args[3]) { if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval');
if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval'); add(args.slice(3).join(' '), args[2], bot);
add(args.slice(3).join(' '), args[2], bot); bot.tellraw('@a', [{text: 'Added command ', color: 'white'}, {text: `${args.slice(3).join(' ')}`, color: 'aqua'}, {text: ' with interval ', color: 'white'}, {text: `${args[2]}`, color: 'green'}, {text: ' to the cloops', color: 'white'}]);
bot.tellraw('@a', [{text: 'Added command ', color: 'white'}, {text: `${args.slice(3).join(' ')}`, color: 'aqua'}, {text: ' with interval ', color: 'white'}, {text: `${args[2]}`, color: 'green'}, {text: ' to the cloops', color: 'white'}]); } else if (args[1] === 'list') {
}
} else {
throw new Error('Invalid hash');
}
return;
}
if (args[1] === 'list') {
if (args[0] === bot.hash) {
list(bot); list(bot);
} else { } else if (args[1] === 'remove') {
throw new Error('Invalid hash');
}
return;
}
if (args[1] === 'remove') {
if (args[0] === bot.hash) {
remove(args[2]); remove(args[2]);
bot.tellraw('@a', ['', {text: 'Removed cloop '}, {text: args[2], color: 'aqua'}]); bot.tellraw('@a', [{text: 'Removed cloop '}, {text: args[2], color: 'aqua'}]);
} else { } else if (args[1] === 'removeall') {
throw new Error('Invalid hash');
}
return;
}
if (args[1] === 'removeall') {
if (args[0] === bot.hash) {
clear(); clear();
bot.tellraw('@a', ['', {text: 'Removed all looped commands', color: 'white'}]); bot.tellraw('@a', [{text: 'Removed all looped commands', color: 'white'}]);
} else { } else {
throw new Error('Invalid hash'); throw new SyntaxError('Invalid argument');
} }
return; } else {
throw new Error('Invalid hash');
} }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
if (!bot.cloops) bot.cloops = []; if (!bot.cloops) bot.cloops = [];
if (args[0] === 'add') { if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (args[0] === 'add' && args[2]) {
if (args[2]) { if (!Number(args[1]) && Number(args[1]) !== 0) throw new SyntaxError('Invalid interval');
if (!Number(args[1]) && Number(args[1]) !== 0) throw new SyntaxError('Invalid interval'); add(args.slice(2).join(' '), args[1], bot);
add(args.slice(2).join(' '), args[1], bot); const Embed = new MessageEmbed()
const Embed = new MessageEmbed() .setColor('#FFFF00')
.setColor('#FFFF00') .setTitle('Cloop')
.setTitle('Cloop') .setDescription(`Added cloop \`${args.slice(2).join(' ')}\` with interval ${args[1]} to the cloops`);
.setDescription(`Added cloop \`${args.slice(2).join(' ')}\` with interval ${args[1]} to the cloops`); channeldc.send({embeds: [Embed]});
channeldc.send({embeds: [Embed]}); } else if (args[0] === 'list') {
}
} else {
throw new Error('You\'re not in the trusted role!');
}
return;
}
if (args[0] === 'list') {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
list(bot, true, channeldc); list(bot, true, channeldc);
} else { } else if (args[0] === 'remove') {
throw new Error('You\'re not in the trusted role!');
}
return;
}
if (args[0] === 'remove') {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
remove(args[1]); remove(args[1]);
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor('#FFFF00')
.setTitle('Cloop') .setTitle('Cloop')
.setDescription(`Removed cloop \`${args[1]}\``); .setDescription(`Removed cloop \`${args[1]}\``);
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
} else { } else if (args[0] === 'removeall') {
throw new Error('You\'re not in the trusted role!');
}
return;
}
if (args[0] === 'removeall') {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
clear(); clear();
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor('#FFFF00')
@ -151,9 +112,10 @@ module.exports = {
.setDescription('Removed all looped commands'); .setDescription('Removed all looped commands');
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
} else { } else {
throw new Error('You\'re not in the trusted role!'); throw new Error('Invalid argument');
} }
return; } else {
throw new Error('You\'re not in the trusted role!');
} }
}, },
}; };

View file

@ -8,9 +8,7 @@ module.exports = {
usage: '<cow|list> <message>', usage: '<cow|list> <message>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]!=='list') { if (args[0]==='list') {
bot.tellraw('@a', {text: `${cowsay.say(args.slice(1).join(' '), {cow: cows[args[0]]})}`});
} else {
let color = '§6'; let color = '§6';
let message = ''; let message = '';
@ -23,6 +21,8 @@ module.exports = {
message += color + value + ' '; message += color + value + ' ';
}); });
bot.tellraw('@a', [{text: 'Cows: ', color: 'green'}, '\n', {text: message, color: 'red'}]); bot.tellraw('@a', [{text: 'Cows: ', color: 'green'}, '\n', {text: message, color: 'red'}]);
} else {
bot.tellraw('@a', {text: `${cowsay.say(args.slice(1).join(' '), {cow: cows[args[0]]})}`});
} }
}, },
}; };

View file

@ -15,10 +15,10 @@ module.exports = {
// if (!entity) throw new SyntaxError('Invalid entity'); // if (!entity) throw new SyntaxError('Invalid entity');
// if (!args[1]) { // if (!args[1]) {
// bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon minecraft:' + entity.name); // bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon minecraft:' + entity.name);
// bot.tellraw('@a', ['', {text: 'Entity ', color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at everyone...', color: 'white'}]); // bot.tellraw('@a', [{text: 'Entity ', color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at everyone...', color: 'white'}]);
// } else if (args[1] === 'specific' && args[2]) { // } else if (args[1] === 'specific' && args[2]) {
// bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at ' + args[2] + ' run summon minecraft:' + entity.name); // bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at ' + args[2] + ' run summon minecraft:' + entity.name);
// bot.tellraw('@a', ['', {text: `Entity `, color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]); // bot.tellraw('@a', [{text: `Entity `, color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]);
// } // }
}, },
}; };

View file

@ -60,11 +60,9 @@ module.exports = {
} catch (err) { } catch (err) {
throw err; throw err;
} }
} } else if (args[0] === 'reset') {
if (args[0] === 'reset') {
bot.vm = new VM(bot.vmoptions); bot.vm = new VM(bot.vmoptions);
} } else if (args[0] === 'server') {
if (args[0] === 'server') {
axios axios
.post(config.eval.serverUrl, querystring.stringify({ .post(config.eval.serverUrl, querystring.stringify({
html: false, html: false,
@ -79,6 +77,8 @@ module.exports = {
}).catch((err) => { }).catch((err) => {
throw err; throw err;
}); });
} else {
throw new SyntaxError('Invalid argument');
} }
}, },
}; };

View file

@ -12,18 +12,18 @@ module.exports = {
let trustedCommands = ''; let trustedCommands = '';
let ownerCommands = ''; let ownerCommands = '';
for (const command of bot.command_handler.commands) { for (const command of bot.command_handler.commands) {
if (command.trusted!==0) continue; if (command.trusted !== 0) continue;
generalCommands += ' ' + command.name; generalCommands += ' ' + command.name;
} }
for (const command of bot.command_handler.commands) { for (const command of bot.command_handler.commands) {
if (command.trusted!==1) continue; if (command.trusted !== 1) continue;
trustedCommands += ' ' + command.name; trustedCommands += ' ' + command.name;
} }
for (const command of bot.command_handler.commands) { for (const command of bot.command_handler.commands) {
if (command.trusted!==2) continue; if (command.trusted !== 2) continue;
ownerCommands += ' ' + command.name; ownerCommands += ' ' + command.name;
} }
if (typeof args[0]!=='undefined') { if (typeof args[0] !== 'undefined') {
for (const command of bot.command_handler.commands) { for (const command of bot.command_handler.commands) {
function m() { function m() {
let discordSupported; let discordSupported;
@ -33,7 +33,7 @@ module.exports = {
} else { } else {
discordSupported = 'true'; discordSupported = 'true';
} }
if (command.alias.toString()!=='') { if (command.alias.toString() !== '') {
alias = command.alias.join(', '); alias = command.alias.join(', ');
} }
bot.tellraw('@a', [{text: prefix + command.name, color: 'gold'}, {text: ` (${alias})`, color: 'white'}, {text: ' - ', color: 'gray'}, {text: command.description, color: 'gray'}]); bot.tellraw('@a', [{text: prefix + command.name, color: 'gold'}, {text: ` (${alias})`, color: 'white'}, {text: ' - ', color: 'gray'}, {text: command.description, color: 'gray'}]);
@ -53,7 +53,7 @@ module.exports = {
} }
}, },
discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) {
if (typeof args[0]!=='undefined') { if (typeof args[0] !== 'undefined') {
for (const command of bot.command_handler.commands) { for (const command of bot.command_handler.commands) {
function m() { function m() {
let discordSupported; let discordSupported;
@ -63,7 +63,7 @@ module.exports = {
} else { } else {
discordSupported = 'true'; discordSupported = 'true';
} }
if (command.alias.toString()!=='') { if (command.alias.toString() !== '') {
alias = command.alias.join(', '); alias = command.alias.join(', ');
} }
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
@ -89,7 +89,7 @@ module.exports = {
supportedCommands += command.name + ' '; supportedCommands += command.name + ' ';
} }
for (const command of bot.command_handler.commands) { for (const command of bot.command_handler.commands) {
if (typeof command.discordExecute!=='undefined') continue; if (typeof command.discordExecute !== 'undefined') continue;
unsupportedCommands += command.name + ' '; unsupportedCommands += command.name + ' ';
} }
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -9,11 +9,11 @@ module.exports = {
trusted: 0, trusted: 0,
execute: async function(bot) { execute: async function(bot) {
try { try {
bot.tellraw('@a', ['', {text: 'Players:', color: 'green'}]); bot.tellraw('@a', [{text: 'Players:', color: 'green'}]);
await sleep(60); await sleep(60);
for (const property of bot.players.list) { for (const property of bot.players.list) {
// if (property.match.startsWith('@')) continue; // if (property.match.startsWith('@')) continue;
bot.tellraw('@a', ['', {text: `${property.name}`, color: 'yellow'}, {text: ' ', color: 'aqua'}, {text: `${property.UUID}`, color: 'aqua'}]); bot.tellraw('@a', [{text: `${property.name}`, color: 'yellow'}, {text: ' ', color: 'aqua'}, {text: `${property.UUID}`, color: 'aqua'}]);
} }
} catch (e) { } catch (e) {
return; return;

View file

@ -136,45 +136,41 @@ module.exports = {
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0] === 'play') { if (args[0] === 'play') {
play(bot, args.slice(1)); play(bot, args.slice(1));
} } else if (args[0] === 'playurl') {
if (args[0] === 'playurl') {
playUrl(bot, args.slice(1)); playUrl(bot, args.slice(1));
} } else if (args[0] === 'stop') {
if (args[0] === 'stop') {
try { try {
bot.tellraw('@a', {text: 'Cleared the song queue'}); bot.tellraw('@a', {text: 'Cleared the song queue'});
} catch (e) { } catch (e) {
return; return;
} }
bot.music.stop(); bot.music.stop();
} } else if (args[0] === 'skip') {
if (args[0] === 'skip') {
try { try {
bot.tellraw('@a', [{text: 'Skipping '}, {text: bot.music.song.name, color: 'gold'}]); bot.tellraw('@a', [{text: 'Skipping '}, {text: bot.music.song.name, color: 'gold'}]);
bot.music.skip(); bot.music.skip();
} catch (e) { } catch (e) {
throw new Error('No music is currently playing!'); throw new Error('No music is currently playing!');
} }
} } else if (args[0] === 'loop') {
if (args[0] === 'loop') {
if (args[1] === 'off') { if (args[1] === 'off') {
bot.music.loop = 0; bot.music.loop = 0;
bot.tellraw('@a', [{text: 'Looping is now '}, {text: 'disabled', color: 'red'}]); bot.tellraw('@a', [{text: 'Looping is now '}, {text: 'disabled', color: 'red'}]);
} } else if (args[1] === 'current') {
if (args[1] === 'current') {
bot.music.loop = 1; bot.music.loop = 1;
bot.tellraw('@a', [{text: 'Now Looping '}, {text: song.name, color: 'gold'}]); bot.tellraw('@a', [{text: 'Now Looping '}, {text: song.name, color: 'gold'}]);
} } else if (args[1] === 'all') {
if (args[1] === 'all') {
bot.music.loop = 2; bot.music.loop = 2;
bot.tellraw('@a', {text: 'Now looping every song in the queue'}); bot.tellraw('@a', {text: 'Now looping every song in the queue'});
} else {
throw new SyntaxError('Invalid argument');
} }
} } else if (args[0] === 'list') {
if (args[0] === 'list') {
list(bot); list(bot);
} } else if (args[0] === 'nowplaying') {
if (args[0] === 'nowplaying') {
bot.tellraw('@a', [{text: 'Now playing '}, {text: bot.music.song.name, color: 'gold'}]); bot.tellraw('@a', [{text: 'Now playing '}, {text: bot.music.song.name, color: 'gold'}]);
} else {
throw new SyntaxError('Invalid argument');
} }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {

View file

@ -10,14 +10,14 @@ module.exports = {
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
const timezone = args.join(' '); const timezone = args.join(' ');
const momented = moment().tz(`${timezone}`).format('dddd, MMMM Do, YYYY, hh:mm:ss A'); const momented = moment().tz(`${timezone}`).format('dddd, MMMM Do, YYYY, hh:mm:ss A');
const command = 'minecraft:tellraw @a ' + JSON.stringify(['', {text: 'The current date and time for the timezone ', color: 'white'}, {text: timezone, color: 'aqua'}, {text: ' is: ', color: 'white'}, {text: `${momented}`, color: 'green'}]); const component = [{text: 'The current date and time for the timezone ', color: 'white'}, {text: timezone, color: 'aqua'}, {text: ' is: ', color: 'white'}, {text: `${momented}`, color: 'green'}];
if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') { if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') {
bot.core.run(command); bot.tellraw('@a', component);
return; return;
} else if (momented === moment().format('dddd, MMMM Do, YYYY, hh:mm:ss A')) { } else if (momented === moment().format('dddd, MMMM Do, YYYY, hh:mm:ss A')) {
throw new SyntaxError('Invalid timezone'); throw new SyntaxError('Invalid timezone');
} else { } else {
bot.core.run(command); bot.tellraw('@a', component);
} }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) {

View file

@ -10,7 +10,7 @@ module.exports = {
execute: async function(bot, username, usernameraw, sender, prefix, args) { execute: async function(bot, username, usernameraw, sender, prefix, args) {
try { try {
const res = await translate(args.slice(2).join(' '), {from: args[0], to: args[1]}); const res = await translate(args.slice(2).join(' '), {from: args[0], to: args[1]});
bot.tellraw('@a', ['', {text: 'Result: ', color: 'gold'}, {text: res.text, color: 'green'}]); bot.tellraw('@a', [{text: 'Result: ', color: 'gold'}, {text: res.text, color: 'green'}]);
} catch (e) { } catch (e) {
bot.tellraw('@a', {text: String(e), color: 'red'}); bot.tellraw('@a', {text: String(e), color: 'red'});
} }

View file

@ -8,7 +8,7 @@ module.exports = {
usage: '', usage: '',
trusted: 0, trusted: 0,
execute: function(bot) { execute: function(bot) {
bot.tellraw('@a', ['', {text: 'The bot\'s uptime is ', color: 'white'}, {text: `${secondsToHms(Math.floor(performance.now() / 1000))}`, color: 'green'}]); bot.tellraw('@a', [{text: 'The bot\'s uptime is ', color: 'white'}, {text: `${secondsToHms(Math.floor(performance.now() / 1000))}`, color: 'green'}]);
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -9,11 +9,11 @@ module.exports = {
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
urban.autocompleteExtra(args[0], (error, results) => { urban.autocompleteExtra(args[0], (error, results) => {
if (error) { if (error) {
bot.tellraw('@a', ['', {text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: error.message, color: 'red'}]); bot.tellraw('@a', [{text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: error.message, color: 'red'}]);
return; return;
} }
results.forEach(({preview, term}) => { results.forEach(({preview, term}) => {
bot.tellraw('@a', ['', {text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: term, color: 'white'}, {text: ' - ', color: 'white'}, {text: preview, color: 'white'}]); bot.tellraw('@a', [{text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: term, color: 'white'}, {text: ' - ', color: 'white'}, {text: preview, color: 'white'}]);
}); });
}); });
}, },

View file

@ -233,7 +233,7 @@ function main() {
crypto, crypto,
colorConvert, colorConvert,
bruhifyText: function(message) { bruhifyText: function(message) {
if (typeof message!=='string') throw new SyntaxError('message must be a string'); if (typeof message !== 'string') throw new SyntaxError('message must be a string');
bot.bruhifyText = message.substring(0, 1000); bot.bruhifyText = message.substring(0, 1000);
}, },
generateEaglerUsername, generateEaglerUsername,
@ -259,7 +259,7 @@ function main() {
if (parsedMessage.translate === 'translation.test.invalid') return; if (parsedMessage.translate === 'translation.test.invalid') return;
// down here it prevents command set message // down here it prevents command set message
if (parsedMessage.translate === 'advMode.setCommand.success') return; if (parsedMessage.translate === 'advMode.setCommand.success') return;
if (parsedMessage.extra!==undefined) { if (parsedMessage.extra !== undefined) {
if (parsedMessage.extra[0].text === 'Command set: ') return; if (parsedMessage.extra[0].text === 'Command set: ') return;
} }
// prevent braille cuz it CRASHES THE ENTIRE LAPTOP // prevent braille cuz it CRASHES THE ENTIRE LAPTOP
@ -374,7 +374,7 @@ dcclient.on('ready', async () => {
} }
if (line === '.kill') process.exit(); if (line === '.kill') process.exit();
if (line.startsWith('.')) return bot.command_handler.run('Console', '§a§lConsole§r', '*' + line.substring(1), 'c0ns0le-uuid'); if (line.startsWith('.')) return bot.command_handler.run('Console', '§a§lConsole§r', '*' + line.substring(1), 'c0ns0le-uuid');
bot.tellraw('@a', ['', {'text': '[', 'color': 'dark_gray'}, {'text': `${bot.username} Console`, 'color': 'gray'}, {'text': '] ', 'color': 'dark_gray'}, {'text': 'chayapak ', 'color': 'green'}, {'text': ' ', 'color': 'dark_gray'}, chatMessage.MessageBuilder.fromString('&7' + line)]); bot.tellraw('@a', [{'text': '[', 'color': 'dark_gray'}, {'text': `${bot.username} Console`, 'color': 'gray'}, {'text': '] ', 'color': 'dark_gray'}, {'text': 'chayapak ', 'color': 'green'}, {'text': ' ', 'color': 'dark_gray'}, chatMessage.MessageBuilder.fromString('&7' + line)]);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }

View file

@ -54,7 +54,7 @@ function inject(bot, dcclient, config) {
}); });
const interval = setInterval(() => { const interval = setInterval(() => {
if (bot.options.host!=='0.tcp.ap.ngrok.io') { if (bot.options.host !== '0.tcp.ap.ngrok.io') {
if (!prefix && config.self_care.prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]'); if (!prefix && config.self_care.prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]');
if (!op && config.self_care.op) bot.chat('/minecraft:op @s[type=player]'); if (!op && config.self_care.op) bot.chat('/minecraft:op @s[type=player]');
if (!cspy && config.self_care.cspy) bot.chat('/commandspy:commandspy on'); if (!cspy && config.self_care.cspy) bot.chat('/commandspy:commandspy on');

View file

@ -16,7 +16,7 @@ const styles = {
function stylize(str, styleType) { function stylize(str, styleType) {
const style = styles[styleType]; const style = styles[styleType];
if (style !== undefined) return `${style}${str}\xa7r`; if (style !== undefined) return `${style}${str}\xa7r`;
return str; return str;
} }

View file

@ -1,6 +1,6 @@
/* eslint-disable max-len */ /* eslint-disable max-len */
function isAllowedCharacter(character) { function isAllowedCharacter(character) {
return character !== '\xa7' && character >= ' ' && character !== '\x7f'; return character !== '\xa7' && character >= ' ' && character !== '\x7f';
} }
function containsIllegalCharacters(string) { function containsIllegalCharacters(string) {
for (let i = 0; i < string.length; i++) if (!isAllowedCharacter(string[i])) return true; for (let i = 0; i < string.length; i++) if (!isAllowedCharacter(string[i])) return true;

View file

@ -5,7 +5,7 @@ async function fileExists (filepath) {
await fs.access(filepath) await fs.access(filepath)
return true return true
} catch (error) { } catch (error) {
if (error.code !== 'ENOENT') throw error if (error.code !== 'ENOENT') throw error
return false return false
} }