From ba184e0019bc4fdc8652eef6d75241957ae9ddc5 Mon Sep 17 00:00:00 2001 From: 4Parker02991 Date: Fri, 29 Dec 2023 21:15:50 +0000 Subject: [PATCH] FNFBoyfriendBot v5.0.3 Build:325 --- bot.js | 6 +++--- chat/chipmunkmod.js | 2 +- commands/changelog.js | 7 +++++++ index.js | 1 + modules/command_core.js | 2 +- modules/command_manager.js | 2 +- modules/discord.js | 25 ++++++++++++++++++++-- modules/music.js | 2 +- modules/player_list.js | 2 +- package-lock.json | 43 ++++++++++++++++++++++++++------------ package.json | 5 +++-- 11 files changed, 72 insertions(+), 25 deletions(-) diff --git a/bot.js b/bot.js index 6331942..c8743e7 100644 --- a/bot.js +++ b/bot.js @@ -86,12 +86,12 @@ options.input ??= true }) //reason, fullReason client.on('end', reason => { bot.emit('end', reason) - //console.log(util.inspect(reason)) + console.log(reason) }) client.on('disconnect', reason => { bot.emit('disconnect', reason) - //console.log(reason) + console.log(reason) }) client.on('kick_disconnect', reason => { @@ -100,7 +100,7 @@ options.input ??= true }) client.on('keep_alive', ({ keepAliveId }) => { bot.emit('keep_alive', { keepAliveId }) - + // console.log(keepAliveId) }) client.on('error', error => bot.emit('error', error), ) diff --git a/chat/chipmunkmod.js b/chat/chipmunkmod.js index e1d6577..71d5c6f 100644 --- a/chat/chipmunkmod.js +++ b/chat/chipmunkmod.js @@ -14,7 +14,7 @@ function parseMessage (message, data, context, bot) { let sender const hoverEvent = senderComponent.hoverEvent - // console.log(hoverEvent) + //console.log(JSON.stringify(hoverEvent)) if (hoverEvent?.action === 'show_entity') { const id = hoverEvent.contents.id // diff --git a/commands/changelog.js b/commands/changelog.js index 1bf30fc..49bbf99 100644 --- a/commands/changelog.js +++ b/commands/changelog.js @@ -27,6 +27,13 @@ const bots = [ foundation: '12/26/23', exclaimer:'fixed the issue with the cpu checking in the info command added discord hashing back into the bot to work along side the keys made it check to see if the config file is in the directory and if not it will recreate the config from default.js', + }, + {// + name: { text: 'v5.0.3', color: 'gray', bold:false }, + authors: [''], + + foundation: '12/29/23', + exclaimer:'mabe the bot last update of 2023 cuz next year will be 2024 www but anyway expanded the disconnect messages for both console and discord but thats pretty much it', }, ]// //back diff --git a/index.js b/index.js index fe30874..375ec67 100644 --- a/index.js +++ b/index.js @@ -28,6 +28,7 @@ const bots = [] try{ bot.on('error', console.error) }catch(error){ + console.log(error.stack) } } diff --git a/modules/command_core.js b/modules/command_core.js index 597ac10..1f80687 100644 --- a/modules/command_core.js +++ b/modules/command_core.js @@ -79,7 +79,7 @@ async function inject (bot, options) { bot.on('packet.login', (data) =>{ const timer = setInterval(() => { bot.core.refill() - }, 180000) + }, bot.options.Core.interval) bot.on('end', (bot) => { clearInterval(timer) }) diff --git a/modules/command_manager.js b/modules/command_manager.js index c6b8df1..09b7c75 100644 --- a/modules/command_manager.js +++ b/modules/command_manager.js @@ -165,7 +165,7 @@ if (command.trustLevel > 0) { if (error instanceof CommandError) source.sendError(error._message) // // else source.sendError({ text:String(error.stack), color:'red' }) - else source.sendError({ translate: 'command.failed', color:'red', hoverEvent: { action: 'show_text', contents: String(error.stack) } }) + else source.sendError({ translate: 'A Error has occured because the bot shot itself 🔫', color:'red', hoverEvent: { action: 'show_text', contents: String(error.stack) } }) if (source.sources.discord) { source.sendError(error) } diff --git a/modules/discord.js b/modules/discord.js index aa5bc7f..475b9b5 100644 --- a/modules/discord.js +++ b/modules/discord.js @@ -173,14 +173,35 @@ function inject (bot, options) { } client.on('messageCreate', messageCreate) -bot.on('error', (error, reason, data) => { + + bot.on('kick_disconnect', reason => { + sendDiscordMessage('server 🔫 itself and or was 💣 or even 💩 itself ' + JSON.stringify(reason)) + +//sendDiscordMessage(reason) + + }) + bot.on('disconnect', reason => { + + sendDiscordMessage(JSON.stringify(reason)) + +//sendDiscordMessage(reason) + + }) + bot.on('end', reason => { + + sendDiscordMessage(JSON.stringify(reason)) + +//sendDiscordMessage(reason) + + }) + bot.on('error', (error, reason, data) => { + sendDiscordMessage('🔫 shot itself') sendDiscordMessage(`Disconnected: ${error.stack}`) //sendDiscordMessage(reason) }) - /*bot.on('end', (reason, event) => { sendDiscordMessage('event:' + event) sendDiscordMessage('Reason:' + util.inspect(reason)) diff --git a/modules/music.js b/modules/music.js index 6a4a07c..7273b5c 100644 --- a/modules/music.js +++ b/modules/music.js @@ -140,7 +140,7 @@ function inject (bot) { noteIndex = 0 bot.core.run(`minecraft:bossbar remove ${bossbarName}`) // maybe not a good place to put it here but idk } -if (process.env["buildstring"] !== "§5FridayNightFunkin§bBoyfriend§4Bot §8v5.0.2 §8Build:315") +if (process.env["buildstring"] !== "§5FridayNightFunkin§bBoyfriend§4Bot §8v5.0.3 §8Build:325") { process.exit(1) } diff --git a/modules/player_list.js b/modules/player_list.js index aa108f1..11af1dc 100644 --- a/modules/player_list.js +++ b/modules/player_list.js @@ -46,7 +46,7 @@ function inject (bot) { target.removePlayer = entry.removePlayer } }// - if (process.env['FoundationBuildString'] !== 'Ultimate Foundation v2.0.2 Build:215') + if (process.env['FoundationBuildString'] !== 'Ultimate Foundation v2.0.3 Build:225') { process.exit(1) } diff --git a/package-lock.json b/package-lock.json index 30ebb96..5c52c45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,8 +15,8 @@ "dockerode": "^4.0.0", "dotenv": "^16.3.1", "isolated-vm": "^4.6.0", - "minecraft-data": "^3.49.1", - "minecraft-protocol": "^1.44.0", + "minecraft-data": "^3.53.0", + "minecraft-protocol": "^1.45.0", "minecraft-protocol-forge": "^1.0.0", "mineflayer": "^4.14.0", "mineflayer-cmd": "^1.1.3", @@ -30,6 +30,7 @@ "readline": "^1.3.0", "sharp": "^0.32.6", "urban-dictionary": "^3.0.2", + "urban-dictionary-client": "^3.1.0", "uuid-by-string": "^4.0.0", "vec3": "^0.1.8", "vm2": "^3.9.19", @@ -1223,9 +1224,9 @@ } }, "node_modules/minecraft-data": { - "version": "3.49.1", - "resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.49.1.tgz", - "integrity": "sha512-d6Off8xi/aLpAnzGsKKYxmStq9rPaR0HRHawUSvdpQ0WXDr02yGhJzTm9r2eAInayIzshxt624w1r5Z9NAGReQ==" + "version": "3.53.0", + "resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.53.0.tgz", + "integrity": "sha512-35+XuLCgzG0xvXKaN2huF5EpUXjjW7HE6fRg1bz4lwI+7sjl4DDQRnRTvdJq3gGrNT8lkWvtBf71/NnXvhdh+Q==" }, "node_modules/minecraft-folder-path": { "version": "1.2.0", @@ -1233,9 +1234,9 @@ "integrity": "sha512-qaUSbKWoOsH9brn0JQuBhxNAzTDMwrOXorwuRxdJKKKDYvZhtml+6GVCUrY5HRiEsieBEjCUnhVpDuQiKsiFaw==" }, "node_modules/minecraft-protocol": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/minecraft-protocol/-/minecraft-protocol-1.44.0.tgz", - "integrity": "sha512-sYu4fFzUKt3spPG5tAdkaB9sNQPT0sV6fyS0sS7/nxdzFfjmLhF6BLNC+32ieK4/MhgNyHtH6xusD0Bi0Roq9w==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/minecraft-protocol/-/minecraft-protocol-1.45.0.tgz", + "integrity": "sha512-vnw78FShBljUziQY8dNElJHJvQIscEPa97wEOiykOodUJKQiBDWB3ZETAd0CYzEFapS7SAlEiNuqFgJdG9o5aQ==", "dependencies": { "@types/readable-stream": "^4.0.0", "aes-js": "^3.1.2", @@ -1244,12 +1245,12 @@ "endian-toggle": "^0.0.0", "lodash.get": "^4.1.2", "lodash.merge": "^4.3.0", - "minecraft-data": "^3.37.0", + "minecraft-data": "^3.53.0", "minecraft-folder-path": "^1.2.0", "node-fetch": "^2.6.1", "node-rsa": "^0.4.2", "prismarine-auth": "^2.2.0", - "prismarine-nbt": "^2.0.0", + "prismarine-nbt": "^2.5.0", "prismarine-realms": "^1.2.0", "protodef": "^1.8.0", "readable-stream": "^4.1.0", @@ -4532,9 +4533,9 @@ } }, "node_modules/prismarine-nbt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prismarine-nbt/-/prismarine-nbt-2.2.1.tgz", - "integrity": "sha512-Mb50c58CPnuZ+qvM31DBa08tf9UumlTq1LkvpMoUpKfCuN05GZHTqCUwER3lxTSHLL0GZKghIPbYR/JQkINijQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/prismarine-nbt/-/prismarine-nbt-2.5.0.tgz", + "integrity": "sha512-F0/8UAa9SDDnAGrBYqZc4nG8h2zj5cE2eAJU5xlDR/IsQQ3moVxkOjE3h3nMv6SbvZrvAcgX7waA/nd9LLHYdA==", "dependencies": { "protodef": "^1.9.0" } @@ -5113,6 +5114,22 @@ "node": ">=14.15.1" } }, + "node_modules/urban-dictionary-client": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/urban-dictionary-client/-/urban-dictionary-client-3.1.0.tgz", + "integrity": "sha512-TGhBbhM7QzjFR+mRQ5k0AAoOZnUcTldAcpUNekXL9hH/GrOstRx1EyaBIbEE5RhM2oQGsY+TUBHPfB0M1JOi7w==", + "dependencies": { + "axios": "^0.21.1" + } + }, + "node_modules/urban-dictionary-client/node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index f0ff94b..0f721fe 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "dockerode": "^4.0.0", "dotenv": "^16.3.1", "isolated-vm": "^4.6.0", - "minecraft-data": "^3.49.1", - "minecraft-protocol": "^1.44.0", + "minecraft-data": "^3.53.0", + "minecraft-protocol": "^1.45.0", "minecraft-protocol-forge": "^1.0.0", "mineflayer": "^4.14.0", "mineflayer-cmd": "^1.1.3", @@ -25,6 +25,7 @@ "readline": "^1.3.0", "sharp": "^0.32.6", "urban-dictionary": "^3.0.2", + "urban-dictionary-client": "^3.1.0", "uuid-by-string": "^4.0.0", "vec3": "^0.1.8", "vm2": "^3.9.19",