" === " not "==="

This commit is contained in:
ChomeNS 2022-11-07 19:26:38 +07:00
parent a8e21f8b7b
commit e6455a25fc
25 changed files with 111 additions and 111 deletions

View file

@ -6,14 +6,14 @@ module.exports = {
trusted: 1, trusted: 1,
usage: '<hash> <c:|command>', usage: '<hash> <c:|command>',
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
bot.core.run(`essentials:sudo * ${args.slice(1).join(' ')}`); bot.core.run(`essentials:sudo * ${args.slice(1).join(' ')}`);
} else { } else {
throw new Error('Invalid hash'); 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 (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
bot.core.run(`essentials:sudo * ${args.join(' ')}`); bot.core.run(`essentials:sudo * ${args.join(' ')}`);
} else { } else {
throw new Error('You\'re not in the trusted role!'); throw new Error('You\'re not in the trusted role!');

View file

@ -7,12 +7,12 @@ module.exports = {
usage: '<hash> <true|false>', usage: '<hash> <true|false>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
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'}]);
@ -24,8 +24,8 @@ 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');
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
@ -33,7 +33,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') {
bot.visibility = false; bot.visibility = false;
bot.chat('/essentials:vanish enable'); bot.chat('/essentials:vanish enable');
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -7,7 +7,7 @@ module.exports = {
usage: '[specific] <player>', usage: '[specific] <player>',
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]==='specific') { if (args[0] === 'specific') {
bot.tellraw(args[1], [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: `Your chat has been cleared by ${username}.`, color: 'dark_green'}]); bot.tellraw(args[1], [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: `Your chat has been cleared by ${username}.`, color: 'dark_green'}]);
return; return;
} else { } else {
@ -15,7 +15,7 @@ module.exports = {
} }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
if (args[0]==='specific') { if (args[0] === 'specific') {
bot.tellraw(args[1], [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: `Your chat has been cleared by ${username} (on Discord).`, color: 'dark_green'}]); bot.tellraw(args[1], [{text: `${'\n'.repeat(100)}`, color: 'white'}, {text: `Your chat has been cleared by ${username} (on Discord).`, color: 'dark_green'}]);
return; return;
} else { } else {

View file

@ -63,8 +63,8 @@ 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[1] === 'add') {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
if (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);
@ -75,16 +75,16 @@ module.exports = {
} }
return; return;
} }
if (args[1]==='list') { if (args[1] === 'list') {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
list(bot); list(bot);
} else { } else {
throw new Error('Invalid hash'); throw new Error('Invalid hash');
} }
return; return;
} }
if (args[1]==='remove') { if (args[1] === 'remove') {
if (args[0]===bot.hash) { 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 {
@ -92,8 +92,8 @@ module.exports = {
} }
return; return;
} }
if (args[1]==='removeall') { if (args[1] === 'removeall') {
if (args[0]===bot.hash) { 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 {
@ -105,7 +105,7 @@ module.exports = {
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 (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[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');
@ -121,7 +121,7 @@ module.exports = {
} }
return; return;
} }
if (args[0]==='list') { if (args[0] === 'list') {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
list(bot, true, channeldc); list(bot, true, channeldc);
} else { } else {
@ -129,7 +129,7 @@ module.exports = {
} }
return; return;
} }
if (args[0]==='remove') { if (args[0] === 'remove') {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
remove(args[1]); remove(args[1]);
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
@ -142,7 +142,7 @@ module.exports = {
} }
return; return;
} }
if (args[0]==='removeall') { if (args[0] === 'removeall') {
if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
clear(); clear();
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -15,9 +15,9 @@ module.exports = {
let message = ''; let message = '';
Object.keys(cows).forEach((value) => { Object.keys(cows).forEach((value) => {
if (color==='§6') { if (color === '§6') {
color = '§e'; color = '§e';
} else if (color==='§e') { } else if (color === '§e') {
color = '§6'; color = '§6';
}; };
message += color + value + ' '; message += color + value + ' ';

View file

@ -16,14 +16,14 @@ module.exports = {
usage: '<hash>', usage: '<hash>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0] === bot.hash) { if (args[0] === bot.hash) {
crash(bot); crash(bot);
} else { } else {
throw new Error('Invalid hash'); 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 (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
crash(bot); crash(bot);
} else { } else {
throw new Error('You\'re not in the trusted role!'); throw new Error('You\'re not in the trusted role!');

View file

@ -6,19 +6,19 @@ module.exports = {
usage: '<on|off> <hash>', usage: '<on|off> <hash>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[1]==='on') { if (args[1] === 'on') {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
bot.eaglercrashstarted = true; bot.eaglercrashstarted = true;
bot.eaglercrash = setInterval(async function() { bot.eaglercrash = setInterval(async function() {
if (bot.eaglercrashstarted===true) return bot.core.run('minecraft:playsound block.note_block.harp record @a ~ ~ ~ 100000000000000000000000000000000000000 1 0'); if (bot.eaglercrashstarted === true) return bot.core.run('minecraft:playsound block.note_block.harp record @a ~ ~ ~ 100000000000000000000000000000000000000 1 0');
}, 0); }, 0);
bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash started","color":"white"}]'); bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash started","color":"white"}]');
} else { } else {
throw new Error('Invalid hash'); throw new Error('Invalid hash');
} }
} }
if (args[1]==='off') { if (args[1] === 'off') {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
clearInterval(bot.eaglercrash); clearInterval(bot.eaglercrash);
bot.eaglercrashstarted = false; bot.eaglercrashstarted = false;
bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash stopped","color":"white"}]'); bot.core.run('minecraft:tellraw @a ["",{"text":"Eaglercrash stopped","color":"white"}]');

View file

@ -6,14 +6,14 @@ module.exports = {
usage: '<hash>', usage: '<hash>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
bot.end('end command'); bot.end('end command');
} else { } else {
throw new Error('Invalid hash'); 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 (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (message.member.roles.cache.some((role) => role.name === 'Trusted')) {
bot.end('end command'); bot.end('end command');
} else { } else {
throw new Error('You\'re not in the trusted role!'); throw new Error('You\'re not in the trusted role!');

View file

@ -16,7 +16,7 @@ module.exports = {
// 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

@ -12,17 +12,17 @@ module.exports = {
trusted: 0, trusted: 0,
usage: '<run|reset|server> <code>', usage: '<run|reset|server> <code>',
execute: function(bot, username, usernameraw, sender, prefix, args, config) { execute: function(bot, username, usernameraw, sender, prefix, args, config) {
if (args[0]==='run') { if (args[0] === 'run') {
try { try {
bot.tellraw('@a', {text: `${util.inspect(bot.vm.run(args.slice(1).join(' ')), {stylize: stylize})}`.substring(0, 1900)}); bot.tellraw('@a', {text: `${util.inspect(bot.vm.run(args.slice(1).join(' ')), {stylize: stylize})}`.substring(0, 1900)});
} catch (err) { } catch (err) {
bot.tellraw('@a', {text: `${util.inspect(err).replaceAll('runner', 'chayapak1')}`, color: 'red'}); bot.tellraw('@a', {text: `${util.inspect(err).replaceAll('runner', 'chayapak1')}`, color: 'red'});
} }
} }
if (args[0]==='reset') { if (args[0] === 'reset') {
bot.vm = new VM(bot.vmoptions); bot.vm = new VM(bot.vmoptions);
} }
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,
@ -35,7 +35,7 @@ module.exports = {
bot.tellraw('@a', {text: `${err}`, color: 'red'}); bot.tellraw('@a', {text: `${err}`, color: 'red'});
}); });
} }
// if (args[0]==='dineval') { // if (args[0] === 'dineval') {
// axios // axios
// .get('https://eval.dinhero21.repl.co', { // .get('https://eval.dinhero21.repl.co', {
// headers: { // headers: {
@ -50,7 +50,7 @@ module.exports = {
// } // }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
if (args[0]==='run') { if (args[0] === 'run') {
try { try {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor('#FFFF00')
@ -61,10 +61,10 @@ module.exports = {
throw err; throw err;
} }
} }
if (args[0]==='reset') { if (args[0] === 'reset') {
bot.vm = new VM(bot.vmoptions); bot.vm = new VM(bot.vmoptions);
} }
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,

View file

@ -6,7 +6,7 @@ module.exports = {
usage: '<hash> <command>', usage: '<hash> <command>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
bot.core.run('minecraft:execute unless entity @s[name= run ] run ' + args.slice(1).join(' ')); bot.core.run('minecraft:execute unless entity @s[name= run ] run ' + args.slice(1).join(' '));
} else { } else {
throw new Error('Invalid hash'); throw new Error('Invalid hash');

View file

@ -6,7 +6,7 @@ module.exports = {
usage: '<hash> <gamemode>', usage: '<hash> <gamemode>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
bot.core.run(`minecraft:execute unless entity @s[name= run ] run gamemode ${args[1]} @a[name=!${bot.username}]`); bot.core.run(`minecraft:execute unless entity @s[name= run ] run gamemode ${args[1]} @a[name=!${bot.username}]`);
} else { } else {
throw new Error('Invalid hash'); throw new Error('Invalid hash');

View file

@ -28,7 +28,7 @@ module.exports = {
function m() { function m() {
let discordSupported; let discordSupported;
let alias = command.name; let alias = command.name;
if (typeof command.discordExecute==='undefined') { if (typeof command.discordExecute === 'undefined') {
discordSupported = 'false'; discordSupported = 'false';
} else { } else {
discordSupported = 'true'; discordSupported = 'true';
@ -42,9 +42,9 @@ module.exports = {
bot.tellraw('@a', [{text: prefix + command.name, color: 'gold'}, {text: ' ' + command.usage, color: 'aqua'}]); bot.tellraw('@a', [{text: prefix + command.name, color: 'gold'}, {text: ' ' + command.usage, color: 'aqua'}]);
} }
if (command.name === args[0]) m(); if (command.name === args[0]) m();
for (const alias of command.alias) { for (const alias of command.alias) {
if (alias === args[0]) m(); if (alias === args[0]) m();
} }
}; };
} else { } else {
@ -58,7 +58,7 @@ module.exports = {
function m() { function m() {
let discordSupported; let discordSupported;
let alias = command.name; let alias = command.name;
if (typeof command.discordExecute==='undefined') { if (typeof command.discordExecute === 'undefined') {
discordSupported = 'false'; discordSupported = 'false';
} else { } else {
discordSupported = 'true'; discordSupported = 'true';
@ -76,16 +76,16 @@ module.exports = {
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
} }
if (command.name === args[0]) m(); if (command.name === args[0]) m();
for (const alias of command.alias) { for (const alias of command.alias) {
if (alias === args[0]) m(); if (alias === args[0]) m();
} }
}; };
} else { } else {
let supportedCommands = ''; let supportedCommands = '';
let unsupportedCommands = ''; let unsupportedCommands = '';
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;
supportedCommands += command.name + ' '; supportedCommands += command.name + ' ';
} }
for (const command of bot.command_handler.commands) { for (const command of bot.command_handler.commands) {

View file

@ -9,7 +9,7 @@ const os = require('os');
let SONGS_PATH; let SONGS_PATH;
if (os.hostname()==='chomens-kubuntu') { if (os.hostname() === 'chomens-kubuntu') {
SONGS_PATH = path.join(__dirname, '..', '..', 'nginx-html', 'midis'); SONGS_PATH = path.join(__dirname, '..', '..', 'nginx-html', 'midis');
} else { } else {
SONGS_PATH = path.join(__dirname, '..', 'midis'); SONGS_PATH = path.join(__dirname, '..', 'midis');
@ -102,9 +102,9 @@ async function list(bot, discord, channeldc) {
const message = []; const message = [];
listed.forEach((value) => { listed.forEach((value) => {
if (color==='gold') { if (color === 'gold') {
color = 'yellow'; color = 'yellow';
} else if (color==='yellow') { } else if (color === 'yellow') {
color = 'gold'; color = 'gold';
}; };
message.push({text: value + ' ', message.push({text: value + ' ',
@ -134,13 +134,13 @@ module.exports = {
trusted: 0, trusted: 0,
usage: '<play|playurl|stop|loop|list|skip|loop|nowplaying> <song|all|current|off>', usage: '<play|playurl|stop|loop|list|skip|loop|nowplaying> <song|all|current|off>',
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));
} }
if (args[0]==='playurl') { if (args[0] === 'playurl') {
playUrl(bot, args.slice(1)); playUrl(bot, args.slice(1));
} }
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) {
@ -148,7 +148,7 @@ module.exports = {
} }
bot.music.stop(); bot.music.stop();
} }
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();
@ -156,7 +156,7 @@ module.exports = {
throw new Error('No music is currently playing!'); throw new Error('No music is currently playing!');
} }
} }
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'}]);
@ -170,21 +170,21 @@ module.exports = {
bot.tellraw('@a', {text: 'Now looping every song in the queue'}); bot.tellraw('@a', {text: 'Now looping every song in the queue'});
} }
} }
if (args[0]==='list') { if (args[0] === 'list') {
list(bot); list(bot);
} }
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'}]);
} }
}, },
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
if (args[0]==='play') { if (args[0] === 'play') {
play(bot, args.slice(1), true, channeldc); play(bot, args.slice(1), true, channeldc);
} }
if (args[0]==='playurl') { if (args[0] === 'playurl') {
playUrl(bot, args.slice(1), true, channeldc); playUrl(bot, args.slice(1), true, channeldc);
} }
if (args[0]==='stop') { if (args[0] === 'stop') {
try { try {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor('#FFFF00')
@ -196,7 +196,7 @@ module.exports = {
} }
bot.music.stop(); bot.music.stop();
} }
if (args[0]==='skip') { if (args[0] === 'skip') {
try { try {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor('#FFFF00')
@ -208,7 +208,7 @@ module.exports = {
throw new Error('No music is currently playing!'); throw new Error('No music is currently playing!');
} }
} }
if (args[0]==='loop') { if (args[0] === 'loop') {
if (args[1] === 'off') { if (args[1] === 'off') {
bot.music.loop = 0; bot.music.loop = 0;
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
@ -234,10 +234,10 @@ module.exports = {
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
} }
} }
if (args[0]==='list') { if (args[0] === 'list') {
list(bot, true, channeldc); list(bot, true, channeldc);
} }
if (args[0]==='nowplaying') { if (args[0] === 'nowplaying') {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor('#FFFF00')
.setTitle('Now playing') .setTitle('Now playing')

View file

@ -8,7 +8,7 @@ module.exports = {
trusted: 2, trusted: 2,
usage: '<ownerhash> <code>', usage: '<ownerhash> <code>',
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.ownerHash) { if (args[0] === bot.ownerHash) {
try { try {
bot.tellraw('@a', {text: `${util.inspect(eval(args.slice(1).join(' ')), {stylize: stylize})}`.substring(0, 1900)}); bot.tellraw('@a', {text: `${util.inspect(eval(args.slice(1).join(' ')), {stylize: stylize})}`.substring(0, 1900)});
} catch (err) { } catch (err) {

View file

@ -11,10 +11,10 @@ module.exports = {
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 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'}]);
if (timezone.toLowerCase()==='asia/bangkok' || timezone.toLowerCase()==='utc') { if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') {
bot.core.run(command); bot.core.run(command);
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.core.run(command);
@ -24,14 +24,14 @@ module.exports = {
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 description = `The current date and time for the timezone ${timezone} is: ${momented}`; const description = `The current date and time for the timezone ${timezone} is: ${momented}`;
if (timezone.toLowerCase()==='asia/bangkok' || timezone.toLowerCase()==='utc') { if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#FFFF00') .setColor('#FFFF00')
.setTitle('Time') .setTitle('Time')
.setDescription(description); .setDescription(description);
channeldc.send({embeds: [Embed]}); channeldc.send({embeds: [Embed]});
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 {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()

View file

@ -6,7 +6,7 @@ module.exports = {
usage: '<hash> <player>', usage: '<hash> <player>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
bot.core.run(`minecraft:execute unless entity @s[name= run ] run tp @a ${args.slice(1).join(' ')}`); bot.core.run(`minecraft:execute unless entity @s[name= run ] run tp @a ${args.slice(1).join(' ')}`);
} else { } else {
throw new Error('Invalid hash'); throw new Error('Invalid hash');

View file

@ -6,9 +6,9 @@ module.exports = {
usage: '<hash>', usage: '<hash>',
trusted: 1, trusted: 1,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]===bot.hash) { if (args[0] === bot.hash) {
bot.tellraw('@a', {text: 'Valid hash', color: 'green'}); bot.tellraw('@a', {text: 'Valid hash', color: 'green'});
} else if (args[0]===bot.ownerHash) { } else if (args[0] === bot.ownerHash) {
bot.tellraw('@a', {text: 'Valid OwnerHash', color: 'green'}); bot.tellraw('@a', {text: 'Valid OwnerHash', color: 'green'});
} else { } else {
bot.tellraw('@a', {text: 'Invalid hash', color: 'red'}); bot.tellraw('@a', {text: 'Invalid hash', color: 'red'});

View file

@ -122,7 +122,7 @@ function main() {
// allink's chat queue // allink's chat queue
chatQueue = setInterval(function() { chatQueue = setInterval(function() {
try { try {
if (bot.queue[0] || bot.queue[0]==='') { if (bot.queue[0] || bot.queue[0] === '') {
try { try {
if (containsIllegalCharacters(bot.queue[0])) { if (containsIllegalCharacters(bot.queue[0])) {
bot.queue.shift(); bot.queue.shift();
@ -165,7 +165,7 @@ function main() {
consoleQueueInterval = setInterval(function() { consoleQueueInterval = setInterval(function() {
if (!messageloggingEnabled) return; if (!messageloggingEnabled) return;
if (consoleQueue.length > 50) consoleQueue = []; if (consoleQueue.length > 50) consoleQueue = [];
if (consoleQueue[0] || consoleQueue[0]==='') { if (consoleQueue[0] || consoleQueue[0] === '') {
console.log('\u001b[48:5:208m' + bot.options.host + '\u001b[0m' + ': ' + consoleQueue[0].substring(0, 10000)/* message.toAnsi() + '\u001b[0m'*/); console.log('\u001b[48:5:208m' + bot.options.host + '\u001b[0m' + ': ' + consoleQueue[0].substring(0, 10000)/* message.toAnsi() + '\u001b[0m'*/);
consoleQueue.shift(); consoleQueue.shift();
} }
@ -252,15 +252,15 @@ function main() {
bot.on('parsed_chat', async function(message, data) { bot.on('parsed_chat', async function(message, data) {
// try catch prevents hi % exploit (it uses prismarine-chat) and json parse error // try catch prevents hi % exploit (it uses prismarine-chat) and json parse error
try { try {
if (previusMessage===message.toString()) return; if (previusMessage === message.toString()) return;
previusMessage = message.toString(); previusMessage = message.toString();
const parsedMessage = JSON.parse(data.message); const parsedMessage = JSON.parse(data.message);
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
if (message.toString().includes('⣿')) return; if (message.toString().includes('⣿')) return;
@ -311,27 +311,27 @@ function main() {
dcclient.on('ready', async () => { dcclient.on('ready', async () => {
botThings(); botThings();
// Find the Discord channel messages will be sent to // Find the Discord channel messages will be sent to
if (process.argv[2]==='sus.shhnowisnottheti.me') { if (process.argv[2] === 'sus.shhnowisnottheti.me') {
channel = dcclient.channels.cache.get(ayunboomchannel); channel = dcclient.channels.cache.get(ayunboomchannel);
bot.channel = dcclient.channels.cache.get(ayunboomchannel); bot.channel = dcclient.channels.cache.get(ayunboomchannel);
} }
if (process.argv[2]==='129.159.58.114') { if (process.argv[2] === '129.159.58.114') {
channel = dcclient.channels.cache.get(dinboomchannel); channel = dcclient.channels.cache.get(dinboomchannel);
bot.channel = dcclient.channels.cache.get(dinboomchannel); bot.channel = dcclient.channels.cache.get(dinboomchannel);
} }
if (process.argv[2]==='kaboom.pw') { if (process.argv[2] === 'kaboom.pw') {
channel = dcclient.channels.cache.get(kaboomchannel); channel = dcclient.channels.cache.get(kaboomchannel);
bot.channel = dcclient.channels.cache.get(kaboomchannel); bot.channel = dcclient.channels.cache.get(kaboomchannel);
} }
if (process.argv[2]==='192.168.1.103') { if (process.argv[2] === '192.168.1.103') {
channel = dcclient.channels.cache.get(localclonechannel); channel = dcclient.channels.cache.get(localclonechannel);
bot.channel = dcclient.channels.cache.get(localclonechannel); bot.channel = dcclient.channels.cache.get(localclonechannel);
} }
if (process.argv[2]==='kitsune.icu') { if (process.argv[2] === 'kitsune.icu') {
channel = dcclient.channels.cache.get(kitsunechannel); channel = dcclient.channels.cache.get(kitsunechannel);
bot.channel = dcclient.channels.cache.get(kitsunechannel); bot.channel = dcclient.channels.cache.get(kitsunechannel);
} }
if (process.argv[2]==='mc.chomens41793.ga') { if (process.argv[2] === 'mc.chomens41793.ga') {
channel = dcclient.channels.cache.get(chomensserverchannel); channel = dcclient.channels.cache.get(chomensserverchannel);
bot.channel = dcclient.channels.cache.get(chomensserverchannel); bot.channel = dcclient.channels.cache.get(chomensserverchannel);
} }
@ -346,8 +346,8 @@ dcclient.on('ready', async () => {
// Console COMMANDS // Console COMMANDS
rl.on('line', function(line) { rl.on('line', function(line) {
try { try {
if (line.toLowerCase()==='' || line.toLowerCase().startsWith(' ')) return; if (line.toLowerCase() === '' || line.toLowerCase().startsWith(' ')) return;
if (line.toLowerCase()==='.exit' || line.toLowerCase()==='.end') { if (line.toLowerCase() === '.exit' || line.toLowerCase() === '.end') {
bot.emit('end', 'end command'); bot.emit('end', 'end command');
return; return;
} }
@ -360,19 +360,19 @@ dcclient.on('ready', async () => {
return; return;
} }
} }
if (line==='.clearconsolequeue') { if (line === '.clearconsolequeue') {
consoleQueue = []; consoleQueue = [];
return; return;
} }
if (line==='.messagelogging on') { if (line === '.messagelogging on') {
messageloggingEnabled = true; messageloggingEnabled = true;
return; return;
} }
if (line==='.messagelogging off') { if (line === '.messagelogging off') {
messageloggingEnabled = false; messageloggingEnabled = false;
return; return;
} }
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) {

View file

@ -4,7 +4,7 @@ module.exports = {
bot.bruhifyText = ''; bot.bruhifyText = '';
let startHue = 0; let startHue = 0;
timer = setInterval(() => { timer = setInterval(() => {
if (bot.bruhifyText==='') return; if (bot.bruhifyText === '') return;
let hue = startHue; let hue = startHue;
const displayName = bot.bruhifyText; const displayName = bot.bruhifyText;

View file

@ -21,29 +21,29 @@ function inject(bot) {
try { try {
const raw = message.toMotd().substring(0, 32767); const raw = message.toMotd().substring(0, 32767);
if (raw.match(/.* .*: .*/g)) { if (raw.match(/.* .*: .*/g)) {
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return; // if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
const username = raw.replace(/.*?\[.*?\] /, '').replace(/:.*/g, '').replace(/§#....../gm, ''); const username = raw.replace(/.*?\[.*?\] /, '').replace(/:.*/g, '').replace(/§#....../gm, '');
const message = raw.split(': ')[1]; const message = raw.split(': ')[1];
bot.emit('message', username, message, packet.sender); bot.emit('message', username, message, packet.sender);
} else if (raw.match(/.* .*\u203a .*/g)) { } else if (raw.match(/.* .*\u203a .*/g)) {
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return; // if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u203a.*/g, '').replace(/§#....../gm, '').split(' ')[0]; const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u203a.*/g, '').replace(/§#....../gm, '').split(' ')[0];
const message = raw.split('\u203a ')[1].substring(2); const message = raw.split('\u203a ')[1].substring(2);
bot.emit('message', username, message, packet.sender); bot.emit('message', username, message, packet.sender);
} else if (raw.match(/.* .*\u00BB .*/g)) { } else if (raw.match(/.* .*\u00BB .*/g)) {
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return; // if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u00BB.*/g, '').replace(/§#....../gm, '').split(' ')[0]; const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u00BB.*/g, '').replace(/§#....../gm, '').split(' ')[0];
const message = raw.split('\u00BB ')[1].substring(2); const message = raw.split('\u00BB ')[1].substring(2);
bot.emit('message', username, message, packet.sender); bot.emit('message', username, message, packet.sender);
} else if (raw.match(/<.*§r> .*/g)) { } else if (raw.match(/<.*§r> .*/g)) {
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return; // if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
const username = raw.substring(3).split('§r>')[0]; const username = raw.substring(3).split('§r>')[0];
const message = raw.split('§r> ')[1]; const message = raw.split('§r> ')[1];
bot.emit('message', username, message, packet.sender); bot.emit('message', username, message, packet.sender);
} else if (raw.match(/<.*> .*/g)) { } else if (raw.match(/<.*> .*/g)) {
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return; // if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
const username = raw.substring(3).split('>')[0]; const username = raw.substring(3).split('>')[0];
const message = raw.split('> ')[1]; const message = raw.split('> ')[1];

View file

@ -37,7 +37,7 @@ function inject(bot, dcclient, config) {
relativePosition.z = 0; relativePosition.z = 0;
} }
const impulseMode = bot.options.host === '0.tcp.ap.ngrok.io'; const impulseMode = bot.options.host === '0.tcp.ap.ngrok.io';
const location = { const location = {
x: core.start.x + relativePosition.x, x: core.start.x + relativePosition.x,
@ -108,11 +108,11 @@ function inject(bot, dcclient, config) {
}); });
// bot._client.on('block_change', (packet) => { // bot._client.on('block_change', (packet) => {
// if (core.isCore(packet.location) && packet.type===0) fillCore(); // if (core.isCore(packet.location) && packet.type === 0) fillCore();
// }); // });
// bot._client.on('multi_block_change', (packet) => { // bot._client.on('multi_block_change', (packet) => {
// if (core.start===packet.chunkCoordinates || core.end===packet.chunkCoordinates) fillCore(); // if (core.start === packet.chunkCoordinates || core.end === packet.chunkCoordinates) fillCore();
// }); // });
bot.on('end', () => { bot.on('end', () => {

View file

@ -148,7 +148,7 @@ function inject(bot) {
const players = await bot.requester.getPlayerList(); const players = await bot.requester.getPlayerList();
if (fullPlayer && players.some((name) => name === fullPlayer.name)) { if (fullPlayer && players.some((name) => name === fullPlayer.name)) {
bot.emit('player_vanished', player); bot.emit('player_vanished', player);
return; return;

View file

@ -8,20 +8,20 @@ function inject(bot, dcclient, config) {
let muted = false; let muted = false;
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; if (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]') {
prefix = true; prefix = true;
return; return;
} }
if (data.toString().startsWith('You no longer have a tag')) prefix = false; if (data.toString().startsWith('You no longer have a tag')) prefix = false;
if (data.toString().startsWith('You now have the tag: ')) prefix = false; if (data.toString().startsWith('You now have the tag: ')) prefix = false;
if (data.toString().startsWith('You have been muted')) muted = true; if (data.toString().startsWith('You have been muted')) muted = true;
if (data.toString()==='You have been unmuted.') muted = false; if (data.toString() === 'You have been unmuted.') muted = false;
}); });
bot._client.on('entity_status', (data) => { bot._client.on('entity_status', (data) => {

View file

@ -71,7 +71,7 @@ function parseText(string) {
* @return {string} The parsed raw string. * @return {string} The parsed raw string.
*/ */
function parseJson(json, parent) { function parseJson(json, parent) {
if (typeof json === 'string') json = {text: json}; if (typeof json === 'string') json = {text: json};
json.color ??= parent.color; json.color ??= parent.color;
json.bold ??= parent.bold; json.bold ??= parent.bold;
@ -110,7 +110,7 @@ function parseJson(json, parent) {
let i = 0; let i = 0;
raw += language[json.translate].replace(/%(?:(\d+)\$)?(s|%)/g, (g0, g1) => { raw += language[json.translate].replace(/%(?:(\d+)\$)?(s|%)/g, (g0, g1) => {
if (g0 === '%%') { if (g0 === '%%') {
return '%'; return '%';
} else { } else {
const idx = g1 ? parseInt(g1) : i++; const idx = g1 ? parseInt(g1) : i++;
@ -132,7 +132,7 @@ function parseJson(json, parent) {
// Remove trailing section signs // Remove trailing section signs
let end = raw.length; let end = raw.length;
while (raw[end - 1] === '§') end--; while (raw[end - 1] === '§') end--;
raw = raw.substring(0, end); raw = raw.substring(0, end);
if (json.extra) { if (json.extra) {