Compare commits

..
7 Commits
79 changed files with 1731 additions and 13932 deletions
+75
View File
@@ -0,0 +1,75 @@
const mc = require('minecraft-protocol')
const { EventEmitter } = require('node:events')
const fs = require('fs')
const path = require('path')
const util = require('node:util')
function createBot(options = {}) {
const bot = new EventEmitter()
const rs = require('randomstring')
// Set some default values in options
let r = Math.floor(Math.random() * 255) + 1;
options.host ??= 'localhost'
options.username ??= 'Player' + Math.floor(Math.random() * 1000)
options.hideErrors ??= false // HACK: Hide errors by default as a lazy fix to console being spammed with them
bot.options = options
// Create our client object, put it on the bot, and register some events
bot.on('init_client', client => {
client.on('packet', (data, meta) => {
bot.emit('packet', data, meta)
bot.emit('packet.' + meta.name, data)
})
client.on('login', async function (data) {
bot.uuid = client.uuid
bot.username = client.username
bot.entityId = data.entityId
bot.host = bot.options.host
bot.port = bot.options.port
bot.buildstring = process.env['buildstring']
bot.fbs = process.env['FoundationBuildString']
})
client.on('end', reason => { bot.emit('end', reason)
try {
if (reason.text) {
if
}
}
})if
client.on('error', error => bot.emit('error', error), )
})
const buildstring = process.env['buildstring']
const client = options.client ?? mc.createClient(options)
bot._client = client
bot.emit('init_client', client)
bot.bots = options.bots ?? [bot]
// Modules
bot.loadModule = module => module(bot, options)
for (const filename of fs.readdirSync(path.join(__dirname, 'modules'))) {
try {
const module = require(path.join(__dirname, 'modules', filename))
bot.loadModule(module)
} catch (error) {
console.error('\x1b[0m\x1b[91m[ERROR]: \x1b[0m\x1b[90mFailed to load module', filename, ':', error)
}
}
return bot
}
// ABot username function mabe mabe
module.exports = createBot
-1
View File
@@ -1 +0,0 @@
.git
-11
View File
@@ -1,11 +0,0 @@
# chomens-bot-js
***(originally named chomens-bot-mc)***\
\
Archive of ChomeNS Bot Javascript source code.\
\
Some of the code are messy and hardcoded so you might wanna change some of it.\
\
Explore the code and see how it works!\
Also note that the core is broken sometimes.
R.I.P ChomeNS Bot Javascript
+1 -1
View File
@@ -1,5 +1,5 @@
const mc = require('minecraft-protocol')
const { EventEmitter } = require('events')
const { EventEmitter } = require('node:events')
const { loadPlugins } = require('./util/loadPlugins')
const util = require('node:util')
const randomstring = require('randomstring')
+1
View File
@@ -8,6 +8,7 @@ module.exports = {
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
bot.tellraw(selector, [{ 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 (bot, username, sender, prefix, args, channeldc, message, config) {
const Embed = new EmbedBuilder()
.setColor(config.discord.embedsColors.normal)
-92
View File
@@ -1,92 +0,0 @@
const randomstring = require('randomstring')
module.exports = {
version: '1.19.2',
prefixes: [
'3*',
'cbot3 ',
'/cbot3 '
],
commandsDir: '../commands', // this will be used by the commands.js in the plugins folder so it needs ../
proxy: {
enabled: false,
version: '1.10'
},
console: true,
chat: {
messageLength: 100
},
core: {
layers: 3,
refillInterval: 1000 * 60,
customName: [
{
text: 'https://doin-your.mom',
color: 'dark_red'
}
]
},
self_care: {
prefix: true,
op: true,
cspy: true,
vanish: true,
nickname: true,
socialspy: true,
gamemode: true,
mute: true,
endCredits: true
},
eval: {
serverUrl: 'http://localhost:4445/'
},
reconnectTimeout: 15000, // idk mabe
timeoutInterval: 1000 * 40,
self_care_check_interval: 2000,
discord: {
prefix: '!',
servers: {
'mc.opengamesllc.com:25565': '1152807355000565871',
'kaboom.pw:25565': '1152807462836109402',
'168.100.232.7:25565':'1155838188586283109',
},
embedsColors: {
normal: '#FFFF00',
error: '#FF0000'
}
},
servers: [
// logging means log to console
{
host: 'mc.opengamesllc.com',
port: 25565,
username: randomstring.generate(8),
kaboom: true,
logging: true,
useChat: false
},
{
host: '168.100.232.7',
port: 25565,
username: randomstring.generate(8),
kaboom: true,
logging: true,
useChat: false
},
{
host: 'kaboom.pw',
port: 25565,
username: randomstring.generate(8),
kaboom: true,
logging: true,
useChat: false
},
]
}
+10 -2
View File
@@ -1,11 +1,19 @@
class CommandSource {
constructor (player, sources, hash = false, discordMessageEvent = null, consoleOnly = sources) {
constructor (player, sources, hash, owner, discordMessageEvent = null, consoleOnly, name, profile, bot) {//this worked just fine in v4.3.4
//does it get defined in discord thingy wherever dat is
// sus
this.player = player
this.sources = sources
this.profile = bot
this.hash = hash
this.owner = owner
this.consoleOnly = consoleOnly
this.discordMessageEvent = discordMessageEvent
this.displayName = player
}
sendFeedback () {}
-4
View File
@@ -1,4 +0,0 @@
# FNFBoyfriendBot-V4.0
Final Build of v4.0 (v4.3.4) but not the final build of the Ultimate Foundation code base of FNFBoyfriendBot
-6802
View File
File diff suppressed because it is too large Load Diff
+40 -8
View File
@@ -6,7 +6,7 @@ const util = require('node:util')
console.log(`Starting ${process.env["buildstring"]} .......`)
console.log(`Foundation: ${process.env["FoundationBuildString"]}`)
console.log('this may take a few moments....')
require('events').EventEmitter.defaultMaxListeners = 20;
function createBot(options = {}) {
const bot = new EventEmitter()
const rs = require('randomstring')
@@ -17,7 +17,14 @@ const rs = require('randomstring')
options.hideErrors ??= false // HACK: Hide errors by default as a lazy fix to console being spammed with them
options.console ??= true
options.input ??= true
//options.logger ??= true
// MainPrefix: "~",
// SecondaryPrefix:'%',
//TertiaryPrefix:'@'
options.commands.MainPrefix ??= '!'
options.commands.SecondaryPrefix ??= '!'
options.commands.TertiaryPrefix ??= '!'
options.selfcare.unmuted ??= true
options.selfcare.vanished ??= true
@@ -36,7 +43,7 @@ options.input ??= true
options.Core.core ??= true
options.commands.prefix ??= '!'
options.discord.commandPrefix ??= '!'
@@ -70,21 +77,44 @@ options.input ??= true
bot.buildstring = process.env['buildstring']
bot.fbs = process.env['FoundationBuildString']
bot.version = bot.options.version
console.log(`Username: ${bot.username}`)
console.log(`Username: ${bot.options.username}`)
console.log(`Host: ${bot.options.host}:${bot.options.port}`)
console.log(`Minecraft java version: ${bot.options.version}`)
/* console.log(`Username: ${bot.username}`)
console.log(`Host: ${bot.host}:${bot.port}`)
console.log(`Minecraft java version: ${bot.version}`)
console.log(`Minecraft java version: ${bot.version}`)*/
})
//bot.visibility = false
//reason, fullReason
client.on('end', reason => { bot.emit('end', reason)
console.log(reason)
})
client.on('disconnect', reason => {
bot.emit('disconnect', reason)
console.log(reason)
})
client.on('kick_disconnect', reason => {
bot.emit('kick_disconnect', reason)
console.log(reason)
})
client.on('keep_alive', ({ keepAliveId }) => {
bot.emit('keep_alive', { keepAliveId })
// console.log(keepAliveId)
})
client.on('error', error => bot.emit('error', error), )
//client.end(reason, fullReason)
})
/*
bot._client.on('kick_disconnect', (data) => {
const parsed = JSON.parse(data.reason)
bot.end(parsed, 'kick_disconnect')
})
*/
const buildstring = process.env['buildstring']
const client = options.client ?? mc.createClient(options)
@@ -92,6 +122,8 @@ const buildstring = process.env['buildstring']
bot.emit('init_client', client)
bot.bots = options.bots ?? [bot]
//bot.setMaxListeners(Infinity)
//bot._client.setMaxListeners(Infinity)
// Modules
bot.loadModule = module => module(bot, options)
+5 -2
View File
@@ -1,4 +1,5 @@
function parseMessage (message, data, context) {
try{
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.emote' && message.translate !== '%s %s')) return
@@ -26,6 +27,8 @@ function parseMessage (message, data, context) {
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.log(e.stack)
}
module.exports = parseMessage
}
module.exports = parseMessage
+5 -2
View File
@@ -1,5 +1,6 @@
function parseMessage (message, data, context) {
if (message === null || typeof message !== 'object') return
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.text' && message.translate !== '%s %s')) return
@@ -26,6 +27,8 @@ function parseMessage (message, data, context) {
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.log(e.stack)
}
}
module.exports = parseMessage
+1 -1
View File
@@ -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
//
-52
View File
@@ -1,52 +0,0 @@
function inject (bot, options) {
bot.chatQueue = []
bot._chatQueue = []
const _chatQueueInterval = setInterval(() => {
if (bot.chatQueue.length !== 0) {
if (containsIllegalCharacters(bot.chatQueue[0])) {
bot.chatQueue.shift()
return
};
for (const subMessage of bot.chatQueue[0].split('\n')) {
if (!subMessage) return
let smallMsg
for (let i = 0; i < subMessage.length; i += config.chat.messageLength) {
smallMsg = subMessage.substring(i, i + config.chat.messageLength)
bot._chatQueue.push(smallMsg)
}
}
bot.chatQueue.shift()
}
}, 0)
const chatQueueInterval = setInterval(function () {
if (bot._chatQueue.length !== 0) {
if (bot._chatQueue[0].startsWith('/') && minecraftVersionToNumber(bot.version) >= 1.20) {
} else {
bot._client.chat(bot._chatQueue[0])
}
bot._chatQueue.shift()
}
}, 450)
bot.chat = (message) => {
bot.chatQueue.push(String(message))
}
bot.on('end', () => {
clearInterval(chatQueueInterval)
clearInterval(_chatQueueInterval)
})
function listener (packet) {
chatPacketListener(
packet,
bot,
minecraftVersionToNumber(bot.version) >= 1.20
)
}
}
module.exports = inject
+2 -2
View File
@@ -3,8 +3,8 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'botdevhistory',
description:['bots dev history'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
execute (context) {
const message = context.arguments.join(' ')
+2 -2
View File
@@ -195,8 +195,8 @@ const bots = [
module.exports = {
name: 'bots',
description:['shows a list of known bots'],
hashOnly:false,
consoleOnly:false,
aliases:['knownbots'],
trustLevel: 0,
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
const bot = context.bot
+45
View File
@@ -0,0 +1,45 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'botsrun',
description:[''],
aliases:[],
trustLevel: 2,
execute (context) {
const bot = context.bot
// const client = context.client
const args = context.arguments
const source = context.source
const message = context.arguments.join(' ')
//const source = context.source
// if (args.length === 0){
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
const amogus = args.slice(1).join(' ');
if (!args && !args[0] && !args[1] && !args[2]) return
try{
switch (args[1]) {
case 'source':
for (const eachBot of bot.bots) {
eachBot.commandManager.executeString(source, `${args.slice(2).join(' ')} `)
}
break
case 'consolesource':
for (const eachBot of bot.bots) {
eachBot.commandManager.executeString(bot.console.source, `${args.slice(2).join(' ')} `)
}
break
default:
context.source.sendError([ { text: 'Invalid action', color: 'dark_red', bold:false }])
source.sendFeedback({text:'Args are source and consolesource', color:'green'})
}
}catch(error){
source.sendFeedback(error.stack)
}
// context.source.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
}//
}
+3 -2
View File
@@ -3,12 +3,13 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'bruhify',
description:['bruhify text'],
hashOnly:false,
consoleOnly:false,
aliases:['bruhifytext', 'bruh'],
trustLevel: 0,
execute (context) {
const bot = context.bot
const args = context.arguments
const message = context.arguments.join(' ')
bot.bruhifyText = args.join(' ')
context.source.sendFeedback(JSON.stringify(bot.bruhifyText))
+2 -2
View File
@@ -2,8 +2,8 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'calculator',
description:['calculate maths'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['calc'],
execute (context) {
const bot = context.bot
const args = context.arguments
+30 -325
View File
@@ -1,336 +1,41 @@
const bots = [
{
name: { text: 'v0.1.0 - v0.5.0-beta', color: 'blue', bold:false },
authors: ['Prototypes'],
{//
name: { text: 'v5.0.0-Beta', color: 'blue', bold:false },
authors: ['Monochrome'],
foundation: '11/22/22 - 1/24/23',
exclaimer:'ehh nothing much just the release of the betas',
},
{
name: { text: 'v1.0.0-beta', color: 'blue', bold:false },
authors: ['in console test'],
foundation: '1/25/23',
exclaimer:'original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0 commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam ,gms ,stop,tntspam ,prefix ,annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze,crashserver,troll ,trol(more destructive),icu ,say,sudo,cloop',
},
{
name: { text: 'v1.0.0', color: 'dark_red', bold:false },
authors: ['FNFBoyfriendBot'],
foundation: '1/26/23',
exclaimer:'FNFBoyfriendBot. commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop, commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was) commands untested:prefix command Broke:icu,freeze,tntspam,entityspam,tntspam? changed name to &b &lFNFBoyfriendBot may change later idk',
},
{
name: { text: 'v1.0.1', color: 'green', bold:false },
authors: [''],
foundation: '1/26/23',
exclaimer:'reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command',
},
{
name: { text: 'v1.1.0', color: 'green', bold:false },
authors: [''],
foundation: '1/26/23 2:00pm',
exclaimer:'nothing much just added extra stuff to the troll, trol and that is about it',
},
{
name: { text: 'v1.2.0', color: 'green', bold:false },
authors: [''],
foundation: '1/28/23 1:51',
exclaimer:'for ppl me making me really mad -.- got released early',
},
{
name: { text: 'v2.0.0', color: 'dark_red', bold:false },
authors: ['Major'],
foundation: '2/07/23 8:01pm',
exclaimer:'added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead Reworked tntspam,entityspam,soundbreaker added Spim to the whitelist of the bot released too early than it was planned gonna be released due do the code almost leaked it had to be released early',
},
{
name: { text: 'v2.1.0', color: 'green', bold:false },
authors: [''],
foundation: '2/11/23 5:30pm',
exclaimer:'added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op) (had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted',
},
{
name: { text: 'v2.2.0', color: 'green', bold:false },
authors: [''],
foundation: '2/20/23',
exclaimer:'added ckill(added back after trial and error),serversuicidal changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime',
},
{
name: { text: 'v3.0.0-Beta', color: 'blue', bold:false },
authors: ['blue-balled corruption'],
foundation: '',
exclaimer:'was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks just finished the final build of the Creayun build of the bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the v3.0-beta well the beta for right now commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed commands removed:tpe and serverdeop??? reworked commands :say command for right now relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat',
},
{
name: { text: 'v3.0.0', color: 'dark_red', bold:false },
authors: ['Sky Remanifested'],
foundation: '',
exclaimer:'the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done Added: SelfCare Made during development:Relay chat prototypes for several servers',
},
{
name: { text: 'v3.0.5', color: 'green', bold:false },
authors: [''],
foundation: '',
exclaimer:'bug fixes',
},
{
name: { text: 'v3.0.9', color: 'green', bold:false },
authors: [''],
foundation: '',
exclaimer:'commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)',
},
{
name: { text: 'v3.3.0', color: 'dark_red', bold:false },
authors: [''],
foundation: '',
exclaimer:'switched it base to 4.0s base during 4.0s development',
},
{
name: { text: 'v4.0.0-beta', color: 'blue', bold:false },
authors: ['FNFBoyfriendBot Ultimate'],
foundation: '',
exclaimer:'all of the command removed and or rewriten from version 3.0.9 Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll (note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core CustomChats added:kaboom(for normal chat) (note that this is different and is not Modules)CommandModules Added:command_error,Command_source a beta release for rn',
},
{
name: { text: 'v4.0.0-Alpha ', color: 'aqua', bold:false },
authors: ['FNFBoyfriendBot Ultimate'],
foundation: '',
exclaimer:'Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr Commands Removed:Buyrealminecraft (note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console (note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat) added util with between(for urban) eval_colors(for evaljs)',
},
{
name: { text: 'v4.0.0', color: 'dark_red', bold:false },
authors: ['FNFBoyfriendBotX'],
foundation: '8/11/23',
exclaimer:'Bot is finished with the rewrite thank you ChipMC and chayapak for helping me rewrite the bot Heres the commands ban (mabe removing), blacklist (currently being worked on), botdevhistory, bots, calculator, changelog, ckill, cloop, cloopcrash(probably removing), core, crash, creators, discord, echo, errortest, evaljs, freeze, help, icu, list, meminfo, mineflayerbot, netmsg (Hello World!), ping (pong!), reconnect, say, selfdestruct, serversuicidal (probably removing because theres ckill), skin, sudo, test, tpr, trol (mabe renaming it to troll), troll (mabe removing it and replacing it with the trol command), urban (ong sus asf), validate, version',
},
{
name: { text: 'v4.0.5', color: 'green', bold:false },
authors: [''],
foundation: '8/17/23',
exclaimer:'bug fixes, did what i said i was gonna do in the last update',
},
{
name: { text: 'v4.0.6', color: 'green', bold:false },
authors: [''],
foundation: '8/22/23',
exclaimer:'added 1 console command along with updating console.js so that the bot sends a message to 1 server at a time and not a message to all the servers at a time',
},
{
name: { text: 'v4.0.7', color: 'green', bold:false },
authors: [''],
foundation: '9/4/23',
exclaimer:'merged server and botusername commands and naming the command logininfo cuz it now shows the server ip, server port, Minecraft java Version, and the Bots Username',
},
{
name: { text: 'v4.0.8', color: 'green', bold:false },
authors: [''],
foundation: '9/7/23',
exclaimer:'added the wiki command even though its semi working. bug fixes. some bugs still in the bot is netmsg showing the bots username when i used the netmsg cmd from my end and not the console i find it funny asf though',
},
{
name: { text: 'v4.0.8A', color: 'gold', bold:false },
authors: [''],
foundation: '9/7/23',
exclaimer:'added some things to the changelog cmd. still needing to fix the issue with custom chat and netmsg also added a bugs command to check what bugs are needing to be fixed',
},
{
name: { text: 'v4.0.8B', color: 'gold', bold:false },
authors: [''],
foundation: '9/8/23',
exclaimer:'made it to where it sends more messages on start up and made it to where the buildstring is in secrets',
},
{
name: { text: 'v4.0.8C', color: 'gold', bold:false },
authors: [''],
foundation: '9/14/23',
exclaimer:'added the nodejs version to the version command but thats about it still fixing the bugs with the relay chat and mabe rewriting the validation system in the bot',
},
{
name: { text: 'v4.0.8D', color: 'gold', bold:false },
authors: [''],
foundation: '9/16/23',
exclaimer:'added onto the changelog command along with adding spambot and lol commands (cuz yes) along with removing the bugs command maybe adding it back sometime later also the discord relay chat and validation system mabe getting a rewrite and also updated node from v18 to v20.6.0',
},
{
name: { text: 'v4.0.8E', color: 'gold', bold:false },
authors: [''],
foundation: '9/17/23',
exclaimer:'changed the name for meminfo to serverinfo along with adding onto it and moving the nodejs, node-minecraft-protocol, and discord.js versions from the version command to the serverinfo command',
},
{
name: { text: 'v4.0.8F', color: 'gold', bold:false },
authors: [''],
foundation: '9/24/23',
exclaimer:'added filesdirectories command but thats about it',
},
{
name: { text: 'v4.0.9', color: 'green', bold:false },
authors: [''],
foundation: '9/26/23',
exclaimer:'added a hover event to the custom chat for the bot',
},
{
name: { text: 'v4.1.0', color: 'green', bold:false },
authors: [''],
foundation: '9/27/23',
exclaimer:'Finally changed how the validation/hashing works in the bot instead of it being sent in discord there will be a key for trusted to validate',
},
{
name: { text: 'v4.1.1', color: 'green', bold:false },
authors: [''],
foundation: '9/28/23',
exclaimer:'added uppercase and lowercase function for commands and soon gonna be completely overhauling the validation system in the bot again',
},
{
name: { text: 'v4.1.2', color: 'green', bold:false },
authors: [''],
foundation: '10/02/23',
exclaimer:'added uptime as a command but thats it',
},
{
name: { text: 'v4.1.4', color: 'green', bold:false },
authors: [''],
foundation: '10/03/23',
exclaimer:'moved the custom chat text and cmd block text to config.js',
},
{
name: { text: 'v4.1.6', color: 'green', bold:false },
authors: [''],
foundation: '10/08/23',
exclaimer:'fixed the relay chat and fixed the cr issue with urban and also fixed reconnect',
},
{
name: { text: 'v4.1.7', color: 'green', bold:false },
authors: [''],
foundation: '10/08/03',
exclaimer:'added mute, tag, and skin to selfcare',
}, // am I even gonna be credited?
{
name: { text: 'v4.1.8', color: 'green', bold:false },
authors: [''],//cai cee mmm deee sus
foundation: '10/11/23',
exclaimer:'fixed the issue with memused cee mmm dee',
},
{//
name: { text: 'v4.1.9', color: 'green', bold:false },
authors: [''],
foundation: '10/12/23',
exclaimer:'rewrote evaljs its now using isolated-vm and not vm2',
},
{//
name: { text: 'v4.2.0-restore', color: 'green', bold:false },
authors: [''],
foundation: '10/19/23',
exclaimer:'fixed the disconnect message for discord and the bug with the say command',
},
{//
name: { text: 'v4.2.1', color: 'green', bold:false },
authors: [''],
foundation: '10/24/23',
exclaimer:'rewrote the help command to allow descriptions finally along with adding things to the base of the bot for the descriptions',
},
{//
name: { text: 'v4.2.2', color: 'green', bold:false },
authors: [''],
foundation: '10/25/23',
exclaimer:'merged serverinfo, memused, discord, logininfo, creators, version, uptime together',
},
{//
name: { text: 'v4.2.3', color: 'green', bold:false },
authors: [''],
foundation: '10/30/23',
exclaimer:'added a antiskid measure (thanks _yfd)',
},
{//
name: { text: 'v4.2.4', color: 'green', bold:false },
authors: ['Spooky update (note: might as well give it a codename since its halloween)'],
foundation: '10/31/23',
exclaimer:'merged fard and reconnect together making recend, added more crash methods to the crash command, and remove 12 commands',
},
{//
name: { text: 'v4.2.5', color: 'green', bold:false },
authors: [''],
foundation: '11/8/23',
exclaimer:'patched the exploit in the discordmsg command and made it to were with the netmsg command players cannot send empty messages',
},
{//
name: { text: 'v4.3.0', color: 'green', bold:false },
authors: [''],
foundation: '11/16/23',
exclaimer:`color coded the console logs are LOGS in the color gold consoleserver are in the category INFO in the color green, errors after start up are in the category WARN in the color yellow, Fatal Errors/start-up errors are in the category ERROR in the color red and hashs/validation codes sent to console are in the category HASH in the color green. added the command servereval. changed config.json to config.js and moved the username() function from the end of bot.js to the end of config.js and replacing where username() after options.username with 'Player' + Math.floor(Math.random() * 1000) and added player ping/latency to list along with fixing the bug with cloop list`,
},
{//
name: { text: 'v4.3.1', color: 'green', bold:false },
authors: [''],
foundation: '11/21/23 one day till the bots anniversary?!?!',
exclaimer:'modified the bots boot originally it would spam the bots buildstring each time it logged into a server on boot but now it will only send it once to console on boot along with it now sending the foundationbuildstring after the buildstring sent in console. ported some commands over since chomens is pretty much dead along with adding chat support for chat.type.text and chat.type.emote',
},
{//
name: { text: 'v4.3.2', color: 'green', bold:false },
authors: [''],
foundation: '11/23/23',
exclaimer:'made the bots selfcare, the selfcares interval and console toggle-able along with making default options for the selfcare and its interval, the bots prefix, the bots discord prefix, the reconnectDelay interval, the core customname, and the console, partically fixed the issue with the trusted commands no being able to be ran in discord, edited the bots boot again it now also logs the amount of files its loading on boot its discord username its logged in with(also added the discord username to the info command)',
foundation: '12/18/23',
exclaimer:'added owner validation to the bot thats about it',
},
{//
name: { text: 'v4.3.3', color: 'dark_red', bold:false },
authors: ["Lullaby Girlfriend's LostCause"],
name: { text: 'v5.0.0', color: 'dark_red', bold:false },
authors: ['Monochrome'],
foundation: '12/3/23',
exclaimer:'added hover events to the help command for command descriptions, trust console and name along with click events for them added memusage and fixed the category issue with the console and added toggles to the bot for console, selfcare, and skin',
foundation: '12/20/23',
exclaimer:'since the old validation system was able to barely handle owner validation it was completely remove and replaced with trust levels which handle validation way better also added command aliases (shoutouts to poopbob with the command aliases). made a whole new changelog command for v5.0.0 and renamed the old one changelogv4.3.4. also fixed the issue with the console not properly refreshing lines that are sent',
},
{//
name: { text: 'v4.3.4', color: 'dark_red', bold:false },
authors: ['Suffering Siblings'],
name: { text: 'v5.0.1', color: 'green', bold:false },
authors: [''],
foundation: '12/12/23',
exclaimer:'overhauled the console and discord relay chat fixing trusted roles and making the selfcare toggleable in game also fixing the issue with hiding console only commands (thank you poopbob for helping me with that)',
foundation: 'added botsrun for the funni along with making the bot be able to auto refill its core now and fill the core from a command block(edit: nevermind its very buggy reverting it back to how it originally filled its core) and adding a hover event to netmsg along with having the test command tellraw the players display name in the command and added support for 3 command prefixes',
exclaimer:'12/23/23',
},
]//§4Lullaby §cGirlfriend's §cLost§bCause
{//
name: { text: 'v5.0.2', color: 'green', bold:false },
authors: [''],
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
@@ -344,8 +49,8 @@ const bots = [
module.exports = {
name: 'changelog',
description:['check the bots changelog'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['cl', 'changes'],
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
+409
View File
@@ -0,0 +1,409 @@
const bots = [
{
name: { text: 'v0.1.0 - v0.5.0-beta', color: 'blue', bold:false },
authors: ['Prototypes'],
foundation: '11/22/22 - 1/24/23',
exclaimer:'ehh nothing much just the release of the betas',
},
{
name: { text: 'v1.0.0-beta', color: 'blue', bold:false },
authors: ['in console test'],
foundation: '1/25/23',
exclaimer:'original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0 commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam ,gms ,stop,tntspam ,prefix ,annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze,crashserver,troll ,trol(more destructive),icu ,say,sudo,cloop',
},
{
name: { text: 'v1.0.0', color: 'dark_red', bold:false },
authors: ['FNFBoyfriendBot'],
foundation: '1/26/23',
exclaimer:'FNFBoyfriendBot. commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop, commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was) commands untested:prefix command Broke:icu,freeze,tntspam,entityspam,tntspam? changed name to &b &lFNFBoyfriendBot may change later idk',
},
{
name: { text: 'v1.0.1', color: 'green', bold:false },
authors: [''],
foundation: '1/26/23',
exclaimer:'reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command',
},
{
name: { text: 'v1.1.0', color: 'green', bold:false },
authors: [''],
foundation: '1/26/23 2:00pm',
exclaimer:'nothing much just added extra stuff to the troll, trol and that is about it',
},
{
name: { text: 'v1.2.0', color: 'green', bold:false },
authors: [''],
foundation: '1/28/23 1:51',
exclaimer:'for ppl me making me really mad -.- got released early',
},
{
name: { text: 'v2.0.0', color: 'dark_red', bold:false },
authors: ['Major'],
foundation: '2/07/23 8:01pm',
exclaimer:'added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead Reworked tntspam,entityspam,soundbreaker added Spim to the whitelist of the bot released too early than it was planned gonna be released due do the code almost leaked it had to be released early',
},
{
name: { text: 'v2.1.0', color: 'green', bold:false },
authors: [''],
foundation: '2/11/23 5:30pm',
exclaimer:'added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op) (had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted',
},
{
name: { text: 'v2.2.0', color: 'green', bold:false },
authors: [''],
foundation: '2/20/23',
exclaimer:'added ckill(added back after trial and error),serversuicidal changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime',
},
{
name: { text: 'v3.0.0-Beta', color: 'blue', bold:false },
authors: ['blue-balled corruption'],
foundation: '',
exclaimer:'was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks just finished the final build of the Creayun build of the bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the v3.0-beta well the beta for right now commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed commands removed:tpe and serverdeop??? reworked commands :say command for right now relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat',
},
{
name: { text: 'v3.0.0', color: 'dark_red', bold:false },
authors: ['Sky Remanifested'],
foundation: '',
exclaimer:'the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done Added: SelfCare Made during development:Relay chat prototypes for several servers',
},
{
name: { text: 'v3.0.5', color: 'green', bold:false },
authors: [''],
foundation: '',
exclaimer:'bug fixes',
},
{
name: { text: 'v3.0.9', color: 'green', bold:false },
authors: [''],
foundation: '',
exclaimer:'commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)',
},
{
name: { text: 'v3.3.0', color: 'dark_red', bold:false },
authors: [''],
foundation: '',
exclaimer:'switched it base to 4.0s base during 4.0s development',
},
{
name: { text: 'v4.0.0-beta', color: 'blue', bold:false },
authors: ['FNFBoyfriendBot Ultimate'],
foundation: '',
exclaimer:'all of the command removed and or rewriten from version 3.0.9 Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll (note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core CustomChats added:kaboom(for normal chat) (note that this is different and is not Modules)CommandModules Added:command_error,Command_source a beta release for rn',
},
{
name: { text: 'v4.0.0-Alpha ', color: 'aqua', bold:false },
authors: ['FNFBoyfriendBot Ultimate'],
foundation: '',
exclaimer:'Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr Commands Removed:Buyrealminecraft (note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console (note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat) added util with between(for urban) eval_colors(for evaljs)',
},
{
name: { text: 'v4.0.0', color: 'dark_red', bold:false },
authors: ['FNFBoyfriendBotX'],
foundation: '8/11/23',
exclaimer:'Bot is finished with the rewrite thank you ChipMC and chayapak for helping me rewrite the bot Heres the commands ban (mabe removing), blacklist (currently being worked on), botdevhistory, bots, calculator, changelog, ckill, cloop, cloopcrash(probably removing), core, crash, creators, discord, echo, errortest, evaljs, freeze, help, icu, list, meminfo, mineflayerbot, netmsg (Hello World!), ping (pong!), reconnect, say, selfdestruct, serversuicidal (probably removing because theres ckill), skin, sudo, test, tpr, trol (mabe renaming it to troll), troll (mabe removing it and replacing it with the trol command), urban (ong sus asf), validate, version',
},
{
name: { text: 'v4.0.5', color: 'green', bold:false },
authors: [''],
foundation: '8/17/23',
exclaimer:'bug fixes, did what i said i was gonna do in the last update',
},
{
name: { text: 'v4.0.6', color: 'green', bold:false },
authors: [''],
foundation: '8/22/23',
exclaimer:'added 1 console command along with updating console.js so that the bot sends a message to 1 server at a time and not a message to all the servers at a time',
},
{
name: { text: 'v4.0.7', color: 'green', bold:false },
authors: [''],
foundation: '9/4/23',
exclaimer:'merged server and botusername commands and naming the command logininfo cuz it now shows the server ip, server port, Minecraft java Version, and the Bots Username',
},
{
name: { text: 'v4.0.8', color: 'green', bold:false },
authors: [''],
foundation: '9/7/23',
exclaimer:'added the wiki command even though its semi working. bug fixes. some bugs still in the bot is netmsg showing the bots username when i used the netmsg cmd from my end and not the console i find it funny asf though',
},
{
name: { text: 'v4.0.8A', color: 'gold', bold:false },
authors: [''],
foundation: '9/7/23',
exclaimer:'added some things to the changelog cmd. still needing to fix the issue with custom chat and netmsg also added a bugs command to check what bugs are needing to be fixed',
},
{
name: { text: 'v4.0.8B', color: 'gold', bold:false },
authors: [''],
foundation: '9/8/23',
exclaimer:'made it to where it sends more messages on start up and made it to where the buildstring is in secrets',
},
{
name: { text: 'v4.0.8C', color: 'gold', bold:false },
authors: [''],
foundation: '9/14/23',
exclaimer:'added the nodejs version to the version command but thats about it still fixing the bugs with the relay chat and mabe rewriting the validation system in the bot',
},
{
name: { text: 'v4.0.8D', color: 'gold', bold:false },
authors: [''],
foundation: '9/16/23',
exclaimer:'added onto the changelog command along with adding spambot and lol commands (cuz yes) along with removing the bugs command maybe adding it back sometime later also the discord relay chat and validation system mabe getting a rewrite and also updated node from v18 to v20.6.0',
},
{
name: { text: 'v4.0.8E', color: 'gold', bold:false },
authors: [''],
foundation: '9/17/23',
exclaimer:'changed the name for meminfo to serverinfo along with adding onto it and moving the nodejs, node-minecraft-protocol, and discord.js versions from the version command to the serverinfo command',
},
{
name: { text: 'v4.0.8F', color: 'gold', bold:false },
authors: [''],
foundation: '9/24/23',
exclaimer:'added filesdirectories command but thats about it',
},
{
name: { text: 'v4.0.9', color: 'green', bold:false },
authors: [''],
foundation: '9/26/23',
exclaimer:'added a hover event to the custom chat for the bot',
},
{
name: { text: 'v4.1.0', color: 'green', bold:false },
authors: [''],
foundation: '9/27/23',
exclaimer:'Finally changed how the validation/hashing works in the bot instead of it being sent in discord there will be a key for trusted to validate',
},
{
name: { text: 'v4.1.1', color: 'green', bold:false },
authors: [''],
foundation: '9/28/23',
exclaimer:'added uppercase and lowercase function for commands and soon gonna be completely overhauling the validation system in the bot again',
},
{
name: { text: 'v4.1.2', color: 'green', bold:false },
authors: [''],
foundation: '10/02/23',
exclaimer:'added uptime as a command but thats it',
},
{
name: { text: 'v4.1.4', color: 'green', bold:false },
authors: [''],
foundation: '10/03/23',
exclaimer:'moved the custom chat text and cmd block text to config.js',
},
{
name: { text: 'v4.1.6', color: 'green', bold:false },
authors: [''],
foundation: '10/08/23',
exclaimer:'fixed the relay chat and fixed the cr issue with urban and also fixed reconnect',
},
{
name: { text: 'v4.1.7', color: 'green', bold:false },
authors: [''],
foundation: '10/08/03',
exclaimer:'added mute, tag, and skin to selfcare',
}, // am I even gonna be credited?
{
name: { text: 'v4.1.8', color: 'green', bold:false },
authors: [''],//cai cee mmm deee sus
foundation: '10/11/23',
exclaimer:'fixed the issue with memused cee mmm dee',
},
{//
name: { text: 'v4.1.9', color: 'green', bold:false },
authors: [''],
foundation: '10/12/23',
exclaimer:'rewrote evaljs its now using isolated-vm and not vm2',
},
{//
name: { text: 'v4.2.0-restore', color: 'green', bold:false },
authors: [''],
foundation: '10/19/23',
exclaimer:'fixed the disconnect message for discord and the bug with the say command',
},
{//
name: { text: 'v4.2.1', color: 'green', bold:false },
authors: [''],
foundation: '10/24/23',
exclaimer:'rewrote the help command to allow descriptions finally along with adding things to the base of the bot for the descriptions',
},
{//
name: { text: 'v4.2.2', color: 'green', bold:false },
authors: [''],
foundation: '10/25/23',
exclaimer:'merged serverinfo, memused, discord, logininfo, creators, version, uptime together',
},
{//
name: { text: 'v4.2.3', color: 'green', bold:false },
authors: [''],
foundation: '10/30/23',
exclaimer:'added a antiskid measure (thanks _yfd)',
},
{//
name: { text: 'v4.2.4', color: 'green', bold:false },
authors: ['Spooky update (note: might as well give it a codename since its halloween)'],
foundation: '10/31/23',
exclaimer:'merged fard and reconnect together making recend, added more crash methods to the crash command, and remove 12 commands',
},
{//
name: { text: 'v4.2.5', color: 'green', bold:false },
authors: [''],
foundation: '11/8/23',
exclaimer:'patched the exploit in the discordmsg command and made it to were with the netmsg command players cannot send empty messages',
},
{//
name: { text: 'v4.3.0', color: 'green', bold:false },
authors: [''],
foundation: '11/16/23',
exclaimer:`color coded the console logs are LOGS in the color gold consoleserver are in the category INFO in the color green, errors after start up are in the category WARN in the color yellow, Fatal Errors/start-up errors are in the category ERROR in the color red and hashs/validation codes sent to console are in the category HASH in the color green. added the command servereval. changed config.json to config.js and moved the username() function from the end of bot.js to the end of config.js and replacing where username() after options.username with 'Player' + Math.floor(Math.random() * 1000) and added player ping/latency to list along with fixing the bug with cloop list`,
},
{//
name: { text: 'v4.3.1', color: 'green', bold:false },
authors: [''],
foundation: '11/21/23 one day till the bots anniversary?!?!',
exclaimer:'modified the bots boot originally it would spam the bots buildstring each time it logged into a server on boot but now it will only send it once to console on boot along with it now sending the foundationbuildstring after the buildstring sent in console. ported some commands over since chomens is pretty much dead along with adding chat support for chat.type.text and chat.type.emote',
},
{//
name: { text: 'v4.3.2', color: 'green', bold:false },
authors: [''],
foundation: '11/23/23',
exclaimer:'made the bots selfcare, the selfcares interval and console toggle-able along with making default options for the selfcare and its interval, the bots prefix, the bots discord prefix, the reconnectDelay interval, the core customname, and the console, partically fixed the issue with the trusted commands no being able to be ran in discord, edited the bots boot again it now also logs the amount of files its loading on boot its discord username its logged in with(also added the discord username to the info command)',
},
{//
name: { text: 'v4.3.3', color: 'dark_red', bold:false },
authors: ["Lullaby Girlfriend's LostCause"],
foundation: '12/3/23',
exclaimer:'added hover events to the help command for command descriptions, trust console and name along with click events for them added memusage and fixed the category issue with the console and added toggles to the bot for console, selfcare, and skin',
},
{//
name: { text: 'v4.3.4', color: 'dark_red', bold:false },
authors: ['Suffering Siblings'],
foundation: '12/12/23',
exclaimer:'overhauled the console and discord relay chat fixing trusted roles and making the selfcare toggleable in game also fixing the issue with hiding console only commands (thank you poopbob for helping me with that)',
},
]//§4Lullaby §cGirlfriend's §cLost§bCause
//back
/*{//
name: { text: '', color: 'gray', bold:false },
authors: [''],
foundation: '',
exclaimer:'',
},*/
module.exports = {
name: 'changelogv4.3.4',
description:['check the bots changelog'],
trustLevel: 0,
aliases:['clv4.3.4', 'changesv4.3.4'],
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
if (query.length === 0) {
const list = []
for (const info of bots) {
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
list.push(info.name)
}
const category = {
translate: ' (%s%s%s%s%s%s%s%s%s) ',
bold: false,
color: 'white',
with: [
{ color: 'aqua', text: 'Alpha Release'},
{ color: 'white', text: ' | '},
{ color: 'blue', text: 'Beta Release'},
{ color: 'white', text: ' | '},
{ color: 'green', text: 'Minor release'},
{ color: 'white', text: ' | '},
{ color: 'gold', text: 'Revision Release'},
{ color: 'white', text: ' | '},
{ color: 'dark_red', text: 'Major Release'},
]
}
context.source.sendFeedback(['Changelogs (', bots.length, ')', category, ' - ', ...list], false)
return
}
for (const info of bots) {
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
}
},
sendBotInfo (info, bot) {
const component = ['']
component.push('', info.name)
if (info.exclaimer) component.push('\n', ' ', info.exclaimer)
if (info.authors && info.authors.length !== 0) {
component.push('\n', 'Codename ')
for (const author of info.authors) {
component.push(author, { text: ', ', color: 'gray' })
}
component.pop()
}
if (info.foundation) component.push('\n', 'Date: ', info.foundation)
if (info.prefixes && info.prefixes.length !== 0) {
component.push('\n', '')
for (const prefix of info.prefixes) {
component.push(prefix, { text: ' ', color: 'gray' })
}
component.pop()
}
bot.tellraw([component])
}
}//it doing it just for the ones i added lol
// prob a replit moment, it probably thinks there are regexes in the strings
+8 -2
View File
@@ -1,13 +1,19 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cloop',
hashOnly: true,
consoleOnly:false,
//hashOnly: true,
// consoleOnly:false,
// ownerOnly:false,
trustLevel: 1,
description:['command loop commands, the args are add, remove, clear, and list'],
aliases:['commandloop'],
execute (context, selector) {
const args = context.arguments
const bot = context.bot
const source = context.source
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
// throw new CommandError('temp disabled')
switch (selector, args[1]) {
case 'add':
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
+1 -2
View File
@@ -3,8 +3,7 @@ const buildstring = process.env['buildstring']
const foundation = process.env['FoundationBuildString']
module.exports = {
name: 'console',
consoleOnly:true,
hashOnly:true,
trustLevel: 3,
description:['no :)'],
// description:['make me say something in custom chat'],
execute (context) {
+10 -7
View File
@@ -1,18 +1,21 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'consoleserver',
consoleOnly: true,
hashOnly:true,
trustLevel: 3,
description:['consoleserver'],
aliases:['csvr'],
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
const servers = bot.bots.map(eachBot => eachBot.options.host)
const ports = bot.bots.map(eachBot => eachBot.options.port)
for (const eachBot of bot.bots) {
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
for (const eachBot of bot.bots) {
if (args.join(' ').toLowerCase() === 'all') {
@@ -27,16 +30,16 @@ const ports = bot.bots.map(eachBot => eachBot.options.port)
}//.repeat(Math.floor((32767 - 22) / 16))
//"a".repeat(10)
const server = servers.find(server => server.toLowerCase().includes(args.join(' ')))
//const port = ports.find(port => port.toLowerCase().includes(args.join(' ')))
if (!server /*&& !port*/) {
const server = servers.find(server => server.toLowerCase().includes(args[0]))
if (!server) {
source.sendFeedback({ text: 'Invalid server', color: 'red' })
return
}
bot.console.info(`Set the console server to ` + server)
eachBot.console.consoleServer = server
eachBot.console.consoleServer = server
// eachBot.console.consoleServer = port
}
+10 -3
View File
@@ -3,12 +3,19 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'core',
description:['make me run a command in core'],
hashOnly:false,
consoleOnly:false,
aliases:['cb','corerun','run','commandblockrun','cbrun'],
trustLevel: 0,
execute (context) {
const bot = context.bot
const client = context.client
// const client = context.client
const args = context.arguments
const source = context.source
const message = context.arguments.join(' ')
// if (args.length === 0){
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
if (args[0] === undefined){
source.sendFeedback({translate:"Too few Arguments!", color:"red"})
}
if (message.startsWith('/')) {
bot.core.run(message.substring(1))
return
+3 -3
View File
@@ -3,8 +3,8 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cowsay',
description:['mooooo'],
hashOnly:false,
consoleOnly:false,
aliases:['cws', 'cow'],
trustLevel: 0,
execute (context, selector) {
const bot = context.bot
const args = context.arguments
@@ -13,7 +13,7 @@ module.exports = {
const source = context.source
const cowsay = require('cowsay2')
const cows = require('cowsay2/cows')
if (args[0] === 'list') {
if (args[0].toLowerCase() === 'list') {
const listed = Object.keys(cows)
let primary = true
+3 -2
View File
@@ -3,11 +3,12 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'crash',
description:['crashes a server'],
hashOnly: true,
consoleOnly:false,
trustLevel: 1,
aliases:['crashserver', '69'],//69 cuz yes
execute (context) {
const bot = context.bot
// throw new CommandError('temp disabled')
const args = context.arguments
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
+2 -2
View File
@@ -3,8 +3,8 @@ const CommandError = require("../CommandModules/command_error")
module.exports = {
name: 'discordmsg',
description:['make me say something in discord'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['discordmessage', 'ddmsg'],
execute (context) {
//const args = context.args
const bot = context.bot
+2 -2
View File
@@ -1,8 +1,8 @@
module.exports = {
name: 'echo',
description:['make me say something in chat'],
hashOnly:false,
consoleOnly:false,
aliases:['chatsay'],
trustLevel: 0,
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
+18
View File
@@ -0,0 +1,18 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'end',
description:['/kill the bot or make it /suicide'],
trustLevel: 1,
aliases:['kys','kill','suicide'],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
const source = context.source
source.sendFeedback(`${bot.username} fell out of the world`)
process.exit('amongus')
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
+2 -2
View File
@@ -3,8 +3,8 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'errortest',
description:['test errors'],
hashOnly:false,
consoleOnly:false,
aliases:['error', 'errtest', 'errtst'],
trustLevel: 0,
execute (context) {
const message = context.arguments.join(' ')
//context.source.sendFeedback('hint hover your mouse over the error')
+3 -2
View File
@@ -6,8 +6,8 @@ const { stylize } = require('../util/eval_colors')
module.exports = {
name: 'evaljs',
hashOnly:true,
consoleOnly:false,// vm owners please dont get mad at me ;-;
trustLevel: 1,
aliases:['evaljsisolatedvm', 'evaljsnew', 'evaljsivm', 'eval', 'evalivm', 'evalisolatedvm', 'evaljsnew'],
description:['run code in a vm note: amcforum members had a sh##fit over this command'],
async execute (context) {
const bot = context.bot
@@ -22,6 +22,7 @@ hashOnly:true,
{ color: 'dark_green', text: 'EvalJS'},
]
}
// throw new CommandError('temp disabled')
/* bot.tellraw(selector, { text: util.inspect(bot.vm.run(args.slice(1).join(' ')), { stylize }).substring(0, 32000) })
} catch (err) {
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
+3 -2
View File
@@ -9,9 +9,9 @@ let vm = new VM(options)
module.exports = {
name: 'evaljsvm2',
hashOnly:true,
consoleOnly:false,
trustLevel: 1,
description:['old evaljs code'],
aliases:['evaljsold', 'evalvm2', 'evalold'],
execute (context) {
const source = context.source
const args = context.arguments
@@ -23,6 +23,7 @@ hashOnly:true,
{ color: 'dark_green', text: 'EvalJS Cmd'},
]
}
// throw new CommandError('temp disabled')
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (args[1]) {
case 'run':
+2 -3
View File
@@ -2,11 +2,10 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'filter',
hashOnly: true,
consoleOnly:false,
trustLevel: 1,
description:['filter players (not functional)'],
execute (context) {
//throw new CommandError('temp disabled')
const target = context.arguments.join(' ')
const bot = context.bot
+3 -3
View File
@@ -1,9 +1,9 @@
const crypto = require('crypto')
module.exports = {
name: 'val',
name: 'botval',
consoleOnly: true,
trustLevel: 3,
execute (context) {
const bot = context.bot
@@ -12,7 +12,7 @@ module.exports = {
const args = context.arguments
const key = process.env['FNFBoyfriendBot_key']
const key = process.env['FNFBoyfriendBot_Owner_key']
//al
const time = Math.floor(Date.now() / 11000)
+84 -44
View File
@@ -2,10 +2,9 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'help',
aliases:['heko'],
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
description:['shows the command list'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
async execute (context) {
const bot = context.bot
const commandList = []
@@ -37,18 +36,26 @@ module.exports = {
for (const fard in bot.commandManager.amogus) { // i broke a key woops
const command = bot.commandManager.amogus[fard]
if (args[0].toLowerCase() === command.name) {
if (args[0].toLowerCase() === command.name )
// if (args[0].toLowerCase() === command.aliases)
{//text:`Trust Level: `,color:'white'},
//{text:`${command.trustLevel}\n`,color:'red'},
valid = true
source.sendFeedback([cmd, `Description: ${command.description}`])
source.sendFeedback([cmd, {text:`Trust Level: ${command.trustLevel}`}])
source.sendFeedback([cmd, `aliases: ${command.aliases}`])
break
} else valid = false
}//source is defined btw
}
//source is defined btw
//source.sendFeedback([cmd, 'This command is ' + valid + ' to this for loop'])
if (valid) {
} else {
const args = context.arguments
source.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`, with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help`, color:'red' } : undefined}])
source.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.MainPrefix}help" for help or click on this for the command`,color:'red', with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.MainPrefix}help` } : undefined}])
// bot.tellraw([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`, with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help`, color:'red' } : undefined}])
}//i will add the descriptions reading as tests and action add the descriptions for the commands after
const length = context.bot.commandManager.amogus.length // ok
@@ -62,13 +69,13 @@ module.exports = {
let cons_ole = []
for (const fard in bot.commandManager.amogus) {
const command = bot.commandManager.amogus[fard]
if (command.hashOnly) {
// if (command.consoleOnly == true) return console.log(command);
if(command.consoleOnly) {
if(command.trustLevel === 3) {
cons_ole.push(
{
text: command.name + ' ',
color: 'red',
color: 'blue',
translate:"",
@@ -85,13 +92,49 @@ module.exports = {
{text:'consoleOnly:',color:'white'},
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
{text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
}
}
)// copypasted from below, and removed stuff that wont work in the console
}
else {
}
else
if (command.trustLevel === 2) {
own_her.push(
{
text: command.name + ' ',
color: 'dark_red',
translate:"",
hoverEvent:{
action:"show_text",
value:[
{
text:`Command:${command.name}\n`,
color:'white'
}, {text:`Trust Level: `,color:'white'},
{text:`${command.trustLevel}\n`,color:'dark_red'},
{text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
},clickEvent:{
action:"run_command",value:`${bot.options.commands.MainPrefix}${command.name}`
},
// ${command.name}\nhashOnly:§c${command.hashOnly}§r\nconsoleOnly:§c${command.consoleOnly && !context.console}§r\n${command.description}
///tellraw @a {"translate":"","hoverEvent":{"action":"show_text","value":[{"text":""},{"text":""}]},"clickEvent":{"action":"run_command","value":"a"}}
clickEvent: command.name ? { action: 'suggest_command', value: `~${command.name}` } : undefined,
}
)//my w
}
// let valid
else if (command.trustLevel === 1){
t_rust.push(
{
text: command.name + ' ',
@@ -105,28 +148,25 @@ module.exports = {
{
text:`Command:${command.name}\n`,
color:'white'
},{
text:"HashOnly:",
color:'white'},
{text:`${command.hashOnly}\n`,color:'red'},
{text:'consoleOnly:',color:'white'},
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
{text:`${command.description}\n`, color:'white'},
}, {text:`Trust Level: `,color:'white'},
{text:`${command.trustLevel}\n`,color:'red'}, {text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
},clickEvent:{
action:"run_command",value:`${bot.options.commands.prefix}${command.name}`
action:"run_command",value:`${bot.options.commands.MainPrefix}${command.name}`
},
// ${command.name}\nhashOnly:§c${command.hashOnly}§r\nconsoleOnly:§c${command.consoleOnly && !context.console}§r\n${command.description}
///tellraw @a {"translate":"","hoverEvent":{"action":"show_text","value":[{"text":""},{"text":""}]},"clickEvent":{"action":"run_command","value":"a"}}
clickEvent: command.name ? { action: 'suggest_command', value: `~${command.name}` } : undefined,
// clickEvent: command.name ? { action: 'suggest_command', value: `~${command.name}` },
}
)//my w
}
} else {
//if (command.consoleOnly) return;
pub_lick.push(
)
//my w
}
else if (command.trustLevel === 0){
pub_lick.push(
{
text: command.name + ' ',
color: 'green',
@@ -138,21 +178,20 @@ module.exports = {
text:`Command:${command.name}\n`,
color:'white'
},{
text:"HashOnly:",
color:'white'},
{text:`${command.hashOnly}\n`,color:'red'},
{text:'consoleOnly:',color:'white'},
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
text:`Trust Level: `,color:'white'},
{text:`${command.trustLevel}\n`,color:'red'},
{text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
},clickEvent:{
action:"suggest_command",value:`${bot.options.commands.prefix}${command.name}`
},
}
)
} //{command.consoleOnly && !source.sources.console
action:"suggest_command",value:`${bot.options.commands.MainPrefix}${command.name}`}
})
// copypasted from below, and removed stuff that wont work in the console
}
//{command.consoleOnly && !source.sources.console
//${command.description}
// for (const command of context.bot.commandManager.getCommands()) {
@@ -170,15 +209,16 @@ module.exports = {
// mabe idk
const length = context.bot.commandManager.amogus.length
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, cons_ole], false)
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole], false)
} else {
const length = context.bot.commandManager.amogus.filter(c => !c.consoleOnly).length
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust], false)
}
const length = context.bot.commandManager.amogus.filter(c => c.trustLevel != 3).length
//trustlevel
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust ,own_her], false)
//console.log(pub_lick)
// bot.tellraw([own_her])
//console.log(t_rust)
}
}//
}
}
}
}
+63 -24
View File
@@ -13,8 +13,8 @@ async function getCpuModelName () {
module.exports = {
name: 'info',
description:['check the bots info. the args are version, discord, serverinfo, logininfo, uptime, memused, creators'],
hashOnly:false,
consoleOnly:false,
aliases:['information'],
trustLevel: 0,
async execute (context, client) {
const bot = context.bot
const args = context.arguments
@@ -137,7 +137,23 @@ module.exports = {
const os = require('os')
context.source.sendFeedback({
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s',//lazy fix
color:'gray',text:`Hostname: ${os.hostname()}`})
context.source.sendFeedback({
color: "gray", text: `Working Directory: ${path.join(__dirname, '..')}`})
context.source.sendFeedback( { color: "gray", text: `OS architecture: ${os.arch()}`})
context.source.sendFeedback({ color: "gray", text: `OS platform: ${os.platform()}`})
context.source.sendFeedback({ color: "gray", text: `OS name: ${os.version()}`})
context.source.sendFeedback({ color: "gray", text: `CPU cores: ${os.cpus().length}`})
/*const os = require('os') const cpus = os.cpus() for (const cpu of cpus){bot.tellraw(cpu.model)}*/
//os.cpus()[0].model
/*
if (os.platform() !== 'linux'){
source.sendFeedback({text:'cannot find the cpu model are you sure the bot is running on linux?', color:'red'})
}
else if (os.platform() === 'linux') {
*/ source.sendFeedback({ color: "gray", text: `CPU model: ${await os.cpus()[0].model}`})
// }
/*translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s',//lazy fix
with: [
{ color: "gray", text: `Hostname: ${os.hostname()}`},
{ color: "gray", text: `Working Directory: ${path.join(__dirname, '..')}`},
@@ -150,7 +166,7 @@ module.exports = {
]
});
});*/
break
case 'logininfo':
source.sendFeedback({text:`Bot Username: "${bot.username}"`, color:'gray'})
@@ -165,18 +181,49 @@ module.exports = {
source.sendFeedback({text:`Prefix: "${bot.options.commands.prefix}"`, color:"gray"})
source.sendFeedback({text:`Discord Prefix: "${bot.options.discord.commandPrefix}"`, color:'gray'})
source.sendFeedback({text:`Main Prefix: "${bot.options.commands.MainPrefix}"`, color:"gray"})
source.sendFeedback({text:`Secondary Prefix: "${bot.options.commands.SecondaryPrefix}"`, color:"gray"})
source.sendFeedback({text:`Tertiary Prefix: "${bot.options.commands.TertiaryPrefix}"`, color:"gray"})
source.sendFeedback({text:`Discord Prefix: "${bot.options.discord.commandPrefix}"`, color:'gray'})
source.sendFeedback({text:`Discord Username: "${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}"`, color:'gray'})
source.sendFeedback({text:`Discord Channel: ${bot.discord.channel.name}`})
source.sendFeedback({ color: "gray", text: `ConsoleServer:"${bot.console.consoleServer}"`})
const amonger = bot.bots.map(eachBot => eachBot.options.host + '\n')
const port = bot.bots.map(eachBot => eachBot.options.port)
if (amonger.length === 0){
const list = [];
for (const host of bots){
if (list.length !== 0) {
list.push(host.name)
}
}
}
source.sendFeedback('Servers in Config: ' + amonger.length)//real
/*
const util = fs.readdir('./util')
source.sendFeedback({text:`Util Files loaded: ${util.length}`, color:'gray'})
const modules = fs.readdir('./modules')
source.sendFeedback({text:`Modules Files loaded: ${modules.length}`, color:'gray'})
const commands = fs.readdir('./commands')
source.sendFeedback({text:`Commands Files loaded: ${commands.length}`, color:'gray'})
const CommandModules = fs.readdir('./CommandModules')
source.sendFeedback({text:`CommandModules Files loaded: ${CommandModules.length}`, color:'gray'})
const chat = fs.readdir('./chat')
source.sendFeedback({text:`Chat Files loaded: ${chat.length}`, color:'gray'})
/*
const = '../'
fs.readdir(, (err, files) => {
source.sendFeedback({text:` Files loaded: ${file.length}`, color:'gray'})
});
*/
/*context.source.sendFeedback({
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
with: [
@@ -197,20 +244,12 @@ module.exports = {
break
case 'test':
// bot.tellraw('test')
const amonger = bot.bots.map(eachBot => eachBot.options.host + '\n')
const port = bot.bots.map(eachBot => eachBot.options.port)
// const porta = bot.bots.map(eachBot => eachBot.options.port)
const amongerus = bot.bots.map(eachBot => eachBot.options.host + ':' + eachBot.options.port + '\n')
if (amonger.length === 0){
const list = [];
for (const host of bots){
if (list.length !== 0) {
list.push(host.name)
}
}
}
source.sendFeedback('Servers:' + amonger.length)
source.sendFeedback(``)
source.sendFeedback(amongerus)
// source.sendFeedback(amonger)
break
case 'uptime':
+5 -4
View File
@@ -4,12 +4,13 @@ let timer = null
module.exports = {
name: 'kick',
hashOnly:true,//now its not
description:['kicks a player'],
hashOnly:true,
consoleOnly:false,
trustLevel: 1,
aliases:[],
execute(context) {
// throw new CommandError('temp disabled')
//throw new CommandError('command temporarily disabled until hashing is implemented')
const args = context.arguments
+8 -4
View File
@@ -3,15 +3,19 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'list',
description:['check the player list'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['playerlist', 'plist', 'pl'],
execute (context) {
const bot = context.bot
const args = context.arguments
const players = bot.players
const source = context.source
const component = []
for (const player of players) {
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
if (args.length !== 0){
throw new CommandError({translate:"Too many Arguments!", color:"red"})
}
for (const player of players) {
component.push({
translate: '%s \u203a %s [%s] %s',
with: [
+2 -2
View File
@@ -5,8 +5,8 @@ const os = require('os')
module.exports = {
name: 'lol',
description:['idfk dont ask'],
hashOnly:false,
consoleOnly:false,
aliases:['ohio'],
trustLevel: 0,
execute (context) {
throw new CommandError('idfk lmao')
+3 -3
View File
@@ -3,9 +3,9 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'memusage',
//<< this one line of code broke it lmao
description:['tps'],
hashOnly:false,
consoleOnly:false,
description:['check the bots memusage'],
trustLevel: 0,
aliases:['memoryusage', 'memused','memoryused'],
execute (context) {
const bot = context.bot
const source = context.source
+2 -2
View File
@@ -4,8 +4,8 @@ module.exports = {
name: 'music',
//<< this one line of code broke it lmao
description:[''],
hashOnly:false,
consoleOnly:false,
aliases:[],
trustLevel: 0,
execute (context) {
const message = context.arguments.join(' ')
+74 -11
View File
@@ -2,15 +2,25 @@ const CommandError = require('../CommandModules/command_error.js')
module.exports = {
name: 'netmsg',
description:['send a message to other servers'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['networkmessage', 'netmessage', 'networkmsg'],
execute (context) {
const message = context.arguments.join(' ')
function tryParse (json) {
try {
return JSON.parse(json)
} catch (error) {
return { text: '' }
}
}
const args = context.arguments
const bot = context.bot
//throw new CommandError('ohio')
const source = context.source
const player = context.source.player.displayName
//throw n
const component = {
translate: '[%s] [%s] %s \u203a %s',
with: [
@@ -22,6 +32,7 @@ module.exports = {
text: 'FNF',
bold: true,
color: 'dark_purple'
},
{
text: 'Boyfriend',
@@ -37,12 +48,50 @@ module.exports = {
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
},
bot.options.host + ':' + bot.options.port,
{
text:`${bot.options.host}:${bot.options.port}`,
bold:false,
color:'white',
translate:"",
hoverEvent:{
action:"show_text",
value:[
{
text:`Server: ${bot.options.host}:${bot.options.port}`,
color:'white',
}
],
clickEvent:{
action:"copy_to_clipboard",value:`${bot.options.host}:${bot.options.port}`}
}
context.source.player.displayName ?? context.source.player.profile.name,
message
},
context.source.player.displayName ?? context.source.player.profile.name,
//entry.displayName
{text:message}
]//command.split(' ')[0]
}//string.replace()
}
// context.source.player.displayName ?? context.source.player.profile.name,
/*
function tryParse (json) {
try {
return JSON.parse(json)
} catch (error) {
return { text: '' }
}
}
*///obj
/*
const amogus2 = {text:`${JSON.stringify(context.source.player.displayName ?? context.source.player.profile.name)}`}
bot.tellraw({text:'amogus ' + JSON.parse(context.source.player.displayName)})
*/ //context.source.sendFeedback({text:`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`})
if (!message[0]) {
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
} else {
@@ -51,8 +100,22 @@ module.exports = {
}
}
/*
bot.options.host + ':' + bot.options.port,
context.source.player.displayName ?? context.source.player.profile.name,
message
[%s%s%s] [%s] %s \u203a %s
translate:"",
hoverEvent:{
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
value:[
{
text:`Command:${command.name}\n`,
color:'white'
},{
text:`Trust Level: `,color:'white'},
{text:`${command.trustLevel}\n`,color:'red'},
{text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
},clickEvent:{
action:"suggest_command",value:`${bot.options.commands.MainPrefix}${command.name}`}
})
*/
+2 -2
View File
@@ -1,8 +1,8 @@
module.exports = {
name: 'rc',
description:['refill the bots core'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['refillcore'],
execute (context) {
const bot = context.bot
-46
View File
@@ -1,46 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'recend',
description:['reconnect or end the bot the usages are end, and reconnect'],
hashOnly:true,
consoleOnly:false,
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
//throw new CommandError('disabled until owner hash is added')
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
case `end`:
context.source.sendFeedback('farding right now....')
process.exit()
break
case `reconnect`:
const randomstring = require('randomstring')
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot._client.end()
break
default:
const cmd = {//test.js
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'gold', text: 'recend Cmd'},
]
}
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
context.source.sendError([cmd, { text: 'the args for the info command is reconnect, and end', color: 'green', bold:false }])
}
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
+20
View File
@@ -0,0 +1,20 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'reconnect',
description:['reconnect the bot when?'],
trustLevel: 1,
aliases:['rec'],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
const source = context.source
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot._client.end()
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
+2 -2
View File
@@ -5,8 +5,8 @@ module.exports = {
name: 'say',
//<< this one line of code broke it lmao
description:['make me say something in custom chat'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['tellrawsay', 'tellrawmsg', 'trmessage', 'tellrawmessage', 'sourcesendfeedbacksay','sourcesendfeedbackmsg','sourcesendfeedbackmessage', 'ssfbmsg', 'ssfmessage'],
execute (context) {
const message = context.arguments.join(' ')
+9 -6
View File
@@ -3,14 +3,15 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'sctoggle',
//<< this one line of code broke it lmao
description:['tps'],
hashOnly:false,
consoleOnly:false,
description:['selfcare toggle'],
aliases:['selfcaretoggle'],
trustLevel: 1,
execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
switch (args[0]) {
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
case 'vanishon':
bot.visibility.on()
source.sendFeedback({text:'Vanish selfcare on', color:'green'})
@@ -86,8 +87,10 @@ break
break
default:
throw new CommandError('Invalid argument')
}
source.sendFeedback({text:'Invalid argument', color:'red'})
source.sendFeedback({text:'the on arguments are vanishon, muteon, tptoggleon, godon, prefixon, usernameon, skinon, cspyon, nicknameon'})
source.sendFeedback({text:'the off arguments are vanishoff, muteoff, tptoggleoff, godoff, prefixoff, usernameoff, skinoff, cspyoff, nicknameoff'})
}
},
}
+3 -2
View File
@@ -5,10 +5,11 @@ let timer = null
module.exports = {
name: 'selfdestruct',
//why i put it in here probably cuz so it can be rewritten or smh idk
hashOnly: true,
consoleOnly:false,
trustLevel: 2,
aliases:['sfd'],
description:['selfdestruct server'],
execute (context) {
//throw new CommandError('temp disabled')
//bot went brr
+3 -4
View File
@@ -2,14 +2,13 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'servereval',
description:['no'],
hashOnly:true,
ownerOnly:true,
consoleOnly:false,
trustLevel: 2,
aliases:['svreval'],
execute (context, arguments, selector) {
const bot = context.bot
// const args = context.arguments.join(' ')
const source = context.source
// throw new CommandError('temp disabled')
const { stylize } = require('../util/eval_colors')
const util = require('util')
const args = context.arguments
+49 -5
View File
@@ -3,8 +3,8 @@ const CommandSource = require('../CommandModules/command_source')
module.exports = {
name: 'test',
description:['very 1st command in the bot to test to see if things are working'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['tst'],
execute (context) {
const bot = context.bot
@@ -12,11 +12,55 @@ hashOnly:false,
const player = context.source.player.profile.name
const uuid = context.source.player.uuid
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
context.source.sendFeedback(`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`, false)
const component = {
translate: '[%s] %s %s %s %s %s',
with: [
{
translate: '%s%s%s',
bold:false,
with: [
{
text: 'FNF',
bold: true,
color: 'dark_purple'
},
{
text: 'Boyfriend',
bold: true,
color: 'aqua'
},
{
text: 'Bot',
bold: true,
color: 'dark_red'
},
],
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
},
{
text:'Hello, World!,'
},{
text:'Player:'
},
context.source.player.displayName ?? context.source.player.profile.name,
{
text:`, uuid: ${uuid}, `
},
//entry.displayName
{text:`Argument: ${message}`}
]//command.split(' ')[0]
}
bot.tellraw(component)
// context.source.sendFeedback({text:`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`})
}
}
/*
*/
//context.source.player.displayName ?? context.source.player.profile.name,
+2 -2
View File
@@ -4,8 +4,8 @@ module.exports = {
name: 'testbench',
//<< this one line of code broke it lmao
description:[''],
hashOnly:false,
consoleOnly:false,
aliases:['tstbench'],
trustLevel: 0,
execute (context) {
const bot = context.bot
const args = context.arguments
+2 -2
View File
@@ -3,8 +3,8 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'time',
description:['check the time'],
hashOnly:false,
consoleOnly:false,
aliases:['clock', 'timezone'],
trustLevel: 0,
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
+2 -2
View File
@@ -3,8 +3,8 @@ const between = require('../util/between')
module.exports = {
name: 'tpr',
description:['teleport to a random place'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['rtp', 'teleportrandom', 'randomteleport'],
execute (context) {
const bot = context.bot
const sender = context.source.player
+2 -2
View File
@@ -4,8 +4,8 @@ module.exports = {
name: 'tpsbar',
//<< this one line of code broke it lmao
description:['tps'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['tickspersecondbar', 'tickspersecond', 'tps'],
execute (context) {
const bot = context.bot
const source = context.source
+2 -2
View File
@@ -4,8 +4,8 @@ module.exports = {
name: 'translate',
//<< this one line of code broke it lmao
description:['<language 1> <language 2> <message>'],
hashOnly:false,
consoleOnly:false,
aliases:['translation'],
trustLevel: 0,
async execute (context) {
const { translate } = require('@vitalets/google-translate-api')
const message = context.arguments.join(' ')
+3 -5
View File
@@ -3,8 +3,8 @@ const urban = require('urban-dictionary')
module.exports = {
name: 'urban',
description:['urban dictionary'],
hashOnly:false,
consoleOnly:false,
aliases:['urbandictionary'],
trustLevel: 0,
async execute (context) {
const source = context.source
const args = context.arguments
@@ -54,9 +54,7 @@ hashOnly:false,
//source.sendFeedback(results[0].data)
}).catch((error) => {
console.error(error.message)
})
})
// source.sendFeedback([cmd, { text: definitions2.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
//console.log(urban.define.definition.example(args.join(' ')))
+15 -4
View File
@@ -2,12 +2,23 @@ module.exports = {
name: 'validate',
description:['validate in the bot'],
hashOnly: true,
consoleOnly:false,
trustLevel: 1,
aliases:['val'],
execute (context) {
const source = context.source
const bot = context.bot
const hash = bot.hash
const args = context.arguments
const ownerhash = bot.owner
const discordHash = bot.hashing.hash
if (args[0] === hash) {
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
}else if (args[0] === ownerhash) {
source.sendFeedback({text: 'Valid OwnerHash', color:'green'})
}
else if (discordHash) {
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
}
}
}
//if (args[0] === hash) {
+2 -2
View File
@@ -2,8 +2,8 @@ const wiki = require('wikipedia') //
module.exports = {
name: 'wiki',
description:['wikipedia'],
hashOnly:false,
consoleOnly:false,
trustLevel: 0,
aliases:['wikipedia'],
async execute (context) {
const source = context.source
const args = context.arguments
+79
View File
@@ -0,0 +1,79 @@
{
module.exports = {
bots: [
{
host: "localhost",
username:username(),
version:"1.20.1",
reconnectDelay: 6000,
language:"lolus",
console:true,
input: true,
commands: {
MainPrefix: "set Main Prefix here",
SecondaryPrefix:'set Secondary prefix here',
TertiaryPrefix:'set Tertiary Prefix here'
},
Core: {
customName:"core customName here",
core: true,
},
discord: {
channelId: "discord channelId here",
invite: "discord invite link here",
commandPrefix: "discord command prefix here"
},
skin: {
torso:{
jacket:true,
cape:true,
},
arms: {
leftSleeve:true,
rightSleeve:true,
},
legs:{
leftPants:true,
rightPants:true,
},
head:{
hat:true
},
},
selfcare: {
unmuted: true,
vanished: true,
prefix: true,
skin: true,
cspy: true,
op: true,
gmc: true,
username:true,
nickname: true,
god:true,
tptoggle: true,
interval:500,
}
},
]
}
function username() {
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; // remove sus characters like ` or like ( or whatever because it breaks whatever
let username = '';
for (let i = 0; i < 9; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
username += characters[randomIndex];
}
return username;
}
}
View File
+31 -4
View File
@@ -1,8 +1,13 @@
const util = require('util')
const createBot = require('./bot.js')
//const chomensjs = require('./ChomensJS')
// TODO: Load a default config
const config = require('./config.js')
const fs = require('fs/promises')
const fileExist = require('./util/file-exists')
const path = require('path')
function load () {
//const config = require('./config.js')
const readline = require('readline')
const rl = readline.createInterface({
@@ -18,9 +23,31 @@ const bots = []
bot.options.username
bot.console.useReadlineInterface(rl)
bot.on('error', console.error)
// bot.on('error', (error), util.inspect(error))
try{
bot.on('error', console.error)
}catch(error){
console.log(error.stack)
}
}
}
async function checkConfig () {
if (!await fileExist(path.join(__dirname, 'config.js'))) {
console.error('Config not found! Creating a new Config from ')
await fs.copyFile(path.join(__dirname, 'default.js'), path.join(__dirname, 'config.js'))
} if (await fileExist(path.join(__dirname, 'config.js'))){
console.log('Config found! loading config please wait,......')
}
config = require('./config.js')
load()
}
checkConfig()
process.on('uncaughtException', (e) => {
console.log('uncaught ' + e.stack)
})
-6217
View File
File diff suppressed because it is too large Load Diff
+14 -7
View File
@@ -6,34 +6,41 @@ function inject (bot) {
if (data.type !== 'minecraft:chat') return
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
if (!plainMessage.startsWith(bot.commandManager.prefix)) return
const command = plainMessage.substring(bot.commandManager.prefix.length)
if (!plainMessage.startsWith(bot.commandManager.MainPrefix) && (!plainMessage.startsWith(bot.commandManager.SecondaryPrefix) && (!plainMessage.startsWith(bot.commandManager.TertiaryPrefix)))) return
// else if (!plainMessage.startsWith(bot.commandManager.prefix2)) return
// MainPrefix: "~",
// SecondaryPrefix:'%',
//TertiaryPrefix:'@'
const command = plainMessage.substring(bot.commandManager.MainPrefix.length || plainMessage.substring(bot.commandManager.SecondaryPrefix.length || plainMessage.substring(bot.commandManager.TertiaryPrefix.length))) // if the prefixes are the same length just make it 1 or the length
/*
lifes sus
*/
const source = new CommandSource(data.sender, { discord: false, console: false }, true)
source.sendFeedback = message => {
const prefix = {
translate: '[%s%s%s] \u203a ',
bold: false,
color: 'white',
color: 'dark_gray',
with: [
{
color: 'dark_purple',
text: 'FNF',
bold:true,
hoverEvent: { action:"show_text", value: `${process.env["buildstring"]}`},
hoverEvent: { action:"show_text", value: `${process.env["buildstring"]}\n${process.env["FoundationBuildString"]}`},
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
},
{
color: 'aqua',
text: 'Boyfriend', bold:true,
clickEvent: bot.options.discord.invite ? { action: 'open_url', value: bot.options.discord.invite } : undefined, hoverEvent: { action:"show_text", value: `${process.env["FoundationBuildString"]}`},
clickEvent: bot.options.discord.invite ? { action: 'open_url', value: bot.options.discord.invite } : undefined, hoverEvent: { action:"show_text", value: `Bot Username: ${bot.username}\nBot UUID: ${bot.uuid}\nServer Host: ${bot.options.host}:${bot.options.port}\nBot Minecraft Java Version: ${bot.options.version}`},
},
{ color: 'dark_red',
text: 'Bot',
bold:true,
clickEvent: bot.options.discord.invite ? { action: 'open_url', value: 'https://code.chipmunk.land' } : undefined,
hoverEvent: { action:"show_text", value: '§aMan i like frogs - _ChipMC_'},
},
},//§aMan i like frogs - _ChipMC_
{ color: 'green', text: command.split(' ')[0] }
]
+12 -3
View File
@@ -15,10 +15,11 @@ async function inject (bot, options) {
if (!pos) return
bot.command(`fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName: '{"text":"${bot.options.Core.customName}","color":"dark_red","clickEvent":{"action":"open_url","value":"${bot.options.Core.customName}"}}'} destroy`)
bot.command(`fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName: '{"text":"${bot.options.Core.customName}","color":"dark_red","clickEvent":{"action":"open_url","value":"${bot.options.Core.customName}"}}'} destroy`)
},
move (pos = bot.position) {
bot.core.position = {
x: Math.floor(pos.x / 16) * 16,
@@ -67,13 +68,21 @@ async function inject (bot, options) {
bot.core.incrementCurrentBlock()
// added .substring(0, 32767) so it won't kick the bot if the command is too long.
}
},
}
if (!bot.options.Core.core) return
bot.on('move', () => {
bot.core.move(bot.position)
//setTimeout(() => bot.core.run('say hi'), 100)
})
bot.on('packet.login', (data) =>{
const timer = setInterval(() => {
bot.core.refill()
}, bot.options.Core.interval)
bot.on('end', (bot) => {
clearInterval(timer)
})
})
}
module.exports = inject
+144 -38
View File
@@ -1,10 +1,13 @@
const fs = require('fs')
const path = require('path')
const CommandError = require('../CommandModules/command_error.js')
//check command_source
//it would be both the command_source.js and command_manager.js files
function inject (bot, options) {
bot.commandManager = {
prefix: options.commands?.prefix ?? 'default',
MainPrefix: options.commands?.MainPrefix ?? 'default',
SecondaryPrefix: options.commands?.SecondaryPrefix ?? 'default',
TertiaryPrefix: options.commands?.TertiaryPrefix ?? 'default',
commands: {},
amogus: [],
//ohio
@@ -13,47 +16,141 @@ function inject (bot, options) {
//Unknown command. Type "/help" for help
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
try {
if (!command || !command.execute) throw new CommandError({ translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`, with: [commandName], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help` } : undefined})
if (!command || !command.execute) throw new CommandError({ translate: `Unknown command %s. Type "${bot.options.commands.MainPrefix}help" for help or click on this for the command`, with: [commandName], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.MainPrefix}help` } : undefined})//ohio
if (command.trustLevel > 0){
const event = source?.discordMessageEvent
const roles = event?.member?.roles?.cache
// message.member.displayName
//const hash = `${args[0]}` // this is undefined
//const owner = `${args[0]}`
// const hash = `${args[0]}`
// const owner = `${args[0]}`
if(
source?.sources?.discord &&
command.trustLevel === 1 &&
!roles?.some(role => role?.name == 'trusted' || role?.name == 'FNFBoyfriendBot Owner') ? true : false
) throw new CommandError({text:'You are not Trusted!', color:'red'})
if (
!source?.sources?.discord &&
command.trustLevel === 1 &&
args[0] !== bot.hash &&
args[0] !== bot.owner &&
args[0] !== bot.hashing.hash
) throw new CommandError({text:'Invalid Hash or Invalid Owner Hash', color:'red'})
bot.hashing.updateHash()
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
const player = source?.player?.profile?.name
const uuid = source?.player?.uuid
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
bot.console.hash = function (error, source) {
console.log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `[\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[92mHash\x1b[0m:${bot.hash || bot.hashing.hash}\x1b[0m]` )
}
bot.console.discordHash = function (error, source) {
console.log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `[\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[92mHash\x1b[0m:${bot.hashing.hash}\x1b[0m]` )
}
bot.console.ownerHash = function (error, source) {
console.log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `[\x1b[0m\x1b[31mOwnerHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[31mOwnerHash\x1b[0m:${bot.owner}\x1b[0m]` )
}
if (args[0] === bot.hash) {
bot.console.hash()
}
else if (args[0] === bot.owner) {
bot.console.ownerHash()
}
if (
source?.sources?.discord &&
command.trustLevel === 2 &&
!roles?.some(role => role.name === 'FNFBoyfriendBot Owner')
) throw new CommandError({text:'You are not the Owner!', color:'dark_red'})
const owner = `${args[0]}`
if (
!source?.sources?.discord &&
command.trustLevel === 2 && owner !== bot.owner
)throw new CommandError({text: 'Invalid Owner Hash', color:'dark_red'})
if (command.trustLevel === 3 && !source?.sources?.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'blue' })
//if ()
}// if (command.consoleOnly && !source.sources.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'blue' })
//(hash !== bot.hash && owner !== bot.owner
//command.unknown.argument command.unknown.command
//command.context.here
// let hash = 1
// let owner = 2
if (command.consoleOnly && !source.sources.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'dark_red' })
if (command.hash && args.length === 0 && source.hash) throw new CommandError({ translate: 'Please provide a hash', color: 'red' })
if (command.owner && args.length === 0 && source.owner) throw new CommandError({ translate: 'Please provide a OwnerHash', color: 'dark_red' })
if (command.hashOnly && source.hash) {
// debug
// console.log(`${args} args0 ${args[0]}`) //too sus
const hash = `${args[0]}` // this is undefined
//\x1b[0m\x1b[91m
//console.log(hash)
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
const player = source.player.profile.name
const uuid = source.player.uuid
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
bot.console.hash = function (error, source) {
console.log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer: ${player}, UUID:${uuid}, Hash:${bot.hash}\x1b[0m]` )
}
bot.console.hash()
console.log(bot.hash) // actual hash
//command.hashOnly && command.ownerOnly && args.length !== 0 && source.hash && source.owner
// if (command.hashOnly && args.length === 0) throw new CommandError({ translate: 'Please provide a hash or a OwnerHash', color: 'red' })
//<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `[\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[92mHash\x1b[0m:${bot.hash}\x1b[0m]`
// actual hash
//but look in hashing.js
if (hash !== bot.hash) throw new CommandError({ translate: 'Invalid hash', color: 'dark_red' }) // so true
//message?.member?.displayName
bot.updatehash
}else if (command.hashOnly && source.sources.discord) {
const event = source.discordMessageEvent
//im looking through chomensjs's command handler for reference
//💀
// <\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `[\x1b[0m\x1b[31mOwnerHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[31mOwnerHash\x1b[0m:${bot.owner}\x1b[0m]
const roles = event.member?.roles?.cache
const hasRole = roles.some(role => role.name === 'trusted'|| role.name === 'FNFBoyfriendBot Owner')
if (!hasRole) throw new CommandError({ translate: 'You are not trusted!' })
}//source.discordMessageEvent.event.member.roles?.cache
//command.hashOnly && source.sources.discord
//supposed to be a command error for invalid hash
// if (command.hashOnly && args.length === 0) throw new CommandError({ translate: 'Please provide a hash or a OwnerHash', color: 'red' })
// {text:'Invalid Trusted hash or invalid Owner Hash', color:'red'}
// you cant do a empty if
// but i didnt know it can be just undefined :skull:
//sus
//commented smh out about and ig that worked
// sus
// if("e") {} // ok
// idfk how to explain but it does
// real (there was no if)
// isnt it if(something) {} or i
//if(
// )//tf
/*
if (command.trustLevel > 0) {
const discordRoles = message.member?.roles?.cache
if(
sources.source.discord &&
command.trustLevel === 1 &&
!discordRoles.some((role) => role.name === 'trusted' ||
role.name === 'FNFBoyfriendBot Owner')
)throw new CommandError({text:'You are not trusted!', color:'red'})
let hash
let owner
if (
!sources.source.discord &&
command.trustLevel === 1 &&
args.shift() !== hash &&
args.shift() !== owner
)
*/
// just shift it out of the args (mabe would help with needing to do cloop e add 1 say hi)
//idfk
//tf
// why the fard did it include the comment in the eror it sent
//so replace args[0] with arg.shift()
// just do args.shift()
// or mabe const hasharg = args.shift()
// idk
//aaa
//expression expected
//ik that but why tf is it erroring
// wat the fard
// sus
return command.execute({ bot, source, arguments: args })
} catch (error) {
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
@@ -68,7 +165,10 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
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)
}
}
},
// else source.sendError({ translate: 'command.failed', hoverEvent: { action: 'show_text', contents: String(error.message) } })
@@ -77,10 +177,13 @@ if (error instanceof CommandError) source.sendError(error._message)
return this.execute(source, commandName, args)
},
register (command) {
register (command) {
this.commands[command.name] = command
if(command.aliases) {
command.aliases.map(a => this.commands[a] = command)
}
},
getCommand (name) {
return this.commands[name]
},
@@ -91,18 +194,21 @@ if (error instanceof CommandError) source.sendError(error._message)
}
//
amogus = []
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
try {
const command = require(path.join(__dirname, '../commands', filename))
bot.commandManager.register(command)
bot.commandManager.amogus.push(command)
} catch (error) {
console.error('Failed to load command', filename, ':', error)
}
if (process.env['anti-skid'] !== 'amogus is sus') {
process.exit(0)
}
}
}
module.exports = inject
+60 -34
View File
@@ -1,5 +1,5 @@
const CommandSource = require('../CommandModules/command_source')
//const log = require('../logger')
//const logger = require('../util/logger')
function inject (bot, options, context, source) {
@@ -22,23 +22,36 @@ if (line.startsWith('.')) {
bot.console.source,
line.substring(1),
//null
`${process.env["FNFBoyfriendBot_Owner_key"]}`
)
}
if (line === ',kill') process.exit()
if (line === ',reconnect') bot._client.end()
//probably gotta somehow have it get its username
//tried that already didnt work just errored
//profile or smh :shrug:
// what does it have to be
if (line.startsWith('')){
return bot.commandManager.executeString(
bot.console.source,
bot.console.source,
'console ' + line.substring(0)
)
}
if (!bot.options.input) return
if (!bot.options.console) return
bot.commandManager.executeString(bot.console.source, line)
//bot.commandManager.executeString(bot.console.source, line)
})
@@ -65,25 +78,29 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
const prefix = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `
function log (...args) {
rl.output.write('\x1b[2K\r')
console.log(args.toString())
rl._refreshLine()
};
bot.console.warn = function (error) {
console.log(prefix + `[\x1b[0m\x1b[93mWARN\x1b[0m]: ${error}`)
log(prefix + `[\x1b[0m\x1b[93mWARN\x1b[0m]: ${error}`)
}
bot.console.error = function (error) {
console.log(prefix + `[\x1b[0m\x1b[31mERROR\x1b[0m]: ${error}`)
log(prefix + `[\x1b[0m\x1b[31mERROR\x1b[0m]: ${error}`)
}
bot.console.info = function (message) {
console.log(prefix + `[\x1b[0m\x1b[32mInfo\x1b[0m]:` + message)
log(prefix + `[\x1b[0m\x1b[32mInfo\x1b[0m]:` + message)
}
bot.console.logs = function (message, ansi) {
bot.console.log = function (message, ansi) {
console.log(prefix + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
log(prefix + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
}
bot.console.debug = function (message, ansi) {
console.log(prefix + `[\x1b[0m\x1b[33mDEBUG\x1b[0m]: ` + message)
log(prefix + `[\x1b[0m\x1b[33mDEBUG\x1b[0m]: ` + message)
}
/*
const player = source.player.profile.name
@@ -91,7 +108,7 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
console.log(`[${now} \x1b[0m\x1b[91mHash\x1b[0m] [\x1b[0m\x1b[92mSender: ${player}, uuid:${uuid}, hash:${bot.hash}\x1b[0m]`)
*/
const ansimap = {
/* const ansimap = {
0: '\x1b[0m\x1b[30m',
1: '\x1b[0m\x1b[34m',
2: '\x1b[0m\x1b[32m',
@@ -114,7 +131,7 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
n: '\x1b[4m',
m: '\x1b[9m',
k: '\x1b[6m'
}/*return bot.commandManager.executeString(
}*/ /*return bot.commandManager.executeString(
bot.username,
options.commands.prefix + line.substring(1),
bot.uuid,
@@ -124,42 +141,51 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
// bot.username
//const amogus = username,
//name: message?.member?.displayName
bot.console.source = new CommandSource(null,{console:true, discord:false });
//name: message?.member?.displayName
const isConsole = bot.username ? true : false
bot.console.source = new CommandSource( bot.username,{console:true, discord:false });
bot.console.source.sendFeedback = message => {
//profile:{displayName:bot.username}
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi()
function log (...args) {
if (!bot.options.input) return
if (!bot.options.console) return
bot.console.log(ansi)
}
bot.on('message', message => {
function log (...args) {
rl.output.write('\x1b[2K\r')
console.log(args.toString())
rl._refreshLine()
};
log(ansi)
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
const prefixy = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `
bot.console.logs = function (message, ansi) {
log(prefixy + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
}
bot.on('message', message => {
const lang = require(`../util/language/${bot.options.language}.json`)
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
const string = bot.getMessageAsPrismarine(message)?.toString()
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
// const logtag = (JSON.stringify({"text":"[LOGS]", "color":"#00FF00"}))
function log (...args) {
rl.output.write('\x1b[2K\r')
console.log(args.toString())
rl._refreshLine()
};
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
const time2 = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
const date2 = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] [\x1b[0m\x1b[33mLOGS\x1b[0m]: ${ansi}`)
//const prefix = `<${time2} ${date2}> [${bot.options.host}:${bot.options.port}] `
if (!bot.options.input) return
if (!bot.options.console) return
bot.console.logs(`${ansi}`)
})
}
}
}//const prefix = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `
}
module.exports = inject
/*const message = `[${moment().format('DD/MM/YY HH:mm:ss')} ${prefix}§r] [${bot.server.host}] `
+38 -7
View File
@@ -24,11 +24,14 @@ function inject (bot, options) {
}
client.on('ready', (context) => {
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
//setMaxListeners(Infinity)
client.setMaxListeners(25)
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
bot.discord.channel.send(`\`\`\`\nStarting ${process.env["buildstring"]}......\n\`\`\``)
bot.discord.channel.send(`\`\`\`\nFoundation: ${process.env["FoundationBuildString"]}\n\`\`\``)
bot.discord.channel.send(`\`\`\`\nSuccessfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}\n\`\`\``)
console.log(`Successfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}`)
bot.console.info(`Successfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}`)
})
// I feel like this is a modified version of ChomeNS Bot's discord plugin (the js one ofc) lol - chayapak
@@ -117,7 +120,7 @@ function inject (bot, options) {
if (message.author.id === bot.discord.client.user.id) return
if (message.channel.id !== bot.discord.channel.id) return
//
if (message.content.startsWith(bot.discord.commandPrefix)) { // TODO: Don't hardcode this
const source = new CommandSource({ profile: { name: message?.member?.displayName } }, { discord: true, console: false }, false, message)
@@ -168,14 +171,42 @@ function inject (bot, options) {
})
}
client.on('messageCreate', messageCreate)
bot.on('error', (error) => {
sendDiscordMessage(`Disconnected: ${util.inspect(error.stack)}`)
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))
})*/
//client.on('end', reason => { bot.emit('end', reason)
//client.on('keep_alive', ({ keepAliveId }) => {
//bot.emit('keep_alive', { keepAliveId })
+87 -17
View File
@@ -1,27 +1,33 @@
// * Not real hashing
const crypto = require('crypto')
const ownerkey = process.env['FNFBoyfriendBot_Owner_key']
const key = process.env['FNFBoyfriendBot_key']
const trustedkey = process.env['FNFBoyfriendBot_key']
function inject(bot) {
bot.hash = ''
bot.ownerhash = ''
bot.owner = ''
bot.updatehashes = update
let hash
let owner
let interval = setInterval(() => {
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + trustedkey).digest('hex').substring(0, 16)
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
bot.hash = hash
bot.ownerhash = owner
bot.owner = owner
}, 2000)
function update() {
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + trustedkey).digest('hex').substring(0, 16)
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
bot.hash = hash
bot.ownerhash = owner
}
bot.owner = owner
//this should work right?
/*
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
*/
// ok
/*
bot.on('end', () => {
@@ -29,13 +35,77 @@ function inject(bot) {
})
*/
}
let _hash = generateHash()
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
//bot.hashing = ''
bot.hashing = {
_hash: crypto.randomBytes(4).toString('hex').substring(0,16),
//const key = process.env['FNFBoyfriendBotX_key']
get hash () { return this._hash },
set hash (value) {
this._hash = value
this.discordChannel?.send('```ansi\nTime: ' + time + ' ' + date + ' ' + '```' + '```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash + '\n```')
},
//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
generateHash () {
return crypto.randomBytes(4).toString('hex').substring(0, 16)
},
updateHash () {
this.hash = this.generateHash()
}
}
bot.discord.client?.on('ready', () => {
//bot.discord.client?.setMaxListeners(25)
bot.hashing.discordChannel = bot.discord.client.channels.cache.get('1188677777336057987')
//bot.hashing.discordChannel?.send()
bot.hashing.discordChannel?.send('```ansi\nTime: ' + time + ' ' + date + ' ' + '```' + '```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash + '\n```')
})// + bot.hashing.hash
}//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
//nvm what?
function generateHash () {
return crypto.randomBytes(4).toString('hex')
}
module.exports = inject
/* const interval = setInterval(() => {
const normalKey = process.env['chomensjs_key']
const ownerHashKey = process.env['chomensjs_owner_key']
bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + normalKey).digest('hex').substring(0, 16)
bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerHashKey).digest('hex').substring(0, 16)
}, 2000)
bot.on('end', () => {
clearInterval(interval)
*/
/* const crypto = require('crypto')
let _hash = generateHash()
function inject (bot) {
bot.hashing = {
_hash: crypto.randomBytes(4).toString('hex').substring(0,16),
//const key = process.env['FNFBoyfriendBotX_key']
get hash () { return this._hash },
set hash (value) {
this._hash = value
this.discordChannel?.send('```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ${value}` + '\n```')
},
//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
generateHash () {
return crypto.randomBytes(4).toString('hex').substring(0, 16)
},
updateHash () {
this.hash = this.generateHash()
}
}
bot.discord.client?.on('ready', () => {
bot.hashing.discordChannel = bot.discord.client.channels.cache.get('1120122720001208390')
bot.hashing.discordChannel?.send('```ansi\n Hash for server ' + `${bot.options.host}:${bot.options.port}: ` + bot.hashing.hash + '\n```')
})// + bot.hashing.hash
}//`Hash for server ${bot.options.host}:${bot.options.port}: ${value}`
//nvm what?
function generateHash () {
return crypto.randomBytes(4).toString('hex')
}
*/
+1 -1
View File
@@ -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 §8V4.3.4 §8Build:240 Codename:§4Suffering §4§ksiblings")
if (process.env["buildstring"] !== "§5FridayNightFunkin§bBoyfriend§4Bot §8v5.0.3 §8Build:325")
{
process.exit(1)
}
+2 -2
View File
@@ -45,8 +45,8 @@ function inject (bot) {
if (!target) return
target.removePlayer = entry.removePlayer
}
}
if (process.env["Ultimate Foundation V1.2.4 Build:150"])
}//
if (process.env['FoundationBuildString'] !== 'Ultimate Foundation v2.0.3 Build:225')
{
process.exit(1)
}
+8 -7
View File
@@ -2,16 +2,17 @@ const mc = require('minecraft-protocol')
function reconnect (bot, options) {
bot.reconnectDelay = options.reconnectDelay ?? 5200 // Set from 1000 to 5200 - yfd
bot.username = ''
bot.on('end', () => {
if (bot.reconnectDelay < 0) return
bot.on('end', (reason) => {
if (bot.reconnectDelay < 0) return
setTimeout(() => {
bot._client = mc.createClient(options)
bot.emit('init_client', bot._client)
const client = options.client ?? mc.createClient(options)
bot._client = client
bot.emit('init_client', client)
}, bot.reconnectDelay)
})
}
+2 -2
View File
@@ -28,7 +28,7 @@ let unmuted = false
else if (stringmessage === "You have been unmuted.") unmuted = false
else if (util.isDeepStrictEqual(message, COMMANDSPY_ENABLED_MESSAGE)) commandSpyEnabled = true
else if (util.isDeepStrictEqual(message, COMMANDSPY_DISABLED_MESSAGE)) commandSpyEnabled = false
else if (stringmessage === `You now have the tag: &8[&bPrefix &4${bot.options.commands.prefix}&8]`) {
else if (stringmessage === `You now have the tag: &8[&bPrefix &4${bot.options.commands.MainPrefix}&8]`) {
prefix = true
return
}
@@ -110,7 +110,7 @@ let unmuted = false
if (!commandSpyEnabled && bot.options.selfcare.cspy) bot.command('commandspy:commandspy on')
else if (!vanished && bot.options.selfcare.vanished) bot.core.run(`essentials:vanish ${bot.username} enable`)
else if (unmuted && bot.options.selfcare.unmuted) bot.core.run(`essentials:mute ${bot.uuid}`)
else if (!prefix && bot.options.selfcare.prefix) bot.command(`prefix &8[&bPrefix &4${bot.options.commands.prefix}&8]`)
else if (!prefix && bot.options.selfcare.prefix) bot.command(`prefix &8[&bPrefix &4${bot.options.commands.MainPrefix}&8]`)
else if (gameMode !== 1 && bot.options.selfcare.gmc) bot.command('gamemode creative @s[type=player]')
else if (!skin && bot.options.selfcare.skin) bot.command('skin Parker2991')
else if (!username && bot.options.selfcare.username) bot.command(`username ${bot.username}`)
+164 -13
View File
@@ -12,10 +12,11 @@
"color-convert": "^2.0.1",
"cowsay2": "^2.0.4",
"discord.js": "^14.14.1",
"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",
@@ -29,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",
@@ -56,6 +58,11 @@
"node": "16|| 18 || 20"
}
},
"node_modules/@balena/dockerignore": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz",
"integrity": "sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q=="
},
"node_modules/@discordjs/builders": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.7.0.tgz",
@@ -391,6 +398,14 @@
}
]
},
"node_modules/bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
"dependencies": {
"tweetnacl": "^0.14.3"
}
},
"node_modules/bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
@@ -476,6 +491,15 @@
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
"integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="
},
"node_modules/buildcheck": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.6.tgz",
"integrity": "sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A==",
"optional": true,
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/camelcase": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
@@ -578,6 +602,20 @@
"node": ">= 10"
}
},
"node_modules/cpu-features": {
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.9.tgz",
"integrity": "sha512-AKjgn2rP2yJyfbepsmLfiYcmtNn/2eUvocUyM/09yB0YDiz39HteK/5/T4Onf0pmdYDMgkBoGvRLvEguzyL7wQ==",
"hasInstallScript": true,
"optional": true,
"dependencies": {
"buildcheck": "~0.0.6",
"nan": "^2.17.0"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -674,6 +712,57 @@
"node": ">=16.11.0"
}
},
"node_modules/docker-modem": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.1.tgz",
"integrity": "sha512-vqrE/nrweCyzmCpVpdFRC41qS+tfTF+IoUKlTZr52O82urbUqdfyJBGWMvT01pYUprWepLr8IkyVTEWJKRTQSg==",
"dependencies": {
"debug": "^4.1.1",
"readable-stream": "^3.5.0",
"split-ca": "^1.0.1",
"ssh2": "^1.11.0"
},
"engines": {
"node": ">= 8.0"
}
},
"node_modules/docker-modem/node_modules/readable-stream": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/dockerode": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.0.tgz",
"integrity": "sha512-3LF7/3MPz5+9RsUo91rD0MCcx0yxjC9bnbtgtVjOLKyKxlZSJ7/Kk3OPAgARlwlWHqXwAGYhmkAHYx7IwD0tJQ==",
"dependencies": {
"@balena/dockerignore": "^1.0.2",
"docker-modem": "^5.0.0",
"tar-fs": "~2.0.1"
},
"engines": {
"node": ">= 8.0"
}
},
"node_modules/dockerode/node_modules/tar-fs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.1.tgz",
"integrity": "sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==",
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.0.0"
}
},
"node_modules/dotenv": {
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
@@ -1135,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",
@@ -1145,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",
@@ -1156,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",
@@ -1353,6 +1442,12 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/nan": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz",
"integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==",
"optional": true
},
"node_modules/napi-build-utils": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
@@ -4438,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"
}
@@ -4675,6 +4770,11 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
@@ -4796,6 +4896,36 @@
"npm": ">= 3.0.0"
}
},
"node_modules/split-ca": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split-ca/-/split-ca-1.0.1.tgz",
"integrity": "sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ=="
},
"node_modules/ssh2": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.14.0.tgz",
"integrity": "sha512-AqzD1UCqit8tbOKoj6ztDDi1ffJZ2rV2SwlgrVVrHPkV5vWqGJOVp5pmtj18PunkPJAuKQsnInyKV+/Nb2bUnA==",
"hasInstallScript": true,
"dependencies": {
"asn1": "^0.2.6",
"bcrypt-pbkdf": "^1.0.2"
},
"engines": {
"node": ">=10.16.0"
},
"optionalDependencies": {
"cpu-features": "~0.0.8",
"nan": "^2.17.0"
}
},
"node_modules/ssh2/node_modules/asn1": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
"integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
"dependencies": {
"safer-buffer": "~2.1.0"
}
},
"node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
@@ -4945,6 +5075,11 @@
"node": "*"
}
},
"node_modules/tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA=="
},
"node_modules/typed-emitter": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/typed-emitter/-/typed-emitter-1.4.0.tgz",
@@ -4979,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",
+4 -2
View File
@@ -7,10 +7,11 @@
"color-convert": "^2.0.1",
"cowsay2": "^2.0.4",
"discord.js": "^14.14.1",
"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",
@@ -24,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",
-49
View File
@@ -1,49 +0,0 @@
{
"dependencies": {
"@npmcli/arborist": "^7.2.0",
"@npmcli/metavuln-calculator": "^7.0.0",
"@tonejs/midi": "^2.0.28",
"@vitalets/google-translate-api": "^9.2.0",
"axios": "^1.5.1",
"chromium": "^3.0.3",
"cli": "^1.0.1",
"color-convert": "^2.0.1",
"cowsay2": "^2.0.4",
"discord.js": "^14.14.1",
"dotenv": "^16.3.1",
"https": "^1.0.0",
"isolated-vm": "^4.6.0",
"minecraft-data": "^3.48.0",
"minecraft-protocol": "^1.44.0",
"minecraft-protocol-forge": "^1.0.0",
"mineflayer": "^4.14.0",
"mineflayer-cmd": "^1.1.3",
"moment-timezone": "^0.5.43",
"net": "^1.0.2",
"node_characterai": "^1.1.3",
"node_characterai_edited": "^1.1.5",
"node-weatherunderground": "^1.2.0",
"npm": "^9.5.1",
"openweather-api-node": "^3.1.2",
"prismarine-chat": "^1.9.1",
"prismarine-nbt": "^2.2.1",
"prismarine-proxy": "^1.1.4",
"prismarine-registry": "^1.7.0",
"project-version": "^2.0.0",
"randombytes": "^2.1.0",
"randomstring": "^1.3.0",
"readline": "^1.3.0",
"sharp": "^0.32.6",
"urban-dictionary": "^3.0.2",
"uuid-1345": "^1.0.2",
"uuid-by-string": "^4.0.0",
"vec3": "^0.1.8",
"vm2": "^3.9.19",
"vm2-fixed": "^0.0.1",
"weather-js": "^2.0.0",
"wikipedia": "^2.1.1",
"wunderground-api": "^1.1.4",
"yo-mamma": "^1.3.0",
"zlib": "^1.0.5"
}
}
View File
+1 -1
View File
@@ -3,7 +3,7 @@ const styles = {
boolean: '\xa76',
date: '\xa75',
module: '\xa7n',
name: undefined,
name: undefined,//undefined
null: '\xa7l',
number: '\xa76',
regexp: '\xa74',
+24
View File
@@ -0,0 +1,24 @@
const fs = require('fs');
const path = require('path');
const currentDate = new Date();
const timestamp = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1).toString().padStart(2, '0')}-${currentDate.getDate().toString().padStart(2, '0')}`;
const logFolder = path.join(__dirname, 'logs');
const logFileName = `${timestamp}.log`;
const logFilePath = path.join(logFolder, logFileName);
const logStream = fs.createWriteStream(logFilePath, { flags: 'a' });
function log (message, toFile = true, toConsole = true) {
const now = new Date().toLocaleString();
const toWrite = `[${now}] ${message}`
if (toFile) logStream.write(toWrite + '\n');
if (toConsole) console.log(toWrite);
};
if (!fs.existsSync(logFolder)) {
fs.mkdirSync(logFolder);
}
//ohio
module.exports = log