Compare commits

..
14 Commits
183 changed files with 8893 additions and 6947 deletions
+4
View File
@@ -0,0 +1,4 @@
src/node_modules
src/config.js
src/.env
amog
-17
View File
@@ -1,17 +0,0 @@
class CommandSource {
constructor (player, sources, hash, owner = false, discordMessageEvent = null) {
this.player = player
this.sources = sources
this.hash = hash
this.owner = owner
this.discordMessageEvent = discordMessageEvent
}
sendFeedback () {}
sendError (message) {
this.sendFeedback([{ text: '', color: 'dark_red' }, message], false)
}
}
module.exports = CommandSource
-1
View File
@@ -1 +0,0 @@
this is a lost version of FNFBoyfriendBot found
-70
View File
@@ -1,70 +0,0 @@
const mc = require('minecraft-protocol')
const { EventEmitter } = require('events')
const fs = require('fs')
const path = require('path')
// "buildstring":"FNFBoyfriendBotX V4.0.8a Build:97",
//"FoundationBuildString":"Ultimate Foundation V1.0.1 Build:31",
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 ??= username()
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', () => {
bot.uuid = client.uuid
bot.username = client.username
})
client.on('end', reason => bot.emit('end', reason))
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('Failed to load module', filename, ':', error)
}
}
return bot
}
// ABot username function mabe mabe
function username() {
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; // remove sus characters like ` or like ( or whatever because it breaks whatever
let username = '';
for (let i = 0; i < 8; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
username += characters[randomIndex];
}
return username;
}
module.exports = createBot
-57
View File
@@ -1,57 +0,0 @@
const crypto = require('crypto')
module.exports = {
name: 'abotval',
consoleOnly: true,
execute (context) {
const bot = context.bot
const prefix = '<' // mabe not hardcode the prefix
const args = context.arguments
let hashlol
const key = process.env['abot_key']
const date = new Date();
const min = date.getMinutes();
const md5 = crypto.createHash('md5').update(`${min}--_${key}`).digest('hex');
const basehash = crypto.createHash('sha256').update(md5).digest('hex');
const hashe = btoa(basehash)
const fullhash = crypto.createHash('sha256').update(hashe).digest('hex');
hashlol = fullhash.substring(0, 16);
//already have to token ready
const hash = hashlol
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
const peefix = {
clickEvent: { action:"open_url", value: "https://doin-your.mom"},
"color": "#5A5A5A",
"translate": '[%s] %s \u203a %s',
"with": [
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
{ "color": "aqua", "text": `${bot.username}`},
{ "color": "white", "text": command},
]// why name it that?? xD
}
context.bot.tellraw([peefix])
}//this isnt how..
}//./commands/tellraw.js
// Done!
//are ya able to help with the validation/hashing in mine?
// Make a copy of this
//ahh ok
//whos not
// Can cars fly?
//fr
// look at the console
// watch console rq
// Rip our ram lmao
-12
View File
@@ -1,12 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'botdevhistory',
execute (context) {
const message = context.arguments.join(' ')
const bot = context.bot
var prefix = '&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r '
bot.core.run('bcraw ' + prefix + 'Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!')
}
}
-191
View File
@@ -1,191 +0,0 @@
// TODO: Maybe add more authors
const bots = [
{
name: { text: 'HBot', color: 'aqua', bold:true },
authors: ['hhhzzzsss'],
exclaimer:'HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO',
foundation: 'java/mcprotocollib',
prefixes: ['#']
},
{
name: [{ text: 'Evil', color: 'dark_red' }, {text:'Bot', color:'dark_purple'}],
authors: ['FusseligerDev'],
exclaimer:'',
foundation: 'Java/Custom',
prefixes: ['!']
},
{
name: { text: 'SBot Java', color: 'white', bold:true }, // TODO: Gradient
authors: ['evkc'],
foundation: 'Java/MCProtocolLib',
prefixes: [':']
},
{
name: { text: 'SBot Rust', color: 'white', bold:true }, // TODO: Gradient
authors: ['evkc'],
foundation: 'Rust',
prefixes: ['re:']
},
{
name: { text: 'Z-Boy-Bot', color: 'dark_purple' }, // TODO: Gradient
exclaimer: 'Most likely skidded along with kbot that the dev used',
authors: ['Romnci'],
foundation: 'NodeJS/mineflayer or Java/mcprotocollib idfk',
prefixes: ['Z]']
},
{
name: { text: 'ABot', color: 'gold', bold:true }, // TODO: Gradient
exclaimer: '',
authors: ['yfd'],
foundation: 'NodeJS/Node-Minecraft-Protocol',
prefixes: ['<']
},
{
name: { text: 'FardBot', color: 'light_purple' },
authors: ['_yfd'],
exclaimer: 'bot is dead lol',
foundation: 'NodeJS/Mineflayer',
prefixes: ['<']
},
{
name: { text: 'ChipmunkBot', color: 'green' },
authors: ['_ChipMC_'],
exclaimer: 'chips? also shoutout to chip and chayapak for helping in the rewrite',
foundation: 'Java/MCProtocolLib',
prefixes: ["'", "/'"]
},
{
name: { text: 'ChipmunkBot Old', color: 'green' },
authors: ['_ChipMC_'],
foundation: 'NodeJS/Node-Minecraft-Protocol',
},
{
name: { text: 'TestBot', color: 'aqua' },
authors: ['Blackilykat'],
foundation: 'Java/MCProtocolLib',
prefixes: ["-"]
},
{
name: { text: 'UBot', color: 'grey' },
authors: ['HexWoman'],
exclaimer: 'UwU OwO',
foundation: 'NodeJS/node-minecraft-protocol',
prefixes: ['"']
},
{
name: { text: 'ChomeNS Bot Java', color: 'yellow'},
authors: ['chayapak'],
exclaimer: 'wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak',
foundation: 'Java/MCProtocolLib',
prefixes: ['*', 'cbot ', '/cbot ']
},
{
name: { text: 'ChomeNS Bot NodeJS', color: 'yellow'},
authors: ['chayapak'],
foundation: 'NodeJS/Node-Minecraft-Protocol',
prefixes: ['*', 'cbot', '/cbot']
},
{
name: { text: 'RecycleBot', color: 'dark_green'},
foundation: ['MorganAnkan'],
exclaimer: 'nice bot',
language: 'NodeJS/node-minecraft-protocol',
prefixes: ['=']
},
{
name: { text: 'ManBot', color: 'dark_green' , },
exclaimer: '(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT',
authors: ['Man/LogintimedOut'],
foundation: 'NodeJS/mineflayer',
prefixes: ['(Note:I dont remember!!)']
},
{
name: [{ text: 'Useless', color: 'red', bold:false}, { text: 'Bot', color: 'gray', bold:false}],
exclaimer: 'it isnt useless its a good bot................',
authors: ['IuCC'],
foundation: 'NodeJS/node-minecraft-protocol',
prefixes: ['[']
},
{
name: [{ text: 'Blurry', color: 'dark_purple'}, { text: 'Bot', color: 'red' }],
exclaimer: '',
authors: ['SirLennox'],
foundation: 'Java/custom',
prefixes: [',']
},
{
name: [{ text: 'KittyCorp', color: 'yellow' }, { text: 'Bot', color: 'yellow' }],
exclaimer: '3 words ginlang is gay',
authors: ['ginlang , G6_, ArrayBuffer, and i guess more??'],
foundation: 'NodeJS/node-minecraft-protocol',
prefixes: ['^']
},
{
name: [{ text:'FNF', color: 'dark_purple', bold: true}, {text:'Boyfriend', color: 'aqua', bold:true}, {text:'Bot', color:'dark_red', bold:true}, {text:'X', color:'black', bold:true}],
authors: [{ text:'Parker2991', color: 'dark_red'}, {text:' _ChipMC_', color: 'dark_green', bold:true}, {text:' chayapak', color:'yellow', bold:true}],
exclaimer: '4.0 (this Bot) also the Ultimate version of the FNFBoyfriendBot Builds',
foundation: 'NodeJS/node-minecraft-protocol',
prefixes: ['~']
},
{
name: [{ text:'FNF', color: 'dark_purple', bold: true}, {text:'Boyfriend', color: 'aqua', bold:true}, {text:'Bot', color:'dark_red', bold:true}, {text:' Legacy', color:'green', bold:true}],
authors: [{text:'Parker2991', color:'dark_red' }, {text:' _ChipMC_', color:'dark_green', bold:true }],
exclaimer:'1037 LINES OF CODE WTFARD!??! also this version is in console commands only' ,
foundation: 'NodeJS/mineflayer',
prefixes: []
}
]
module.exports = {
name: 'bots',
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)
}
context.source.sendFeedback(['Known bots (', bots.length, ') - ', ...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('Name: ', info.name)
if (info.exclaimer) component.push('\n', 'Exclaimer: ', info.exclaimer)
if (info.authors && info.authors.length !== 0) {
component.push('\n', 'Authors: ')
for (const author of info.authors) {
component.push(author, { text: ', ', color: 'gray' })
}
component.pop()
}
if (info.foundation) component.push('\n', 'Foundation: ', info.foundation)
if (info.prefixes && info.prefixes.length !== 0) {
component.push('\n', 'Prefixes: ')
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
-33
View File
@@ -1,33 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const CharacterAI = require('node_characterai'); // im gonna push it to the main bot afterwards
const characterAI = new CharacterAI();
// ???
async function start() {
await characterAI.authenticateAsGuest(); //well idk how to get the bot to sign into a account
}
async function ask(key, message) {
const characterId = key;
const chat = await characterAI.createOrContinueChat('LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE');
const response = await chat.sendAndAwaitResponse(message, true);
return response.text//lag real
console.debug(message)
}
module.exports = {
start,
ask,
name: 'cai',
async execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
//yfd idk what im doing
context.source.sendFeedback(start, false)
context.source.sendFeedback(ask, false)
}
}
-72
View File
@@ -1,72 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'calculator',
execute (context) {
const bot = context.bot
const args = context.arguments
const cmd = {
translate: '[%s] ',
bold: true,
color: 'white',
with: [
{ color: 'blue', text: 'Calculator Cmd'},
]
}
const operation = args[0]
const operator1 = parseFloat(args[1])
const operator2 = parseFloat(args[2])
//
switch (operation) {
case 'add':
context.source.sendFeedback({
translate: '[%s] %s is %s',
with: [
{color: 'blue', text:'Calculator Cmd'},
`${operator1} + ${operator2}`,
operator1 + operator2
]
});
break
case 'subtract':
context.source.sendFeedback({
translate: `[%s] %s is %s`,
with: [
{ color: 'blue', text: 'Calculator Cmd'},
`${operator1} - ${operator2}`,
operator1 - operator2
]
});
break
case 'multiply':
context.source.sendFeedback({
translate: '[%s] %s is %s',
with: [
{ color: 'blue', text: 'Calculator Cmd'},
`${operator1} x ${operator2}`,
operator1 * operator2
]
});
break
case 'divide':
context.source.sendFeedback({
translate: '[%s] %s is %s',
with: [
{ color: 'blue', text: 'Calculator Cmd'},
`${operator1} / ${operator2}`,
operator1 / operator2
]
});
break
default:
context.source.sendError([cmd, { text: 'Invalid action', color: 'blue' }])
}
}
}
-252
View File
@@ -1,252 +0,0 @@
/*/*
* This example demonstrates how easy it is to create a bot
* that sends chat messages whenever something interesting happens
* on the server you are connected to.
*
* Below you can find a wide range of different events you can watch
* but remember to check out the API documentation to find even more!
*
* Some events may be commented out because they are very frequent and
* may flood the chat, feel free to check them out for other purposes though.
*
* This bot also replies to some specific chat messages so you can ask him
* a few informations while you are in game.
*/
const crypto = require('crypto')
module.exports = {
name: 'chatterboxbot',
hashOnly:true,
execute (context) {
const mineflayer = require('mineflayer')
const { Vec3 } = require('vec3')
const randomstring = require('randomstring')
const bot = mineflayer.createBot({
host: context.bot.options.host,
username:randomstring.generate(16),
})
bot.on('chat', (username, message) => {
if (username === bot.username) return
const result = /canSee (-?[0-9]+),(-?[0-9]+),(-?[0-9]+)/.exec(message)
if (result) {
canSee(new Vec3(result[1], result[2], result[3]))
return
}
switch (message) {
case 'pos':
sayPosition(username)
break
case 'wearing':
sayEquipment()
break
case 'nick':
sayNick()
break
case 'spawn':
saySpawnPoint()
break
case 'block':
sayBlockUnder(username)
break
case 'quit':
quit(username)
break
default:
bot.chat("That's nice")
}
function canSee (pos) {
const block = bot.blockAt(pos)
const r = bot.canSeeBlock(block)
if (r) {
bot.chat(`I can see the block of ${block.displayName} at ${pos}`)
} else {
bot.chat(`I cannot see the block of ${block.displayName} at ${pos}`)
}
}
function sayPosition (username) {
bot.chat(`I am at ${bot.entity.position}`)
bot.chat(`You are at ${bot.players[username].entity.position}`)
}
function sayEquipment () {
const eq = bot.players[username].entity.equipment
const eqText = []
if (eq[0]) eqText.push(`holding a ${eq[0].displayName}`)
if (eq[1]) eqText.push(`wearing a ${eq[1].displayName} on your feet`)
if (eq[2]) eqText.push(`wearing a ${eq[2].displayName} on your legs`)
if (eq[3]) eqText.push(`wearing a ${eq[3].displayName} on your torso`)
if (eq[4]) eqText.push(`wearing a ${eq[4].displayName} on your head`)
if (eqText.length) {
bot.chat(`You are ${eqText.join(', ')}.`)
} else {
bot.chat('You are naked!')
}
}
function saySpawnPoint () {
bot.chat(`Spawn is at ${bot.spawnPoint}`)
}
function sayBlockUnder () {
const block = bot.blockAt(bot.players[username].entity.position.offset(0, -1, 0))
bot.chat(`Block under you is ${block.displayName} in the ${block.biome.name} biome`)
console.log(block)
}
function quit (username) {
bot.quit(`${username} told me to`)
}
function sayNick () {
bot.chat(`My name is ${bot.player.displayName}`)
}
})
bot.on('whisper', (username, message, rawMessage) => {
console.log(`I received a message from ${username}: ${message}`)
bot.whisper(username, 'I can tell secrets too.')
})
bot.on('nonSpokenChat', (message) => {
console.log(`Non spoken chat: ${message}`)
})
bot.on('login', () => {
bot.chat('Hi everyone!')
})
bot.on('spawn', () => {
bot.chat('I spawned, watch out!')
})
bot.on('spawnReset', (message) => {
bot.chat('Oh noez! My bed is broken.')
})
bot.on('forcedMove', () => {
bot.chat(`I have been forced to move to ${bot.entity.position}`)
})
bot.on('health', () => {
bot.chat(`I have ${bot.health} health and ${bot.food} food`)
})
bot.on('death', () => {
bot.chat('I died x.x')
})
bot.on('kicked', (reason) => {
console.log(`I got kicked for ${reason}`)
})
bot.on('time', () => {
bot.chat('Current time: ' + bot.time.timeOfDay)
})
bot.on('rain', () => {
if (bot.isRaining) {
bot.chat('It started raining.')
} else {
bot.chat('It stopped raining.')
}
})
bot.on('noteHeard', (block, instrument, pitch) => {
bot.chat(`Music for my ears! I just heard a ${instrument.name}`)
})
bot.on('chestLidMove', (block, isOpen) => {
const action = isOpen ? 'open' : 'close'
bot.chat(`Hey, did someone just ${action} a chest?`)
})
bot.on('pistonMove', (block, isPulling, direction) => {
const action = isPulling ? 'pulling' : 'pushing'
bot.chat(`A piston is ${action} near me, i can hear it.`)
})
bot.on('playerJoined', (player) => {
if (player.username !== bot.username) {
bot.chat(`Hello, ${player.username}! Welcome to the server.`)
}
})
bot.on('playerLeft', (player) => {
if (player.username === bot.username) return
bot.chat(`Bye ${player.username}`)
})
bot.on('playerCollect', (collector, collected) => {
if (collector.type === 'player') {
const item = collected.getDroppedItem()
bot.chat(`${collector.username !== bot.username ? ("I'm so jealous. " + collector.username) : 'I '} collected ${item.count} ${item.displayName}`)
}
})
bot.on('entitySpawn', (entity) => {
if (entity.type === 'mob') {
console.log(`Look out! A ${entity.displayName} spawned at ${entity.position}`)
} else if (entity.type === 'player') {
bot.chat(`Look who decided to show up: ${entity.username}`)
} else if (entity.type === 'object') {
console.log(`There's a ${entity.displayName} at ${entity.position}`)
} else if (entity.type === 'global') {
bot.chat('Ooh lightning!')
} else if (entity.type === 'orb') {
bot.chat('Gimme dat exp orb!')
}
})
bot.on('entityHurt', (entity) => {
if (entity.type === 'mob') {
bot.chat(`Haha! The ${entity.displayName} got hurt!`)
} else if (entity.type === 'player') {
bot.chat(`Aww, poor ${entity.username} got hurt. Maybe you shouldn't have a ping of ${bot.players[entity.username].ping}`)
}
})
bot.on('entitySwingArm', (entity) => {
bot.chat(`${entity.username}, I see that your arm is working fine.`)
})
bot.on('entityCrouch', (entity) => {
bot.chat(`${entity.username}: you so sneaky.`)
})
bot.on('entityUncrouch', (entity) => {
bot.chat(`${entity.username}: welcome back from the land of hunchbacks.`)
})
bot.on('entitySleep', (entity) => {
bot.chat(`Good night, ${entity.username}`)
})
bot.on('entityWake', (entity) => {
bot.chat(`Top of the morning, ${entity.username}`)
})
bot.on('entityEat', (entity) => {
bot.chat(`${entity.username}: OM NOM NOM NOMONOM. That's what you sound like.`)
})
bot.on('entityAttach', (entity, vehicle) => {
if (entity.type === 'player' && vehicle.type === 'object') {
bot.chat(`Sweet, ${entity.username} is riding that ${vehicle.displayName}`)
}
})
bot.on('entityDetach', (entity, vehicle) => {
if (entity.type === 'player' && vehicle.type === 'object') {
bot.chat(`Lame, ${entity.username} stopped riding the ${vehicle.displayName}`)
}
})
bot.on('entityEquipmentChange', (entity) => {
console.log('entityEquipmentChange', entity)
})
bot.on('entityEffect', (entity, effect) => {
console.log('entityEffect', entity, effect)
})
bot.on('entityEffectEnd', (entity, effect) => {
console.log('entityEffectEnd', entity, effect)
})
}//this isnt how..
}//./commands/tellraw.js
// Done!
//are ya able to help with the validation/hashing in mine?
// Make a copy of this
//ahh ok
//whos not
// Can cars fly?
//fr
// look at the console
// watch console rq
// Rip our ram lmao
-42
View File
@@ -1,42 +0,0 @@
const crypto = require('crypto')
module.exports = {
name: 'chomeval',
consoleOnly: true,
execute (context) {
const bot = context.bot
const prefix = '*' // mabe not hardcode the prefix
const args = context.arguments
const key = process.env['chomens_bot_key']
const time = Math.floor(Date.now() / 5_000)
const value = bot.uuid + args[0] + time + key
const hash = crypto.createHash('sha256').update(value).digest('hex').substring(0, 16)
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
const message = context.arguments.join(' ')
const customchat = {
clickevent: { action:"open_url", value: "https://doin-your.mom"},
"color": "#5A5A5A",
"translate": `[%s] %s \u203a %s`,
"with": [
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
{ "color": "aqua", "text": `${bot.username}`},
{ "color": "#5A5A5A", "text": `${command}`},
]//
}//how i add a hover event??
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
context.bot.tellraw([customchat])
}
}
//
-26
View File
@@ -1,26 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'ckill',
hashOnly: true,
execute (context) {
const target = context.arguments.join(' ')
const bot = context.bot
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(timer)
timer = null
return
}
if (timer !== null) return
setInterval(function () {
bot.core.run('sudo ' + target + ' suicide')
}, 1)
}
}
-19
View File
@@ -1,19 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cloopcrash',
hashOnly: true,
execute (context) {
const bot = context.bot
timer = setInterval(function () {
bot.core.run(``)
}, 1)
}
}
//what is wi
// IDK
-35
View File
@@ -1,35 +0,0 @@
module.exports = {
name: 'consoleserver',
consoleOnly: true,
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
const servers = bot.bots.map(eachBot => eachBot.options.host)
for (const eachBot of bot.bots) {
if (args.join(' ').toLowerCase() === 'all') {
eachBot.console.consoleServer = 'all'
source.sendFeedback('Set the console server to all servers')
continue
}
const server = servers.find(server => server.toLowerCase().includes(args.join(' ')))
if (!server) {
source.sendFeedback({ text: 'Invalid server', color: 'red' })
return
}
eachBot.console.consoleServer = server
source.sendFeedback('Set the console server to ' + server)
}
}
}
-15
View File
@@ -1,15 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'core',
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.core.run(message.substring(1))
return
}
bot.core.run(message)
}
}
-18
View File
@@ -1,18 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'crash',
hashOnly: true,
execute (context) {
const bot = context.bot
bot.core.run(``) // yfd: make it dotenv or whatever it is. I have a sus crash exploit that can be used I guess ☆*: .。. o(≧▽≦)o .。.:*☆
}
}
//what is wi
// IDK
-32
View File
@@ -1,32 +0,0 @@
const CommandError = require('../CommandModules/command_error')
//how do i stop following? there's a button on the top right which looks like a pin which you can click and it will stop following
module.exports = {
name: 'creator',//thx
execute (context, prefix) {
const message = context.arguments.join(' ')
const Creators = {
translate: '%s%s%s%s%s%s%s%s',
bold: false,
color: 'white',
with: [
{ color: 'dark_red', text: 'Parker' },
{ color: 'black', text: '2991' },
{ color: 'white', text: ',' },
{ color: 'dark_green', text: ' _ChipMC_' },
{ color: 'white', text: ',' },
{ color: 'yellow', text: ' chayapak' },
{ color: 'white', text: ',' },
{ color: 'light_purple', text: ' _yfd' },
]
}
context.source.sendFeedback(['Thank you to all that helped! ', Creators])
context.source.sendFeedback(['ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4'])
context.source.sendFeedback(['FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux'])
context.source.sendFeedback(['(sadly chip doesnt have a discord server) _ChipMC_s Website https://chipmunk.land'])
context.source.sendFeedback(['_yfds discord server: https://discord.gg/BKYKBxfDrs'])
context.source.sendFeedback(['Parker2991 discord username: parker2991'])
context.source.sendFeedback(['chayapaks discord username: chayapak'])
context.source.sendFeedback(['_ChipMC_s discord username: chipmunkmc'])
}
}//https://discord.gg/GCKtG4erux
-20
View File
@@ -1,20 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'discord',
execute (context) {
const bot = context.bot
const event = {
clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
"color": "#5A5A5A",
"translate": `%s`,
"with": [
{ "color": "green", "text": "Click here for the bots discord server link"},
]//
}
context.source.sendFeedback(event, false)
}
}
-11
View File
@@ -1,11 +0,0 @@
module.exports = {
name: 'discordmsg',
execute (context) {
const args = context.arguments
const bot = context.bot
const player = context.player
bot.discord.channel.send(args.join(' '))
}
}
-12
View File
@@ -1,12 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'errortest',
execute (context) {
const message = context.arguments.join(' ')
context.source.sendFeedback('hint hover your mouse over the error')
throw new Error(message)
}
}
-106
View File
@@ -1,106 +0,0 @@
const ivm = require('isolated-vm');//new ivm.Isolate(options)
const CommandError = require('../CommandModules/command_error')
// const isolate = new ivm.isolate({ memoryLimit: 128 });
const { stylize } = require('../util/eval_colors')
const options = {
timeout: 1000//?
}
let isolate = new ivm.Isolate({ memoryLimit: 32 }) // 32 seems fine
module.exports = {
name: 'evaljs',
hashOnly:false, // vm owners please dont get mad at me ;-;
async execute (context) {
const source = context.source
const args = context.arguments
const util = require('util')
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'dark_green', text: 'EvalJS'},
]
}
/* 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' })
*/
switch (args[0]) {
case 'run':
try {//context.eval()
/*
let kitty
const output = test.compileScript(args.slice(1).join(' '))// ivm.createContext(args.slice(1).join(' '))
const realoutput = output.then(result => {
kitty = result.run({
context: amonger,
})
}).catch(reason => {
console.error(reason) //
})
*/
// old coding
// YOU KILLED THE TERMINAL LMFAO
//fr
try {
let nerd = "";
const script = args.slice(1).join(' '); // Ensure script is a string
const cOmtext = isolate.createContext();
(async () => {
try {
let result = await (await cOmtext).eval(script, {
timeout: 1000
})
nerd = result;
source.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
} catch (reason) {
nerd = reason;
source.sendFeedback([cmd, { text: String(reason.message), color: 'white' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
})();
} catch (reason) {
source.sendFeedback([cmd, { text: String("UwU OwO ewwor" + reason.message), color: 'white' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
// credits to chatgpt because im lazy mabe mabe? idfk again ty
//
break//
} catch (e) {
// ral
}
case 'reset':
isolate = null
isolate = new ivm.Isolate({ memoryLimit: 32 }) // 32 seems fine
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
break
default:
source.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
}
}
}
/*
this is typescript
import ivm from 'isolated-vm';
const code = `(function() { return 'Hello, Isolate!'; })()`;
const isolate = new ivm.Isolate({ memoryLimit: 8 }); // mego bites
const script = isolate.compileScriptSync(code);
const context = isolate.createContextSync();
//this
// Prints "Hello, Isolate!"
console.log(script.runSync(context));
*/
-85
View File
@@ -1,85 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const os = require('os')
const path = require('path')
const fs = require('fs')
const packageJSON = require("../package.json")
async function getCpuModelName () {
const cpuInfo = await fs.readFile('/proc/cpuinfo')
const lines = cpuInfo.toString().split('\n')
// among us way of doing it
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
return modelName[1]
}
/*
const testFolder = './tests/';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {
files.forEach(file => {
console.log(file);
});
});
*/
module.exports = {
name: 'filesdirectories',
hashOnly:true,
async execute (context) {
//path.join(__dirname, 'config.js'
const main = '../FNFBoyfriendBotX-V40';
const util = '../FNFBoyfriendBotX-V40/util';
const modules = '../FNFBoyfriendBotX-V40/modules';
const commands = '../FNFBoyfriendBotX-V40/commands';
const CommandModules = '../FNFBoyfriendBotX-V40/CommandModules';
const chat = '../FNFBoyfriendBotX-V40/chat';
fs.readdir(main, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/' + file);
});
});
fs.readdir(util, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/util/' + file);
});
});
fs.readdir(modules, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/modules/' + file);
});
});
fs.readdir(commands, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/commands/' + file);
});
});
fs.readdir(CommandModules, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/CommandModules/' + file);
});
});
fs.readdir(chat, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/chat/' + file);
});
});
}
}
/*const fs = require('fs');
const path = require('path');
const directory = './';
// use readdir method to read the files of the direcoty
fs.readdir(directory, (err, files) => {
files.forEach(file => {
// get the details of the file
let fileDetails = fs.lstatSync(path.resolve(directory, file));
// check if the file is directory
if (fileDetails.isDirectory()) {
console.log('Directory: ' + file);
} else {
console.log('File: ' + file);
}
});
});
*/
-14
View File
@@ -1,14 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'filter',
hashOnly: true,
execute (context) {
const target = context.arguments.join(' ')
const bot = context.bot
}
}
-30
View File
@@ -1,30 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'freeze',
hashOnly: true,
execute (context) {
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(this.timer)
this.timer = null
context.source.sendFeedback('Cloop Stopped', false)
return
}
if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
const target = context.arguments.join(' ')
const bot = context.bot
this.timer = setInterval(function () {
bot.core.run('tp ' + target)
}, 1)
}
}
-41
View File
@@ -1,41 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'help',
execute (context) {
const commandList = []
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'dark_blue', text: 'Help Cmd'},
]
}
const category = {
translate: ' (%s%s%s%s%s) ',
bold: false,
color: 'white',
with: [
{ color: 'green', text: 'Public'},
{ color: 'white', text: ' | '},
{ color: 'dark_red', text: 'Trusted'},
{ color: 'white', text: ' | '},
{ color: 'red', text: 'Owner'},
]
}
for (const command of context.bot.commandManager.getCommands()) {
if (command.consoleOnly && !context.console) continue
if (commandList.length !== 0) commandList.push(' ')
commandList.push({ text: String(command.name), color: command.hashOnly ? 'dark_red' : 'green' })
}
const length = context.bot.commandManager.getCommands().length
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
}
}
-28
View File
@@ -1,28 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'icu',
hashOnly: true,
execute (context) {
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(timer)
timer = null
return
}
if (timer !== null) return
const target = context.arguments.join(' ')
const bot = context.bot
setInterval(function () {
bot.core.run('tp ' + target + ' '+ target + ' ')
}, 1)
}
}
-36
View File
File diff suppressed because one or more lines are too long
-34
View File
@@ -1,34 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'list',
execute (context) {
const bot = context.bot
const players = bot.players
const component = []
for (const player of players) {
component.push({
translate: '%s \u203a %s',
with: [
player.displayName ?? player.profile.name,
player.uuid
]
})
component.push('\n')
}
component.pop()
context.source.sendFeedback(component, false)
}
}
//what is wi
// IDK
-14
View File
@@ -1,14 +0,0 @@
module.exports = {
name: 'logininfo',
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
//context.bot.options.port
context.source.sendFeedback(`Bot Username: ${bot.username}`)
context.source.sendFeedback(`Minecraft Java Version: ${context.bot.options.version}`)
context.source.sendFeedback(`Server: ${context.bot.options.host}`)
context.source.sendFeedback(`Port: ${context.bot.options.port}`)
}
}
-31
View File
@@ -1,31 +0,0 @@
//command.unknown.argument command.unknown.command //command.context.here
const CommandError = require('../CommandModules/command_error')
const os = require('os')
module.exports = {
name: 'lol',
execute (context) {
const prefix = {
clickevent: { action:"open_url", value: "https://doin-your.mom"},
"color": "#5A5A5A",
"translate": ` %s %s %s %s`,
"with": [
{ "color": "dark_red", text: "Incorrect argument for command"},
{ "color": "dark_red", text: " <--[HERE]"},
{ "color": "dark_red", text: "Unknown or incomplete command, see below for error"},
{ "color": "dark_red", "text": "An unexpected error occurred trying to execute that command"},
]//
}//how i add a hover event??
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
context.source.sendFeedback(prefix)
context.source.sendFeedback('[object Object]')
context.source.sendFeedback('NaN')
context.source.sendFeedback('null')
context.source.sendFeedback('undefined')
}
}
-33
View File
@@ -1,33 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const os = require('os')
const path = require('path')
const fs = require('fs/promises')
const packageJSON = require("../package.json")
async function getCpuModelName () {
const cpuInfo = await fs.readFile('/proc/cpuinfo')
const lines = cpuInfo.toString().split('\n')
// among us way of doing it
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
return modelName[1]
}
module.exports = {
name: 'serverinfo',
async execute (context) {
const discordJSVersion = packageJSON.dependencies["discord.js"];
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
context.source.sendFeedback(`Hostname: ${os.hostname()}`, false)
context.source.sendFeedback(`Working Directory: ${path.join(__dirname, '..')}`, false)
context.source.sendFeedback(`OS architecture: ${os.arch()}`, false)
context.source.sendFeedback(`OS platform: ${os.platform()}`, false)
context.source.sendFeedback(`OS name: ${os.version()}`, false)
context.source.sendFeedback(`CPU cores: ${os.cpus().length}`, false)
context.source.sendFeedback(`CPU model: ${await getCpuModelName()}`, false)
context.source.sendFeedback(`Node js Version @${process.version}`, false)
context.source.sendFeedback(`Minecraft-Protocol Version @${MinecraftProtocolVersion}`, false)
context.source.sendFeedback(`Discord.js @${discordJSVersion}`, false)
}
}
-18
View File
@@ -1,18 +0,0 @@
module.exports = {
name: 'memused',
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const os = require('os')
context.source.sendFeedback(`§aMem §aused §a${Math.floor(os.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os.totalmem() / 1048576)} MiB`, false)
}
}
/*
var os = require('os');
console.log(os.cpus());
console.log(os.totalmem());
console.log(os.freemem())
*/
-89
View File
@@ -1,89 +0,0 @@
module.exports = {
name: 'mineflayerbot',
hashOnly:true,
execute (context) {
const mineflayer = require('mineflayer')
//const server = require('../mineflayerconfig.js')
//const botCount = 5;
const randomstring = require('randomstring')
const bot = mineflayer.createBot({
host: context.bot.options.host,
port: context.bot.options.port,
username:'FNFBFBotMinion' + randomstring.generate(2),
version: '1.19.2', // ohio ahh
})
//fr
var sleep = t => new Promise(a => setTimeout(a, t)),
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
function runInCore(cmd) {
bot._client.write('update_command_block', { location: { x: between(Math.floor(bot.entity.position.x) + 1, Math.floor(bot.entity.position.x) - 15), y: between(0, 3), z: between(Math.floor(bot.entity.position.z) + 1, Math.floor(bot.entity.position.z) - 15) }, command: cmd, mode: 1, flags: 0b100 });
}
var sleep = t => new Promise(a => setTimeout(a, t)),
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
bot.on('login', async () => {
})
const cmd = require('mineflayer-cmd').plugin
cmd.allowConsoleInput = false // Optional config argument
bot.loadPlugin(cmd)
//logs message
function sayCommand(sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
bot.chat(message)
resolve()
})
}
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('say', sayCommand,
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.on('chat', (username, message) => {
if (message.startsWith('!')) {
const command = message.substring(1)
bot.cmd.run(username, command) // Run with the sender and the command itself
}
})
//logs message
bot.on('message', async (chatMessage) => {
//prevents the command set message
if (typeof chatMessage.translate === 'string' && chatMessage.translate.startsWith('advMode.')) return
//console.log(chatMessage.toAnsi())
})
}
}
-24
View File
@@ -1,24 +0,0 @@
const CommandError = require('../CommandModules/command_error.js')
module.exports = {
name: 'netmsg',
execute (context) {
const message = context.arguments.join(' ')
const bot = context.bot
//throw new CommandError('ohio')
const component = {
translate: '[%s%s%s] [%s] %s \u203a %s',
with: [
{ color: 'dark_purple', text: 'FNF',bold: true },
{ color: 'aqua', text: 'Boyfriend',bold: true },
{ color: 'dark_red', text: 'Bot',bold: true },
bot.options.host,
context.source.player.displayName ?? context.source.player.profile.name,
message
]
}
for (const eachBot of bot.bots) eachBot.tellraw(component)
}
}
-19
View File
@@ -1,19 +0,0 @@
module.exports = {
name: 'ping',
execute (context) {
if (context.arguments.length !== 0) {
const argumentList = []
for (const argument of context.arguments) {
if (argumentList.length !== 0) argumentList.push(' ')
argumentList.push(argument)
}
context.source.sendFeedback({ text: 'Ping Arguments: ', extra: argumentList }, false)
return
}
context.source.sendFeedback('Pong!', false)
}
}
-10
View File
@@ -1,10 +0,0 @@
module.exports = {
name: 'rc',
execute (context) {
const bot = context.bot
bot.core.refill()
context.source.sendFeedback('Successfully Refilled Core!')
}
}
-19
View File
@@ -1,19 +0,0 @@
const randomstring = require('randomstring')
module.exports = {
name: 'reconnect',
hashOnly: true,
execute (context) {
const source = context.source
const bot = context.bot
const randomstring = require('randomstring')
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot.chat(randomstring.generate(300))
}
}
//red sus
-35
View File
@@ -1,35 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const buildstring = process.env['buildstring']
const foundation = process.env['FoundationBuildString']
module.exports = {
name: 'say',
//<< this one line of code broke it lmao
execute (context) {
const message = context.arguments.join(' ')
const bot = context.bot
const prefix = {
clickevent: { action:"open_url", value: "https://doin-your.mom"},
hoverEvent: { action:"show_text", value: `FNF Sky is a fangirl but a simp for boyfriend confirmed??
${buildstring}
${foundation}
${context.bot.options.commands.prefix}`},
"translate": `[%s] %s \u203a %s`,
"with": [
{ "color": `${context.bot.options.CustomChat.color}`, "text": `${context.bot.options.CustomChat.text}`},
{ "color": "#00FFFF", "text": `${bot.username}`},
{ "color": "#FFFFFF", "text": message},
]//
}//how i add a hover event??
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
bot.tellraw([prefix])
}
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
-15
View File
@@ -1,15 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'skin',
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
bot.core.run('sudo * skin ' + message)
bot.core.run('sudo fnfboyfriendbotx c:oh look we got little ' + message + '"s running around now great', false)
}
}
-27
View File
@@ -1,27 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'spambot',
hashOnly:true,
execute (context) {
const randomstring = require('randomstring')
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
host: context.bot.options.host,
username: randomstring.generate(16),
})
bot.on('login', async () => {
setInterval(function () {
bot.chat(`${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1} anyone like doxing?`)
return
}, 100)
});
}
}
-15
View File
@@ -1,15 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'sudo',
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
bot.core.run('sudo ' + message)
}
}
-21
View File
@@ -1,21 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'test',
execute (context) {
if (context.arguments.length !== 0) {
const argumentList = []
for (const argument of context.arguments) {
if (argumentList.length !== 0) argumentList.push(' ')
argumentList.push(argument)
}
context.source.sendFeedback({ text: 'Hello, world! Arguments: ', extra: argumentList }, false)
return
}
context.source.sendFeedback('Hello, world!', false)
}
}
-27
View File
@@ -1,27 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'testbench',
//<< this one line of code broke it lmao
execute (context) {
//const bot = context.bot
const message = context.arguments.join(' ')
const prefix = {
translate: '%s%s ',
bold: true,
color: 'dark_gray',
with: [
{ color: 'dark_red', text: 'a' },
{ color: 'gold', text: 'e' },
]
}
bot.chat(['tellraw', prefix])
}
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
-18
View File
@@ -1,18 +0,0 @@
const between = require('../util/between')
module.exports = {
name: 'tpr',
execute (context) {
const bot = context.bot
const sender = context.source.player
if (!sender) return
const x = between(-1_000_000, 1_000_000)
const y = 100
const z = between(-1_000_000, 1_000_000)
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
}
}
-54
View File
@@ -1,54 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'troll',
hashOnly: true,
execute (context) {
const target = context.arguments.join(' ')
const bot = context.bot
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(this.timer)
this.timer = null
context.source.sendFeedback('Cloop Stopped', false)
return
}
if (this.timer !== null)
this.timer = setInterval(function () {
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear ' + target)
bot.core.run('effect give' + target + ' nausea')
bot.core.run('effect give ' + target + ' slowness')
bot.core.run('execute at @e run give ' + target + ' bedrock')
bot.core.run('execute at @e run give ' + target + ' sand')
bot.core.run('execute at @e run give ' + target + ' dirt')
bot.core.run('execute at @e run give ' + target + ' diamond')
bot.core.run('execute at @e run give ' + target + ' tnt')
bot.core.run('execute at @e run give ' + target + ' crafting_table')
bot.core.run('execute at @e run give ' + target + ' diamond_block')
bot.core.run('smite ' + target)
bot.core.run('sudo ' + target + ' kaboom')
bot.core.run('essentials:ekill ' + target)
bot.core.run('sudo ' + target + ' nuke')
bot.core.run('eco give ' + target + ' 1000')
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear ' + target)
bot.core.run('summon fireball 115 62 -5')
bot.core.run('sudo ' + target + '/fast')
bot.core.run('sudo ' + target + 'gms')
bot.core.run('sudo ' + target + '/sphere tnt 75')
bot.core.run('sudo ' + target + 'kaboom')
bot.core.run('execute at @e run give ' + target + 'diamond_hoe 64')
bot.core.run('sudo ' + target + 'summon tnt_minecart')
}, 100)
}
}
-23
View File
@@ -1,23 +0,0 @@
module.exports = {
name: 'uptime',
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
function format(seconds){
function pad(s){
return (s < 10 ? '0' : '') + s;
}
var hours = Math.floor(seconds / (60*60));
var minutes = Math.floor(seconds % (60*60) / 60);
var seconds = Math.floor(seconds % 60);
return pad(`hours: ${hours}`) + ' ' + pad(`Mins: ${minutes}`) + ' ' + pad(`Seconds: ${seconds}`);
}
var uptime = process.uptime();
context.source.sendFeedback(format(uptime))
}
}
-29
View File
@@ -1,29 +0,0 @@
const urban = require('urban-dictionary')
module.exports = {
name: 'urban',
async execute (context) {
const source = context.source
const args = context.arguments
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'dark_red', text: 'Urban Cmd'},
]
}
try {
const definitions = await urban.define(args.join(' '))
for (const definition of definitions) {
source.sendFeedback([cmd,{ text: definition.word.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
}
} catch (e) {
source.sendFeedback([cmd,{ text: e.toString(), color: 'red' }])
}
}
}
-11
View File
@@ -1,11 +0,0 @@
module.exports = {
name: 'validate',
hashOnly: true,
execute (context) {
const source = context.source
source.sendFeedback({ text: 'Valid Hash', color: 'dark_green' })
}
}
-20
View File
@@ -1,20 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const buildstring = process.env['buildstring']
const foundationbuildstring = process.env['FoundationBuildString']
const packageJSON = require("../package.json")
module.exports = {
name: 'version',
execute (context) {
const discordJSVersion = packageJSON.dependencies["discord.js"];
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
context.source.sendFeedback(`${buildstring}`, false)
context.source.sendFeedback(`${foundationbuildstring}`)
context.source.sendFeedback('BotEngine:Node-Minecraft-Protocol', false)
context.source.sendFeedback('FridayNightFunkinBoyfriendBotX nmp rewrite of the FNFBoyfriendBot along with being a continuation of the bot', false)
}
}//idfk
//i cant get it to show the npm version
// where the fard are you gonna get that info from the process or whatever
-20
View File
@@ -1,20 +0,0 @@
const wiki = require('wikipedia') //
module.exports = {
name: 'wiki',
async execute (context) {
const source = context.source
const args = context.arguments
try {
const page = await wiki.page(args.join(' '))
const summary = await page.summary()
//const definitions = await urban.define(args.join(' '))
source.sendFeedback({ text: summary.extract, color: 'green' })
} catch (e) {
source.sendFeedback({ text: e.toString(), color: 'red' })
}
}
}
-77
View File
@@ -1,77 +0,0 @@
{
"bots": [
{
"host": "kaboom.pw",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"Core": {
"customName":"https://doin-your.mom"
},
"CustomChat": {
"text":"FNFBoyfriendBot",
"color":"#00FFFF"
},
"discord": {
"channelId": "1106441703046529084",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "24.69.170.247",
"version":"1.20.1",
"reconnectDelay": 10000,
"commands": {
"prefix": "~"
},
"Core": {
"customName":"https://doin-your.mom"
},
"CustomChat": {
"text":"FNFBoyfriendBot",
"color":"#00FFFF"
},
"discord": {
"channelId": "1155826836954157136",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "kaboom.fusselig.xyz",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"Core": {
"customName":"https://doin-your.mom"
},
"CustomChat": {
"text":"FNFBoyfriendBot",
"color":"#00FFFF"
},
"discord": {
"channelId": "1106393124110086174",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
}
]
}
-144
View File
@@ -1,144 +0,0 @@
{
"host": "kaboom.pw",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"discord": {
"channelId": "1106441703046529084",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "kitsune.icu",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"discord": {
"channelId": "1136358568354910309",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
}
},
{
"host": "chipmunk.land",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"discord": {
"channelId": "1134168126083305603",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "kaboom.fusselig.xyz",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"discord": {
"channelId": "1106393124110086174",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "24.69.170.247",
"version":"1.20.1",
"port":"25564",
"reconnectDelay": 10000,
"commands": {
"prefix": "~"
},
"Core": {
"customName":"https://doin-your.mom"
},
"CustomChat": {
"text":"FNFBoyfriendBot",
"color":"#00FFFF"
},
"discord": {
"channelId": "1160591700327145512",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "24.69.170.247",
"version":"1.20.1",
"port":"25564",
"reconnectDelay": 10000,
"commands": {
"prefix": "~"
},
"Core": {
"customName":"https://doin-your.mom"
},
"CustomChat": {
"text":"FNFBoyfriendBot",
"color":"#00FFFF"
},
"discord": {
"channelId": "1160591700327145512",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "172.126.70.0",
"version":"1.20.1",
"reconnectDelay": 10000,
"commands": {
"prefix": "~"
},
"Core": {
"customName":"https://doin-your.mom"
},
"CustomChat": {
"text":"FNFBoyfriendBot",
"color":"#00FFFF"
},
"discord": {
"channelId": "1155826772403814491",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
-23
View File
@@ -1,23 +0,0 @@
const createBot = require('./bot.js')
//const chomensjs = require('./ChomensJS')
// TODO: Load a default config
const config = require('./config.json')
const readline = require('readline')
var buildstring = 'FNFBoyfriendBotX V4.0.8A Build:97'
var foundationbuildstring = 'Ultimate Foundation V1.0.1 Build:31'
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
require('dotenv').config()
const bots = []
for (const options of config.bots) {
const bot = createBot(options)
bots.push(bot)
bot.bots = bots
bot.console.useReadlineInterface(rl)
bot.on('error', console.error)
}
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
-35
View File
@@ -1,35 +0,0 @@
const CommandSource = require('../CommandModules/command_source')
const CommandError = require('../CommandModules/command_error')
function inject (bot) {
bot.on('parsed_message', data => {
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)
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',
with: [
{ color: 'dark_purple', text: 'FNF', bold:true },
{ color: 'aqua', text: 'Boyfriend', bold:true },
{ color: 'dark_red', text: 'Bot', bold:true},
{ color: 'green', text: command.split(' ')[0] }
]
}
bot.tellraw(['', prefix, message])
}
bot.commandManager.executeString(source, command)
})
}
module.exports = inject
-21
View File
@@ -1,21 +0,0 @@
function inject (bot, options) {
bot.cloop = {
list: [],
add (command, interval) {
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
},
remove (index) {
clearInterval(this.list[index].timer)
},
clear () {
for (const cloop of this.list) clearInterval(cloop.timer)
this.list = []
}
}
}
module.exports = inject
-88
View File
@@ -1,88 +0,0 @@
const fs = require('fs')
const path = require('path')
const CommandError = require('../CommandModules/command_error.js')
function inject (bot, options) {
bot.commandManager = {
prefix: options.commands?.prefix ?? 'default',
commands: {},
execute (source, commandName, args) {
const command = this.getCommand(commandName.toLowerCase())
//Unknown command. Type "/help" for help
try {
if (!command || !command.execute) throw new CommandError({ translate: 'Unknown command %s . Type "~help" for help', with: [commandName]})
//command.unknown.argument command.unknown.command
//command.context.here
if (command.consoleOnly && !source.sources.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'dark_red' })
if (command.hashOnly && args.length === 0 && source.hash) throw new CommandError({ translate: 'Please provide a hash', color: 'dark_red' })
if (command.hashOnly && source.hash) {
// debug
// console.log(`${args} args0 ${args[0]}`) //too sus
const hash = `${args[0]}` // this is undefined
console.log(hash) // input hash
console.log(bot.hash) // actual hash
//but look in hashing.js
if (hash !== bot.hash) throw new CommandError({ translate: 'Invalid hash', color: 'dark_red' }) // so true
//im guessing its smh in hashing.js
bot.updatehash
} else if (command.hashOnly && source.sources.discord) {
const event = source.discordMessageEvent
const roles = event.member?.roles?.cache
//1106399617635061810
const hasRole = roles.some(role => role.name === '1106399617635061810')
if (!hasRole) throw new CommandError({ translate: 'You are not trusted!' })
}
/*
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
try {
const command = require(path.join(__dirname, '../commands', filename))
bot.commandManager.register(command)
} catch (error) {
console.error('Failed to load command', filename, ':', error)
}
*/
return command.execute({ bot, source, arguments: args })
} catch (error) {
console.error(error)//const filename of fs.readdirSync(path.join(__dirname, '../commands'
//console.error('Failed to load command', filename, ':', error)
if (error instanceof CommandError) source.sendError(error._message)
else source.sendError({ translate: 'command.failed', hoverEvent: { action: 'show_text', contents: String(error) } })
}
},
//
executeString (source, command) {
const [commandName, ...args] = command.split(' ')
return this.execute(source, commandName, args)
},
register (command) {
this.commands[command.name] = command
},
getCommand (name) {
return this.commands[name]
},
getCommands () {
return Object.values(this.commands)
}
}
//
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
try {
const command = require(path.join(__dirname, '../commands', filename))
bot.commandManager.register(command)
} catch (error) {
console.error('Failed to load command', filename, ':', error)
}
}
}
module.exports = inject
-53
View File
@@ -1,53 +0,0 @@
const CommandSource = require('../CommandModules/command_source')
//const log = require('../logger')
function inject (bot, options) {
bot.console = {
readline: null,
consoleServer: 'all',
useReadlineInterface (rl) {
this.readline = rl
rl.on('line', line => {
if (bot.options.host !== this.consoleServer && this.consoleServer !== 'all') return
bot.commandManager.executeString(bot.console.source, line)
})
rl.on('close', () => {
this.readline = null
})
const originalConsole = console
this.log = (...args) => {
rl.output.write('\x1b[2K\r')
originalConsole.log(args.toString())
rl._refreshLine()
}
}
}
bot.console.source = new CommandSource(null, { console: true, discord: false });
bot.console.source.sendFeedback = message => {
const lang = require('../lolus.json')
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
bot.console.log(ansi)
}
bot.on('message', message => {
const lang = require('../lolus.json')//idk Parker I can help
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
const string = bot.getMessageAsPrismarine(message)?.toString()
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
//new Date().toLocaleString("en-US",{timeZone:"America/LOS_ANGELES"})
bot.console.log(`[${now}] [${options.host}:${options.port}] ${ansi}`)
//`[${now}] [${options.host}${options.port !== 25565 ? `:${options.port}` : ''}] ${ansi}`
// log(`[${now}] [${options.host}:${options.port}] ${string}`, true, false)
})
}
module.exports = inject
-30
View File
@@ -1,30 +0,0 @@
// * Not real hashing
const crypto = require('crypto')
const ownerkey = process.env['FNFBoyfriendBot_Owner_key']
const key = process.env['FNFBoyfriendBot_key']
function inject (bot) {
bot.hash = ''
bot.ownerhash = ''
bot.updatehashes = update
let hash
let owner
const interval = setInterval(() => {
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).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
}, 2000)
function update() {
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).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
}
//this should work right?
// ok
bot.on('end', () => {
clearInterval(interval)
})
}
module.exports = inject
-16
View File
@@ -1,16 +0,0 @@
const mc = require('minecraft-protocol')
function reconnect (bot, options) {
bot.reconnectDelay = options.reconnectDelay ?? 5200 // Set from 1000 to 5200 - yfd
bot.on('end', () => {
if (bot.reconnectDelay < 0) return
setTimeout(() => {
bot._client = mc.createClient(options)
bot.emit('init_client', bot._client)
}, bot.reconnectDelay)
})
}
module.exports = reconnect
-97
View File
@@ -1,97 +0,0 @@
const util = require('util')
const COMMANDSPY_ENABLED_MESSAGE = { text: 'Successfully enabled CommandSpy' }
const COMMANDSPY_DISABLED_MESSAGE = { text: 'Successfully disabled CommandSpy' }
//You now have the tag: &8[&bPrefix &4d~&8]
function inject (bot) {
let entityId
let gameMode
let permissionLevel = 2
let muted = false
let commandSpyEnabled = false
let vanished = false
let prefix = false
let skin = false
/* if (data.toString().startsWith('You have been muted')) muted = true
if (data.toString() === 'You have been unmuted.') muted = false
*/
//bot.on('message', (data) => {
bot.on('message', (message, data) => {
// Successfully removed your skin
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
if (stringmessage.startsWith('You have been muted')) muted = true
else if (stringmessage === "You have been unmuted.") muted = 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]`) {
prefix = true
return
}
else if (stringmessage.startsWith("You now have the tag: ") || stringmessage === "You no longer have a tag") prefix = false
else if (stringmessage === `Successfully set your skin to Parker2991's`) {
skin = true
return
}
else if (stringmessage.startsWith("Successfully removed your skin") || stringmessage === "Successfully removed your skin") skin = false
if (message?.text !== '' || !Array.isArray(message.extra) || message.extra.length < 2 || !message.extra[0]?.text?.startsWith('Vanish for') || message.extra[0].color !== 'gold') return
const suffix = message.extra[message.extra.length - 1]
if (suffix?.color !== 'gold') return
//data.toString().startsWith
if (suffix.text?.endsWith(': enabled')) vanished = true
else if (suffix.text?.endsWith(': disabled')) vanished = false // Bruh what is this ohio code
//
})
bot.on('packet.entity_status', packet => {
if (packet.entityId !== entityId || packet.entityStatus < 24 || packet.entityStatus > 28) return
permissionLevel = packet.entityStatus - 24
})//
//TO-DO create a array for nick, prefix, and mabe username in selfcare so that when it joins or has the nick/prefix changed it will change it back to the set nick and prefix in selfcare
bot.on('packet.game_state_change', packet => {
if (packet.reason !== 3) return // Reason 3 = Change Game Mode
gameMode = packet.gameMode
})
let timer
bot.on('packet.login', (packet) => {
entityId = packet.entityId
gameMode = packet.gameMode
timer = setInterval(() => {
if (permissionLevel < 2) bot.command('op @s[type=player]')
else if (!commandSpyEnabled) bot.command('commandspy:commandspy on')
else if (!vanished) bot.command('essentials:vanish enable')
else if (muted) bot.command(`essentials:mute ${bot.uuid}`)
else if (!prefix) bot.command(`prefix &8[&bPrefix &4${bot.options.commands.prefix}&8]`)
else if (gameMode !== 1) bot.command('gamemode creative @s[type=player]')
else if (!skin) bot.command('skin Parker2991')
}, 500)
})
bot.on('end', () => {
if (timer) clearInterval(timer)
prefix = false
muted = false
commandSpyEnabled = false
vanished = false
skin = false
})
}
module.exports = inject
/*const buildstring = process.env['buildstring']
bot.on('login', async () => {
console.log(`starting ${buildstring}`)
await bot.discord.channel.send(`Starting ${buildstring}`)
await sendChat('/prefix &8[&4Prefix ~ &8]')
await sendChat(buildstring)
await sendChat('Prefix ~')
})
}*/
-13
View File
@@ -1,13 +0,0 @@
function inject (bot, context) {
const buildstring = process.env['buildstring']
const util = require('node:util')
const { EventEmitter } = require('events')
console.log(`Starting ${buildstring} .......`)
console.log(`Username: ${bot.options.username}`)
console.log(`Host: ${bot.options.host}:${bot.options.port}`)
}
module.exports = inject
-3916
View File
File diff suppressed because it is too large Load Diff
-23
View File
@@ -1,23 +0,0 @@
{
"dependencies": {
"@tonejs/midi": "^2.0.28",
"@vitalets/google-translate-api": "^9.2.0",
"cowsay2": "^2.0.4",
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"isolated-vm": "^4.6.0",
"minecraft-protocol": "^1.44.0",
"mineflayer": "^4.14.0",
"moment-timezone": "^0.5.43",
"node_characterai": "^1.1.3",
"prismarine-chat": "^1.9.1",
"randomstring": "^1.3.0",
"readline": "^1.3.0",
"sharp": "^0.32.6",
"urban-dictionary": "^3.0.2",
"uuid-by-string": "^4.0.0",
"vm2": "^3.9.19",
"vm2-fixed": "^0.0.1",
"wikipedia": "^2.1.1"
}
}
-26
View File
@@ -1,26 +0,0 @@
function inject (bot, context) {
const buildstring = process.env['buildstring']
const util = require('node:util')
// bot.discord.channel.send('')
bot.console.info(
`Disconnected from ${bot.server.host} (${event} event): ${util.inspect(reason)}`
)
let timeout = options.reconnectTimeout
try {
if (reason.text) {
if (reason.text ===
'Wait 5 seconds before connecting, thanks! :)' ||
reason.text ===
'You are logging in too fast, try again later.'
) timeout = 1000 * 7
}
} catch (e) {
bot.console.error(e)
}
}
module.exports = inject
@@ -1,5 +1,5 @@
// TODO: Improve how messages are stringified
const ChatMessage = require('prismarine-chat')('1.20.1')
const ChatMessage = require('prismarine-chat')('1.20.2')
const stringify = message => new ChatMessage(message).toString()
class CommandError extends Error {
@@ -7,7 +7,7 @@ class CommandError extends Error {
super(stringify(message), filename, lineError)
this.name = 'CommandError'
this._message = message
}
get message () {
+26
View File
@@ -0,0 +1,26 @@
class CommandSource {
constructor (player, sources, hash, owner, discordMessageEvent = null, consoleOnly, name, profile, bot, prefix = "~") {
this.player = player//kaboom on crack!
// idk fr // mabe
// /shrug
//am i good to restart it?
this.sources = sources
this.profile = bot
this.hash = hash
this.owner = owner
this.consoleOnly = consoleOnly
this.discordMessageEvent = discordMessageEvent
this.prefix = prefix
}
sendFeedback () {}
sendError (message) {
this.sendFeedback([{ text: '', color: 'red' }, message], false)
}
}
module.exports = CommandSource
View File
+110
View File
@@ -0,0 +1,110 @@
const mc = require("minecraft-protocol");
const { EventEmitter } = require("node:events");
const fs = require("fs");
const path = require("path");
const util = require("node:util");
require("events").EventEmitter.defaultMaxListeners = Infinity;
const ChatMessage = require('prismarine-chat')('1.20.2')
function createBot(options = {}) {
const bot = new EventEmitter();
// const rs = require("randomstring");
// Set some default values in options
bot.options = {
host: options.host ??= "localhost",
username: options.username ??= "FNFBoyfriendBot",
hideErrors: options.hideErrors ??= false, // HACK: Hide errors by default as a lazy fix to console being spammed with the console
version: options.version ??= '1.20.2',
}
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);
try{
bot.emit('packet.' + meta.name, data)
} catch(e) {
if(e.toString() === 'RangeError: Invalid string length'){
bot._client.end()
}else{
console.log(e)
}
}
});
const timer = setInterval(() => {
if(!bot.options.endcredits){
return
}else{
bot.chat(`Join the FNFBoyfriendBot discord ${bot.options.discord.invite}`)
}
}, 280000)
client.on("login", async function (data) {
bot.uuid = client.uuid;
bot.username = client.username;
bot.port = bot.options.port;
bot.version = bot.options.version;
var day = new Date().getDay()
if(day === 5){
bot.chat('Getting freaky on a Friday Night!')
}else{
const buildstring = process.env["buildstring"]
bot.chat(ChatMessage.fromNotch(JSON.stringify(process.env['buildstring'])).toMotd().replaceAll('§', '&'))
}
timer
})
client.on("end", (reason) => {
bot.emit("end", reason);
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
bot.cloop.clear()
bot.memusage.off()
bot.tps.off()
clearInterval(timer)
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
});
client.on("disconnect", (reason) => {
bot.emit("disconnect", reason);
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
});
client.on("kick_disconnect", (reason) => {
bot.emit("kick_disconnect", reason);
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
//console.log(reason)
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
});
client.on("keep_alive", ({ keepAliveId }) => {
bot.emit("keep_alive", { keepAliveId });
});
client.on("error", (error) => {
bot?.discord?.channel?.send('``' + error.toString() + '``' )
bot.emit("error", error)
})
});
const client = options.client ?? mc.createClient(options);
bot._client = client;
bot.emit("init_client", client);
bot.bots = options.bots ?? [bot];
return bot;
}
module.exports = createBot;
+14 -7
View File
@@ -1,13 +1,18 @@
function parseMessage (message, data) {
function chatTypeEmote (message, data, context) {
try{
if (message === null || typeof message !== 'object') return
if (message.with?.length < 3 || (message.translate !== '%s %s » %s' && message.translate !== '%s %s » %s')) return
if (message.with?.length < 2 || (message.translate !== 'chat.type.emote' && message.translate !== '%s %s')) return
const senderComponent = message.with[1]
const contents = message.with[2]
const senderComponent = message.with[0]
// wtf spam again - console.log(senderComponent)//wtf...
//console.log(senderComponent)
const contents = message.with[1]
// spam lol - console.log(contents)
//console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
@@ -22,6 +27,8 @@ function parseMessage (message, data) {
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.log(e.stack)
}
module.exports = parseMessage
}
module.exports = chatTypeEmote
+34
View File
@@ -0,0 +1,34 @@
function chatTypeText (message, data, context) {
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.text' && message.translate !== '%s %s')) return
const senderComponent = message.with[0]
// wtf spam again - console.log(senderComponent)//wtf...
//console.log(senderComponent)
const contents = message.with[1]
// spam lol - console.log(contents)
//console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.profile.name) //=== stringusername)
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.log(e.stack)
}
}
module.exports = chatTypeText
@@ -1,14 +1,20 @@
function parseMessage (message, data) {
if (message === null || typeof message !== 'object') return
function chipmunkmod (message, data, context, bot) {
try{
if (message === null || typeof message !== 'object') return
if (message.with?.length < 3 || (message.translate !== '[%s] %s › %s' && message.translate !== '%s %s › %s')) return
const senderComponent = message.with[1]
const contents = message.with[2]
// wtf spam again -
//console.log(senderComponent)//wtf...
const contents = message.with[2]
// spam lol - console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
//console.log(JSON.stringify(hoverEvent))
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
@@ -19,9 +25,11 @@ function parseMessage (message, data) {
sender = data.players.find(player => player.profile.name) //=== stringusername)
}
if (!sender) return undefined
if (!sender) return null
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.error(e)
}
module.exports = parseMessage
}
module.exports = chipmunkmod
@@ -1,4 +1,4 @@
function parseMessage (message, data) {
function chipmunkmodBlackilyKat (message, data) {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 4 || (message.translate !== '[%s%s] %s › %s', message.color !== '#55FFFF' && message.translate !== '%s%s %s › %s', message.color !== '#55FFFF')) return
@@ -24,4 +24,4 @@ function parseMessage (message, data) {
return { sender, contents, type: 'minecraft:chat', senderComponent }
}
module.exports = parseMessage
module.exports = chipmunkmodBlackilyKat
+33
View File
@@ -0,0 +1,33 @@
function creayun (messageobj, data) { // this function is not getting called
const ChatMessage = require('prismarine-chat')('1.20.1')
const stringify = message => new ChatMessage(message).toString()
const message = stringify(messageobj);
var pattern = /^(.*?) (\S*?) » (.*?)$/;
// var pattern = /^(.*?) (\S*?) \u203a (.*?)$/;
//console.log('[debug] parsing a message');
const match = message.match(pattern);
if(pattern.test(message)) {
// console.log('[debug]', match);
return { sender: match[2], contents: match[3], type: 'minecraft:chat'}; //
} else {
//console.log('[debug] pattern does not match');
}//i just realized that the bot uses tellraw
//ima try to fix that
}//it picks players up as undefined in creayun
//and i tried using the kaboom chat parser but edited and that didnt work
// [] username »
module.exports = creayun//:troll:
// •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
// function(function(function(function(function(function(function(function(function(function(function(function(function(function(function(function)))))))))))))))
// i guess so because it connects you
// i think?
//🐔💨💩😎🐒🥶😁😂⏰❌🐒🛏
//very real
// theres so much things that get logged :sob:
//gotta love when it refuses to connect
// someones trying to be fake me in kaboom
//the bot is being waaay to sus
// i will crash him when i get on // sus // very
//k
// getting the fake parker out of kaboom
// pcrashed
+3 -2
View File
@@ -1,6 +1,6 @@
const util = require('util')
function parseMessage (message, data) {
function kaboom (message, data) {
if (message === null || typeof message !== 'object') return
if (message.text !== '' || !Array.isArray(message.extra) || message.extra.length < 3) return
@@ -38,4 +38,5 @@ function isSeparatorAt (children, start) {
return (children[start]?.text === ':' || children[start]?.text === '\xa7f:') && children[start + 1]?.text === ' '
}
module.exports = parseMessage
module.exports = kaboom
+310
View File
@@ -0,0 +1,310 @@
// TODO: Maybe add more authors
const bots = [
{
name: { text: "HBot", color: "aqua", bold: false },
authors: ["hhhzzzsss"],
exclaimer: "HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO",
foundation: "java/mcprotocollib",
prefixes: ["#"],
},
{
name: { text: "64Bot", color: "gold", bold: false },
authors: ["64Will64"],
exclaimer: "NINTENDO 64?!?!??!?! 69Bot when??????",
foundation: "NodeJS/Mineflayer",
prefixes: ["w="],
},
{
name: { text: "Nebulabot", color: "dark_purple", bold: false },
authors: ["IuCC"],
exclaimer: "the void",
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: ["["],
},
{
name: [
{ text: "Prism", color: "#00FF9C", bold: true },
{ text: "Bot", color: "white",bold:true },
],
authors: ["IuCC"],
exclaimer: "prismarine :3",
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: ["["],
},
{
name: { text: "SharpBot", color: "aqua", bold: false },
authors: ["64Will64"],
exclaimer:
"sharp as in the tv? idfk im out of jokes also the first c# bot on the list??",
foundation: "C#/MineSharp",
prefixes: ["s="],
},
{
name: { text: "MoonBot", color: "red", bold: false },
authors: ["64Will64"],
exclaimer: "stop mooning/mooing me ",
foundation: "NodeJS/Mineflayer",
prefixes: ["m="],
},
{
name: { text: "TableBot", color: "yellow", bold: false },
authors: ["12alex12"],
exclaimer: "TABLE CLOTH BOT?!?! ",
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: ["t!"],
},
{
name: [
{ text: "Evil", color: "dark_red", bold: false },
{ text: "Bot", color: "dark_purple" },
],
authors: ["FusseligerDev"],
exclaimer: "",
foundation: "Java/Custom",
prefixes: ["!"],
},
{
name: { text: "SBot Java", color: "white", bold: false }, // TODO: Gradient
authors: ["evkc"],
foundation: "Java/MCProtocolLib",
prefixes: [":"],
},
{
name: { text: "SBot Rust", color: "white", bold: false }, // TODO: Gradient
authors: ["evkc"],
foundation: "Rust",
prefixes: ["re:"],
},
{
name: { text: "Z-Boy-Bot", color: "dark_purple", bold: false }, // TODO: Gradient
exclaimer: "Most likely skidded along with kbot that the dev used",
authors: ["Romnci"],
foundation: "NodeJS/mineflayer or Java/mcprotocollib idfk",
prefixes: ["Z]"],
},
{
name: { text: "ABot", color: "gold", bold: true }, // TODO: Gradient
exclaimer: "not used anymore (replaced by V2)",
authors: [{ text: "_yfd", color: "light_purple" }],
foundation: "NodeJS/Node-Minecraft-Protocol",
prefixes: ["<"],
},
{
name: { text: "ABot-V2", color: "gold", bold: true }, // TODO: Gradient
exclaimer: "",
authors: [{ text: "_yfd", color: "light_purple" }],
foundation: "NodeJS/Node-Minecraft-Protocol",
prefixes: ["<"],
},
{
name: { text: "FardBot", color: "light_purple", bold: false },
authors: ["_yfd"],
exclaimer: "bot is dead lol",
foundation: "NodeJS/Mineflayer",
prefixes: ["<"],
},
{
name: { text: "ChipmunkBot Java", color: "green", bold: false },
authors: ["_ChipMC_"],
exclaimer:
"chips? also shoutout to chip and chayapak for helping in the rewrite",
foundation: "Java/MCProtocolLib",
prefixes: ["'", "/'"],
},
{
name: { text: "ChipmunkBot NodeJS", color: "green", bold: false },
authors: ["_ChipMC_"],
foundation: "NodeJS/Node-Minecraft-Protocol",
},
{
name: { text: "TestBot", color: "aqua", bold: false },
authors: ["Blackilykat"],
foundation: "Java/MCProtocolLib",
prefixes: ["-"],
},
{
name: { text: "UBot", color: "grey", bold: false },
authors: ["HexWoman"],
exclaimer: "UwU OwO",
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ['"'],
},
{
name: { text: "ChomeNS Bot Java", color: "yellow", bold: false },
authors: ["chayapak"],
exclaimer: "wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak",
foundation: "Java/MCProtocolLib",
prefixes: ["*", "cbot ", "/cbot "],
},
{
name: { text: "ChomeNS Bot NodeJS", color: "yellow", bold: false },
authors: ["chayapak"],
foundation: "NodeJS/Node-Minecraft-Protocol",
prefixes: ["*", "cbot", "/cbot"],
},
{
name: { text: "RecycleBot", color: "dark_green", bold: false },
foundation: ["MorganAnkan"],
exclaimer: "nice bot",
language: "NodeJS/node-minecraft-protocol",
prefixes: ["="],
},
{
name: { text: "neobot", color: "blue", bold: false },
exclaimer: "n e o b o t ;oslkdfj;salkdfj;ladsjf",
authors: ["mirkokral"],
foundation: "java/MCProtocolLib",
prefixes: ["_"],
},
{
name: { text: "ManBot", color: "dark_green", bold: false },
exclaimer:
"(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT",
authors: ["Man/LogintimedOut"],
foundation: "NodeJS/mineflayer",
prefixes: ["(Note:I dont remember!!)"],
},
{
name: [
{ text: "Useless", color: "red", bold: false },
{ text: "Bot", color: "gray", bold: false },
],
exclaimer: "it isnt useless its a good bot................",
authors: ["IuCC"],
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ["["],
},
{
name: [
{ text: "Blurry", color: "dark_purple", bold: false },
{ text: "Bot", color: "red" },
],
exclaimer: "",
authors: ["SirLennox"],
foundation: "Java/custom",
prefixes: [","],
},
{
name: [{ text: "SnifferBot", color: "gold", bold: false }],
exclaimer: "sniff sniff FNFBoyfriendBot simp",
authors: ["popbob"],
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: [">"],
},
{
name: [{ text: "XBot", color: "dark_purple", bold: false }],
exclaimer: "",
authors: ["popbob"],
foundation: "ts-Node/Node-minecraft-protocol",
prefixes: ["$"],
},
{
name: [
{ text: "Kitty", color: "gold", bold: false },{text:"Corp", color:'aqua',bold:false},
{ text: "Bot", color: "yellow",bold:false },
],
exclaimer: "3 words ginlang is gay",
authors: ["ginlang , G6_, ArrayBuffer, and i guess more??"],
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ["^"],
},
{
name: [
{ text: "FNF", color: "dark_purple", bold: false },
{ text: "Boyfriend", color: "aqua", bold: false },
{ text: "Bot", color: "dark_red", bold: false },
{ text: " nmp", color: "black", bold: false },
],
authors: [
{ text: "Parker2991", color: "dark_red" },
{ text: " _ChipMC_", color: "dark_green", bold: false },
{ text: " chayapak", color: "yellow", bold: false },
{ text: " _yfd", color: "light_purple", bold: false },
{ text: "popbob", color: "gold" },
],
exclaimer: "FNFBoyfriendBot NMP Rewrite",
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ["~ % &"],
},
{
name: [
{ text: "FNF", color: "dark_purple", bold: false },
{ text: "Boyfriend", color: "aqua", bold: false },
{ text: "Bot", color: "dark_red", bold: false },
{ text: " legacy", color: "green", bold: false },
],
authors: [
{ text: "Parker2991", color: "dark_red" },
{ text: " _ChipMC_", color: "dark_green", bold: false },
],
exclaimer:
"1037 LINES OF CODE WTFARD!??! also this version is in console commands only",
foundation: "NodeJS/mineflayer",
prefixes: [],
},
];
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: "bots",
description: ["shows a list of known bots"],
aliases: ["knownbots"],
trustLevel: 0,
usage:[""],
execute(context) {
const query = context.arguments.join(" ").toLowerCase();
const bot = context.bot;
if (query.length === 0) {
const list = [];
if(!bot.options.Core.enabled){
throw new CommandError('Coreless mode is active can not execute command!')
}else{
for (const info of bots) {
if (list.length !== 0) list.push({ text: ", ", color: "gray" }); // list.push(info.name)
list.push(info.name);
}
context.source.sendFeedback(
bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - ", ...list]).toMotd().replaceAll('\xa7','\xa7'),
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("Name: ", info.name);
if (info.exclaimer) component.push("\n", "Exclaimer: ", info.exclaimer);
if (info.authors && info.authors.length !== 0) {
component.push("\n", "Authors: ");
for (const author of info.authors) {
component.push(author, { text: ", ", color: "gray" });
}
component.pop();
}
if (info.foundation) component.push("\n", "Foundation: ", info.foundation);
if (info.prefixes && info.prefixes.length !== 0) {
component.push("\n", "Prefixes: ");
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
+20
View File
@@ -0,0 +1,20 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'bruhify',
description:['bruhify text'],
aliases:['bruhifytext', 'bruh'],
trustLevel: 0,
usage:["smexy text here"],
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))
}
}
+137
View File
@@ -0,0 +1,137 @@
const bots = [
{//
name: { text: 'v5.0.0-Beta', color: 'blue', bold:false },
authors: ['Monochrome'],
foundation: '12/18/23',
exclaimer:'added owner validation to the bot thats about it',
},
{//
name: { text: 'v5.0.0', color: 'dark_red', bold:false },
authors: ['Monochrome'],
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: 'v5.0.1', color: 'green', bold:false },
authors: [''],
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',
},
{//
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: 'green', 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',
},
{//
name: { text: 'v5.0.4', color: 'green', bold:false },
authors: [''],
foundation: '1/12/24',
exclaimer:'first update of 2024 for the bot but anyway merged the test and errortest commands into cmdtest, changed the colors for the help command public is #00FFFF, trusted is dark_purple and owner remained as dark red. moved the module loader from bot.js to index.js to split the boot time in half which now allows module functions like bot.chat() to be used in bot.js and also since the command manager is a module it also loads the commands thats a w on all ends also removed some modules to improve the bots boot time and moved the functions for the sctoggle command into the command itself and not as a module which helped the boot time as well and last but not least merged the memused usage in the info command with the serverinfo usage and made the memusage command use the bossbar and not the actionbar',
},
{//
name: { text: 'v5.0.5', color: 'dark_red', bold:false },
authors: [{text:'QT ',color:'#f001db'},{text:'KB ',color:'#740000'},{text:'Termination',color:'black'}],
//#f001dbQT #740000KB 0Termination
foundation: '1/26/24',
exclaimer:'added a new feature to the bot called Coreless Mode to where the core can be toggled and most commands using tellraw will use chat instead along with the discord relay chat, fixed the bug with trust and owner commands not running in console along with removing alot of useless commands and made the 3 prefixes a array and added ratelimit for console logging and command usage and added file chat logging back',
},
{//
name: { text: 'v5.0.6A', color: 'gold', bold:false },
authors: ['Interlope'],
foundation: '2/15/24',
exclaimer:'added music finally fixed coreless mode made a seperate function for discord in the command manager and idk what all',
},
]//
//back
/*{//
name: { text: '', color: 'gray', bold:false },
authors: [''],
foundation: '',
exclaimer:'',
},*/
module.exports = {
name: 'changelog',
description:['check the bots changelog'],
trustLevel: 0,
aliases:['cl', 'changes'],
usage:[""],
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
const bot = context.bot
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(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\u00a7','\u00a7'), 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
@@ -247,13 +247,90 @@ const bots = [
exclaimer:'fixed the issue with memused cee mmm dee',
},
{//
name: { text: 'v4.1.9', color: 'gray', bold:false },
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
@@ -265,11 +342,14 @@ const bots = [
exclaimer:'',
},*/
module.exports = {
name: 'changelog',
name: 'changelogv4.3.4',
description:['check the bots changelog'],
trustLevel: 0,
aliases:['clv4.3.4', 'changesv4.3.4'],
usage:[""],
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
const bot = context.bot
if (query.length === 0) {
const list = []
@@ -295,7 +375,7 @@ module.exports = {
]
}
context.source.sendFeedback(['Changelogs (', bots.length, ')', category, ' - ', ...list], false)
context.source.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\xa7','\xa7'), false)
return
}
+36 -15
View File
@@ -1,35 +1,52 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cloop',
hashOnly: true,
execute (context) {
trustLevel: 1,
description:['command loop commands'],
aliases:['commandloop'],
usage:[
"add <interval> <command/message>",
"clear",
"remove <id>",
"list",
],
execute (context, selector) {
const args = context.arguments
const bot = context.bot
const source = context.source
switch (args[0]) {
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[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
const interval = parseInt(args[1])
const command = args.slice(2).join(' ')
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
const interval = parseInt(args[2])
const command = args.slice(3).join(' ')
bot.cloop.add(command, interval)
source.sendFeedback({
translate: 'Added \'%s\' with interval %s to the cloops',
color:'gray',
with: [ command, interval ]
})
break
case 'remove':
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' })
if (bot.cloop.list[args[2]].id === undefined) source.sendFeedback({ text: 'Invalid index', color: 'red' }, false)
const index = parseInt(args[1])
const index = (args[2])
bot.cloop.remove(index)
source.sendFeedback({
translate: 'Removed cloop %s',
color: 'gray',
with: [ index ]
})
@@ -37,10 +54,10 @@ hashOnly: true,
case 'clear':
bot.cloop.clear()
source.sendFeedback({ text: 'Cleared all cloops' })
source.sendFeedback({ text: 'Cleared all cloops', color:'gray' }, false)
break
case 'list':
case 'list':
const component = []
const listComponent = []
@@ -48,6 +65,7 @@ hashOnly: true,
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: '%s \u203a %s (%s)',
color: 'gray',
with: [
i,
cloop.command,
@@ -63,13 +81,16 @@ hashOnly: true,
component.push({
translate: 'Cloops (%s):',
color:'gray',
with: [ bot.cloop.list.length ]
})
component.push('\n')
component.push(listComponent)
source.sendFeedback(component)
component.push(listComponent)
source.sendFeedback(component,true)
//console.log(`tellraw @a ${JSON.stringify(component)}`)
break
default:
source.sendFeedback({ text: 'Invalid action', color: 'red' })
+108
View File
@@ -0,0 +1,108 @@
const CommandError = require('../CommandModules/command_error')
const CommandSource = require('../CommandModules/command_source')
module.exports = {
name: 'cmdtest',
description:['usages are test and msg error'],
trustLevel: 0,
aliases:['cmdtst', 'commandtest', 'commandtst'],
usage:[
"msg",
"error",
],
execute (context) {
const bot = context.bot
const player = context.source.player.profile.name
const uuid = context.source.player.uuid
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
const args = context.arguments
const source = context.source
switch (args[0]) {
case 'msg':
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 ?? context.source.player.uuid } , `
},
//entry.displayName
{text:`Argument: ${args.slice(1).join(' ')}`}
]//command.split(' ')[0]
}//context.source.player.displayName ?? context.source.player.profile.name
//ChatMessage.fromNotch(`${process.env["buildstring"]}`).toMotd().replaceAll('§', '&')
if (!bot.options.Core.enabled){
const ChatMessage = require('prismarine-chat')(bot.options.version)
bot.chat(`Hello, World!, Player: ${ChatMessage.fromNotch(context.source.player.displayName ?? context.source.player.profile.name).toMotd().replaceAll('§', '&')}, uuid: ${context.source.player.uuid}, Argument: ${args.slice(1).join(' ')}`)
} else {
bot.tellraw([component])
}
/*
const bot = context.bot
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)
*/
break
case 'error':
throw new Error(args.slice(1).join(' '))
break
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
default:
if (bot.options.Core.CorelessMode){
bot.chat('&4Invalid action')
sleep(500)
bot.chat('the usages are msg and error')
}else{
context.source.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
context.source.sendError([{ text: 'the usages are msg and error', color: 'gray', bold:false }])
}
}
}
}
/*
*/
//context.source.player.displayName ?? context.source.player.profile.name,
+47
View File
@@ -0,0 +1,47 @@
const CommandError = require('../CommandModules/command_error')
const buildstring = process.env['buildstring']
const foundation = process.env['FoundationBuildString']
module.exports = {
name: 'console',
trustLevel: 3,
description:['no :)'],
// description:['make me say something in custom chat'],
execute (context) {
const message = context.arguments.join(' ')
const bot = context.bot
const prefix = {
translate: '[%s] %s \u203a %s',
color:'dark_gray',
with: [
{
text: 'FNFBoyfriendBot Console', color:'#00FFFF'
},
{
selector: `${bot.username}`, color:'#00FFFF',
clickEvent: { action: 'suggest_command', value: '~help' }
},
{
text: '',
extra: [`${message}`],
color:'white'
},
],
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
}
bot.tellraw([prefix])
}
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
+46
View File
@@ -0,0 +1,46 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'consoleserver',
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 serverName = bot.bots.map(eachBot => eachBot.options.serverName)
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
for (const eachBot of bot.bots) {
if (args.join(' ').toLowerCase() === 'all') {
eachBot.console.consoleServer = 'all'
bot.console.info(` Set the console server to all servers`)
//Set the console server to all servers
continue
}
const server = serverName.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 = port
}
}
}
+25
View File
@@ -0,0 +1,25 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'core',
description:['make me run a command in core'],
aliases:['cb','corerun','run','commandblockrun','cbrun'],
trustLevel: 0,
usage:["<command/message>"],
execute (context) {
const bot = context.bot
// 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 (message.startsWith('/')) {
bot.core.run(message.substring(1))
return
}
bot.core.run(message)
}
}
+75
View File
@@ -0,0 +1,75 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cowsay',
description:['mooooo'],
aliases:['cws', 'cow'],
trustLevel: 0,
usage:["list"],
execute (context, selector) {
const bot = context.bot
const args = context.arguments
const component = ['']
// const args = context.arguments
const source = context.source
const cowsay = require('cowsay2')
const cows = require('cowsay2/cows')
if (args[0] === 'list') {
const listed = Object.keys(cows)
let primary = true
const message = []
for (const value of listed) {
message.push({
text: value + ' ',
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
clickEvent: {
action: 'suggest_command',
value: `${context.bot.options.commands.prefixes[0]}cowsay ${value} `
}
})
}
bot.tellraw(message)
} else {
bot.tellraw({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
}
},
}
// bot.tellraw({ text: cowsay.say(context.arguments.join(' ').slice(1), { cow: cows[args[0]] })
//const listed = JSON.parse(cows)
//source.sendFeedback(`${listed}`, false)
/* if (args[0] === 'list') {
const listed = Object.keys(cows)
let primary = true
const message = []
for (const value of listed) {
message.push({
text: value + ' ',
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
clickEvent: {
action: 'suggest_command',
value: `${prefix}cowsay ${value} `
}
})
}
bot.tellraw(selector, message)
} else {
bot.tellraw(selector, { text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
}
},
*/
/*if (query.length === 0) {
const list = []
for (const info of bots) {
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
list.push(info.name)
}
*/
+56
View File
@@ -0,0 +1,56 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'crash',
description:['crashes a server'],
trustLevel: 1,
aliases:['crashserver', '69'],//69 cuz yes
usage:["exe","give"],
execute (context) {
const bot = context.bot
// throw new CommandError('temp disabled')
const args = context.arguments
const source = context.source
if (!args && !args[0] && !args[1] && !args[2]) return
if(!bot.options.Core.enabled){
throw new CommandError('&4Coreless mode is active can not execute command!')
}else {
switch (args[1] ?? (!source.sources.console && args[0])) {
case `exe`:
const amogus = process.env['amogus']
bot.core.run(`${amogus}`)
break
case `give`:
const amogus2 = process.env['amogus2']
bot.core.run(`${amogus2}`)
break
default:
const cmd = {//test.js
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'gold', text: 'crash'},
]
}
if(source.sources.console){
bot.console.info([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
// bot.console.info([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
}else{
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
// context.source.sendError([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
}
}
}
}
}
//what is wi
// IDK
+40
View File
@@ -0,0 +1,40 @@
const CommandError = require("../CommandModules/command_error")
module.exports = {
name: 'discordmsg',
description:['make me say something in discord'],
trustLevel: 0,
aliases:['discordmessage', 'ddmsg'],
usage:["message"],
execute (context) {
//const args = context.args
const bot = context.bot
const args = context.arguments
// if (args.translate !== '\u202e')
// throw new CommandError('u202e detected')
if (!args[0]) {
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
} else {
bot.discord.channel.send(args.join(' '))
console.log(args[0])
context.source.sendFeedback({ text: `Recieved: ${args.join(' ')}`, color:'green'})
//}
//}
}
}
}
//bot.discord.channel.send(args.join(' '))
/*
if(!args[0])
context.source.sendFeedback('message is empty')
else if (args[0])
bot.discord.channel.send(args[0])
console.log(args[0])
context.source.sendFeedback(`Recieved: ${args[0]}`)
return;
*/
+6 -1
View File
@@ -1,6 +1,11 @@
module.exports = {
name: 'echo',
description:['make me say something in chat'],
aliases:['chatsay'],
trustLevel: 0,
usage:[
"<command/message>",
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
+19
View File
@@ -0,0 +1,19 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'end',
description:['/kill the bot or make it /suicide'],
trustLevel: 1,
aliases:['kys','kill','suicide'],
usage:[""],
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()
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
+150
View File
@@ -0,0 +1,150 @@
const ivm = require('isolated-vm');//new ivm.Isolate(options)
const CommandError = require('../CommandModules/command_error')
// const isolate = new ivm.isolate({ memoryLimit: 128 });
const { stylize } = require('../util/eval_colors')
// 32 seems fine
module.exports = {
name: 'evaljs',
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'],
usage:["re fucking doing"],
async execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
const util = require('util')
const ChatMessage = require('prismarine-chat')(bot.options.version)
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ 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' })
*/
//let hash = bot.hash
const options = {
timeout: 1000//?
}
let isolate = new ivm.Isolate({ memoryLimit: 50, options, global, cachedData: true })
//let cachedData = true
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
case `run`:
try {//context.eval()
/*
let kitty
const output = test.compileScript(args.slice(1).join(' '))// ivm.createContext(args.slice(1).join(' '))
const realoutput = output.then(result => {
kitty = result.run({
context: amonger,
})
}).catch(reason => {
console.error(reason) //
})
*/
// old coding
// YOU KILLED THE TERMINAL LMFAO
//let context = await isolate.createContext({ inspector: true });
//let script = await isolate.compileScript('for(;;)debugger;', { filename: 'example.js' });
// await script.run(context);
try {
let nerd = "";
const script = await args.slice(2).join(' '); // Ensure script is a string
const cOmtext = await isolate.createContextSync({options});
if (script.includes('for(;;);')){
source.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
return
}
else if (script.includes('Array') || script.includes('\u0041rray') || script.includes('\u0065val') || script.includes('.repeat') || script.includes('concat')){
source.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
return
} else if(script.includes('eval')){
source.sendFeedback({text:'no',color:'dark_red'})
return
}else if(script.includes('.fill')){
source.sendFeedback({text:'screw off',color:'dark_red'})
return
}
(async () => {
try {
let result = await (await cOmtext).evalSync(script, options, {
timeout: 1000
})
nerd = result;
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: util.inspect(result, { stylize }) }]).toMotd().replaceAll('§', '&'))
}else{
source.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
}
} catch (reason) {
nerd = reason;
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: String(reason.stack), color: 'white' }]).toMotd().replaceAll('§', '&'))
}else{
source.sendFeedback([cmd, { text: String(reason.stack), color: 'white' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
}
})();
} catch (reason) {
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]).toMotd().replaceAll('§', '&'))
}else{
source.sendFeedback([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
}
// credits to chatgpt because im lazy mabe mabe? idfk again ty
//
break//
} catch (e) {
// ral
}
case 'reset':
isolate = null
isolate = new ivm.Isolate({ memoryLimit: 50 }) // 32 seems fine
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
}else{
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
}
break
default:
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
}else{
source.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
}
}
}
}
/*
this is typescript
import ivm from 'isolated-vm';
const code = `(function() { return 'Hello, Isolate!'; })()`;
const isolate = new ivm.Isolate({ memoryLimit: 8 }); // mego bites
const script = isolate.compileScriptSync(code);
const context = isolate.createContextSync();
//this
// Prints "Hello, Isolate!"
console.log(script.runSync(context));
*/
+45
View File
@@ -0,0 +1,45 @@
const crypto = require('crypto')
module.exports = {
name: 'botval',
trustLevel: 3,
execute (context) {
const bot = context.bot
const prefix = '~' // mabe not hardcode the prefix
const args = context.arguments
const key = process.env['FNFBoyfriendBot_Owner_key']
//al
const time = Math.floor(Date.now() / 11000)
const value = bot.uuid + args[0] + time + key
const hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
const customchat = {
translate: '[%s] %s \u203a %s',
color:'gray',
with: [
{ text: 'FNFBoyfriendBot', color:'#00FFFF'},
{ selector: `${bot.username}`, color:'#00FFFF'},
{ text: '', extra: [`${command}`], color:'white'},
],
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
clickevent: { action:"open_url", value: "https://doin-your.mom"}
}
context.bot.tellraw(customchat)
}
}
//const interval = setInterval(() => {
// bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.normalKey).digest('hex').substring(0, 16)
// bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.ownerHashKey).digest('hex').substring(0, 16)
// Make a copy of this
+269
View File
@@ -0,0 +1,269 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'help',
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
description:['shows the command list or the usage of a command'],
trustLevel: 0,
usage:'[COMMAND]',
async execute (context) {
const bot = context.bot
const commandList = []
const source = context.source
const args = context.arguments
const {EmbedBuilder } = require('discord.js')
// const amogus = bot.prefix
const ChatMessage = require('prismarine-chat')(bot.options.version)
const CommandManager = bot.commandManager
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'blue', text: 'help cmd'},
]
}
const category = {
translate: ' (%s%s%s%s%s) ',
bold: false,
color: 'white',
with: [
{ color: `${bot.helpTheme.pub_lickColor}`, text: 'Public'},
{ color: 'white', text: ' | '},
{ color: `${bot.helpTheme.t_rustedColor}`, text: 'Trusted'},
{ color: 'white', text: ' | '},
{ color: `${bot.helpTheme.own_herColor}`, text: 'Owner'},
]
}
if (args[0]) {
let valid
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
const command = bot.commandManager.commandlist[commands]
if (args[0].toLowerCase() === command.name)
{
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}//bot.getMessageAsPrismarine([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi()
valid = true
if(source.sources.console){
bot.console.info(bot.getMessageAsPrismarine([cmd, {text:`${bot.options.commands.prefixes[0]}${command.name} `,color:'#00ffff'},{text:`${command.aliases} › ${command.description}`,color:'dark_purple'}])?.toAnsi())
bot.console.info(bot.getMessageAsPrismarine([cmd,{text:`Trust Level: `,color:'#00ffff'},{text:`${command.trustLevel}`,color:'dark_purple'}])?.toAnsi())
bot.console.info(bot.getMessageAsPrismarine([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.options.commands.prefixes[0]}${command.name} `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])?.toAnsi())
}else if(!bot.options.Core.enabled && !source.sources.console){
bot.chat(ChatMessage.fromNotch([cmd, `Description: ${command.description}`]).toMotd().replaceAll('§', '&'))
await sleep(1000)
bot.chat(ChatMessage.fromNotch([cmd, {text:`Trust Level: ${command.trustLevel}`}]).toMotd().replaceAll('§', '&'))//[cmd, {text:`Trust Level: ${command.trustLevel}`}]
await sleep(1000)
bot.chat(ChatMessage.fromNotch([cmd, `aliases: ${command.aliases}`]).toMotd().replaceAll('§', '&'))
}else{
source.sendFeedback([cmd, {text:`${bot.options.commands.prefixes[0]}${command.name} `,color:'#00ffff'},{text:`(${command.aliases}) › ${command.description}`,color:'dark_purple'}])
source.sendFeedback([cmd,{text:`Trust Level: `,color:'#00ffff'},{text:`${command.trustLevel}`,color:'dark_purple'}])
source.sendFeedback([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.options.commands.prefixes[0]}${command.name} `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
break
}
} else valid = false
}
if (valid) {
} else {
const args = context.arguments
source.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefixes[0]}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.prefixes[0]}help` } : undefined}])
}
} else {
let pub_lick = []
let t_rust = []
let own_her = []
let cons_ole = []
for (const commands in CommandManager.commandlist) {
const command = CommandManager.commandlist[commands]
if(command.trustLevel === 3) {
cons_ole.push(
{
text: command.name + ' ',
color: 'blue',
translate:"",
hoverEvent:{
action:"show_text",
value:[
{
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:`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
if (command.trustLevel === 2) {
if(!bot.options.Core.enabled && !source.sources.console && !source.sources.discord){
own_her.push(`&4${command.name + ' '}`)
}else{
own_her.push(
{
text: command.name + ' ',
color: `${bot.helpTheme.own_herColor}`,
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.Commands.prefixes[0]}${command.name}`
},
}
)
}
}
else if (command.trustLevel === 1){
if(!bot.options.Core.enabled && !source.sources.console && !source.sources.discord){
t_rust.push(`&5${command.name + ' '}`)
}else {
t_rust.push(
{
text: command.name + ' ',
color:`${bot.helpTheme.t_rustedColor}`,
translate:"",
hoverEvent:{
action:"show_text",
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:"run_command",value:`${bot.Commands.prefixes[0]}${command.name}`
},
}
)
}
}
else if (command.trustLevel === 0){
if (!bot.options.Core.enabled && !source.sources.console && !source.sources.discord){
pub_lick.push(`&b${command.name + ' '}`)
} else{
pub_lick.push(
{
text: command.name + ' ',
color: `${bot.helpTheme.pub_lickColor}`,
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.Commands.prefixes[0]}${command.name}`}
})
}
}
}
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms))
}
const isConsole = context.source.player ? false : true
if(source.sources.console && !source.sources.discord) {
bot.console.info(bot.getMessageAsPrismarine([cmd, 'Commands (', CommandManager.commandlist.length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi(), false)//[cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole]
} else if(source.sources.discord&& !source.sources.console){
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle('help Command')
.setDescription(bot.getMessageAsPrismarine(['Commands (',JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3).length),')'])?.toString())
.addFields(
{ name: 'Public Commands', value:`${bot.getMessageAsPrismarine(pub_lick)?.toString()}`},
{ name: 'Trusted Commands', value: `${bot.getMessageAsPrismarine(t_rust)?.toString()}`, inline: true },
{ name: 'Owner Commands', value: `${bot.getMessageAsPrismarine(own_her)?.toString()}`, inline: true },
)
bot?.discord?.Message?.reply({ embeds: [Embed] })
}else if (!bot.options.Core.enabled) {
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
bot.chat('Commands (' + JSON.stringify(length) + ') (&bPublic &f| &5Trusted &f| &4Owner&f)')
await sleep(3000)
bot.chat(`${pub_lick}`)
await sleep(3000)
bot.chat(`${t_rust}`)
await sleep(3000)
bot.chat(`${own_her}`)
}else {
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
source.sendFeedback([cmd, 'Commands (', JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3).length), ') ', category, ...pub_lick, t_rust ,own_her], false)
}
}
}
}
+114
View File
@@ -0,0 +1,114 @@
const CommandError = require("../CommandModules/command_error");
const path = require("path");
const fs = require("fs");
const packageJSON = require("../package.json");
const os = require('os');
const date = new Date().toLocaleDateString("en-US", {
timeZone: "America/CHICAGO",
});
module.exports = {
name: "info",
description: [
"check the bots info",
],
aliases: ["information"],
trustLevel: 0,
usage:[
"version",
"invite",
"server",
"packages",
"login",
"config",
"uptime",
"contributors",
],
async execute(context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source
function format(seconds) {
function pad(s) {
return (s < 10 ? "0" : "") + s;
}
var hours = Math.floor(seconds / (60 * 60));
var minutes = Math.floor((seconds % (60 * 60)) / 60);
var seconds = Math.floor(seconds % 60);
return (pad(`${hours} Hours`) + " " +
pad(`${minutes} Minutes`) + " " +
pad(`${seconds} Seconds`))
}
switch(args.join(' ').toLowerCase()) {
case 'version':
source.sendFeedback({text:`${process.env.buildstring}`})
source.sendFeedback({text:`${process.env.FoundationBuildString}`})
source.sendFeedback({text:`11/22/2022 - ${date}`})
break
case 'invites':
source.sendFeedback({ text: 'Discord Invite', color: "dark_gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.discord.invite}`, }, });
source.sendFeedback({ text: 'Matrix Invite', color: "dark_gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.matrix.invite}`, }, });
break
case 'server':
source.sendFeedback({ color: "dark_gray", text: `Hostname \u203a ${os.hostname()}`, });
source.sendFeedback({ color: "dark_gray", text: `Working Directory \u203a ${process.mainModule.path}`, });
source.sendFeedback({ color: "dark_gray", text: `${os.arch()}`})
source.sendFeedback({ color: "dark_gray", text:`OS \u203a ${os.platform()}`})
source.sendFeedback({ color: "dark_gray", text: `OS Version/distro \u203a ${os.version()}`, });
source.sendFeedback({ color: "dark_gray", text: `Kernal Version \u203a ${os.release()}`, });
source.sendFeedback({ color: "dark_gray", text: `cores \u203a ${os.cpus().length}`, });
source.sendFeedback({ color: "dark_gray", text: `CPU \u203a ${os.cpus()[0].model}`, });
source.sendFeedback([{text:`Server Free memory `, color:'dark_gray'},{text:`${Math.floor( os.freemem() / 1048576, )} `,color:'dark_gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'dark_gray'}]);
source.sendFeedback({text:`Device uptime \u203a ${format(os.uptime())}`,color:'dark_gray'})
source.sendFeedback({text:`Node version \u203a ${process.version}`,color:'dark_gray'})
break
case 'packages':
// source.sendFeedback([{text:'Package Count \u203a ',color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
source.sendFeedback([{text:'Packages \u203a ',color:'dark_gray'},{text:`${Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')}`}])
source.sendFeedback([{text:'Package Count \u203a ', color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
break
case 'login':
source.sendFeedback({text:`Minecraft Username \u203a ${bot.options.username}`,color:'dark_gray'})
source.sendFeedback({text: `uuid \u203a ${bot.uuid}`,color:'dark_gray'})
if(bot.discord === undefined){
source.sendFeedback({text:'Currently not logged into discord',color:'dark_red'})
}else{
source.sendFeedback({text:`Discord Username \u203a ${bot.discord.client.user.username + '#' + bot.discord.client.user.discriminator}`,color:'dark_gray'})
}
if (bot.matrix.client === undefined){
source.sendFeedback({text:'Currently not logged into matrix',color:'dark_red'})
}else{
source.sendFeedback({text: `Matrix Username \u203a ${bot.matrix.client.credentials.userId}`,color:'dark_gray'})
}
source.sendFeedback({text:`Server \u203a ${bot.options.serverName}`,color:'dark_gray'})
source.sendFeedback({text:`Server IP \u203a ${bot.options.host + ':' + bot.options.port}`,color:'dark_gray'})
source.sendFeedback({text:`Version \u203a ${bot.options.version}`,color:'dark_gray'})
break
case 'config':
source.sendFeedback({text:`Prefixes \u203a ${bot.Commands.prefixes}`,color:'dark_gray'})
source.sendFeedback([{text:`Core enabled? `,color:'dark_gray'},{text:`${bot.options.Core.enabled}`,color:'gold'}])
source.sendFeedback([{text:'Discord enabled? ',color:'dark_gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
source.sendFeedback([{text:'Matrix enabled? ',color:'dark_gray'},{text:`${bot.matrix.enabled}`,color:'gold'}])
source.sendFeedback([{text:'Console logging enabled? ',color:'dark_gray'},{text:`${bot.options.Console.enabled}`,color:'gold'}])
source.sendFeedback([{text:'Chat filelogging enabled? ',color:'dark_gray'},{text:`${bot.Console.filelogging}`,color:'gold'}])
source.sendFeedback([{text:'Multiconnect Server count \u203a ',color:'dark_gray'},{text:`${Object.keys(bot.bots).length}`,color:'gold'}])
break
case 'uptime':
source.sendFeedback([{text:`${format(process.uptime())}`,color:'dark_gray'}])
break
case 'contributors':
source.sendFeedback({ translate: "%s%s", with: [ { color: "dark_red", text: "Parker" }, { color: "black", text: "2991" }, ], hoverEvent: { action: "show_text", value: [ { text: "FNF", color: "dark_purple", bold: true, }, { text: "Boyfriend", color: "aqua", bold: true, }, { text: "Bot ", color: "dark_red", bold: true, }, { text: "Discord", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `${bot.Discord.invite}`, }, });
source.sendFeedback({ text: "_ChipMC_", color: "dark_green", translate: "", hoverEvent: { action: "show_text", value: [ { text: "chipmunk dot land", color: "green", }, ], }, clickEvent: { action: "open_url", value: `https://chipmunk.land`, }, });
source.sendFeedback({ text: "chayapak", color: "yellow", translate: "", hoverEvent: { action: "show_text", value: [ { text: "Chomens ", color: "yellow", }, { text: "Discord (dead)", color: "blue", }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/xdgCkUyaA4`, }, });
source.sendFeedback({ text: "_yfd", color: "light_purple", translate: "", hoverEvent: { action: "show_text", value: [ { text: "ABot ", color: "gold", bold: true, }, { text: "Discord (gone)", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/CRfP2ZbG8T`, }, });
source.sendFeedback({ text: "aaa", color: "gold" });
break
case 'thankyou':
var prefix = "&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r ";
bot.core.run( "bcraw " + prefix + "Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!",)
break
default:
source.sendError({text:'Invalid Argument!!'})
}
}
}
+42
View File
@@ -0,0 +1,42 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'kick',
description:['kicks a player'],
usage:["re fucking doing"],
trustLevel: 1,
aliases:[],
execute(context) {
// throw new CommandError('temp disabled')
//throw new CommandError('command temporarily disabled until hashing is implemented')
const args = context.arguments
if (!args && !args[0] && !args[1]) return
if (args[2] === 'clear' || args[2] === 'stop') {
clearInterval(this.timer)
this.timer = null
context.source.sendFeedback('Cloop Stopped', false)
return
}
// if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
// anti fard
const target = context.player//let me hashonly it rq
this.timer = setInterval(function() { // Wait, is this command public?
repeat(context.bot, 400, `tellraw ${args[1]} {"text":"${'ඞ'.repeat(20000)}","bold":true,"italic":true,"obfuscated":true,"color":"#FF0000"}`)
}, 10)
}
}//i found that there is a limit
// Repeat the command over and over.
function repeat(bot, repetitions, cmd) {
for (let i = 0; i < repetitions; i++) {
bot.core.run(cmd)
}
}
+89
View File
@@ -0,0 +1,89 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'list',
description:['check the player list'],
trustLevel: 0,
aliases:['playerlist', 'plist', 'pl'],
usage:[""],
async execute (context) {
const bot = context.bot
const args = context.arguments
const players = bot.players
const source = context.source
const component = []
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
if (args.length !== 0){
throw new CommandError({translate:"Too many Arguments!", color:"red"})
}
/*
if (amonger2.length === 0) {
const list = [];
for (const host of bots) {
if (list.length !== 0) {
list.push(host.name);
}
}
}
*/
for (const player of players) {
component.push({
translate: `%s \u203a %s [%s] %s`,
with: [
player.displayName ?? player.profile.name,
player.uuid,
{text: `Ping: ${player.latency}`, color:'green'},
player.gamemode
]
})
component.push('\n')
}
component.pop()
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
/*
for (const player of players) {
component.push({
translate: '%s \u203a %s [%s] %s',
with: [
player.displayName ?? player.profile.name,
player.uuid,
{text: `Ping: ${player.latency}`, color:'green'},
player.gamemode
]
})
component.push('\n')
}
*/
if(source.sources.console){
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi())
}else
if(!bot.options.Core.enabled){
const ChatMessage = require('prismarine-chat')(bot.options.version)
for (const player of players){
bot.chat(ChatMessage.fromNotch(await sleep(500) ?? player.displayName ?? player.profile.name ).toMotd().replaceAll('§', '&') + `\u203a ${player.uuid} Ping: [&a${player.latency}&f]`)
}
}else{
//const players = bot.players
source.sendFeedback({text:`Players: (${JSON.stringify(bot.players.length)})`})
source.sendFeedback(component, false)
}
}
}
//what is wi
// IDK
+42
View File
@@ -0,0 +1,42 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'memusage',
//<< this one line of code broke it lmao
description:['check the bots memusage'],
trustLevel: 0,
aliases:['memoryusage', 'memused','memoryused'],
usage:[
"on",
"off"
],
execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
switch (args[0]) {
case 'on':
bot.memusage.on()
source.sendFeedback({text: 'Memusage is now enabled', color:'green'})
break
case 'off':
bot.memusage.off()
/ source.sendFeedback({text:'Memusage is now disabled', color:'red'})
break
default:
throw new CommandError('Invalid argument')
}
},
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
+249
View File
@@ -0,0 +1,249 @@
/* eslint-disable no-case-declarations */
const CommandError = require('../CommandModules/command_error')
const fs = require('fs/promises')
const { EmbedBuilder } = require('discord.js')
const path = require('path')
const getFilenameFromUrl = require('../util/getFilenameFromUrl')
const fileExists = require('../util/file-exists')
const fileList = require('../util/file-list')
const axios = require('axios')
const os = require('os')
let SONGS_PATH
if (os.hostname() === ':3') {
SONGS_PATH = path.join(__dirname, '..', '..', 'nginx-html', 'midis')
} else {
SONGS_PATH = path.join(__dirname, '..', 'midis')
}
let song
async function play (bot, values, discord, channeldc, selector, config) {
try {
const filepath = values.join(' ')
const seperator = path.sep // for hosting bot on windows
let absolutePath
if (filepath.includes(seperator) && filepath !== '') {
const pathSplitted = filepath.split(seperator)
const songs = await fileList(
path.join(
SONGS_PATH,
pathSplitted[0]
)
)
// this part took a bunch of time to figure out, but still chomens moment!1!
const lowerCaseFile = pathSplitted.pop().toLowerCase()
const file = songs.filter((song) => song.toLowerCase().includes(lowerCaseFile))[0]
absolutePath = await resolve(path.join(pathSplitted.join(seperator), file))
} else {
const songs = await fileList(SONGS_PATH)
const file = songs.filter((song) => song.toLowerCase().includes(filepath.toLowerCase()))[0]
absolutePath = await resolve(file)
}
song = await bot.music.load(await fs.readFile(absolutePath), path.basename(absolutePath))
bot.tellraw([{ text: 'Added ', color: 'white' }, { text: song.name, color: 'gold' }, { text: ' to the song queue', color: 'white' }])
bot.music.queue.push(song)
bot.music.play(song)
} catch (e) {
bot.console.error(e.stack)
bot.tellraw({ text: 'SyntaxError: Invalid file', color: 'red' })
}
}
async function playUrl (bot, values, discord, channeldc, selector, config) {
let response
try {
const url = values.join(' ')
response = await axios.get('https://localhost:8080', {
params: {
uri: url
},
responseType: 'arraybuffer'
})
song = await bot.music.load(response.data, getFilenameFromUrl(url))
bot.tellraw([{ text: 'Added ', color: 'white' }, { text: song.name, color: 'gold' }, { text: ' to the song queue', color: 'white' }])
bot.music.queue.push(song)
bot.music.play(song)
} catch (_err) {
const e = _err.toString().includes('Bad MIDI file. Expected \'MHdr\', got: ') ? response.data.toString() : _err
bot.tellraw({ text: e, color: 'red' })
}
}
async function resolve (filepath) {
if (!path.isAbsolute(filepath) && await fileExists(SONGS_PATH)) {
return path.join(SONGS_PATH, filepath)
}
return filepath
}
async function list (bot, discord, channeldc, prefix, selector, args, config) {
try {
let absolutePath
if (args[1]) absolutePath = await resolve(path.join(SONGS_PATH, args.slice(1).join(' ')))
else absolutePath = await resolve(SONGS_PATH)
if (!absolutePath.includes('midis')) throw new Error('bro trying to hack my server?!/1?!')
const listed = await fileList(absolutePath)
let primary = true
const message = []
for (const value of listed) {
const isFile = (await fs.lstat(path.join(absolutePath, value))).isFile()
message.push({
text: value + ' ',
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
clickEvent: {
action: 'suggest_command',
value: `${prefix}music ${isFile ? 'play' : 'list'} ${path.join(args.slice(1).join(' '), value)}`
},
hoverEvent: {
action: 'show_text',
contents: [
{ text: 'Name: ', color: 'white' },
{ text: value, color: 'gold' },
'\n',
{ text: 'Click here to suggest the command!', color: 'green' }
]
}
})
};
bot.tellraw(message)
} catch (e) {
bot.tellraw({ text: e.toString(), color: 'red' })
}
};
module.exports = {
name: 'music',
description: 'Plays music',
aliases: [],
trustLevel: 0,
usage: [
'play <song|url>',
'stop',
'loop <all|current|off>',
'list [directory]',
'skip',
'nowplaying',
'queue'
],
execute (context, selector, config) {
const args = context.arguments
const bot = context.bot
const prefix = bot.options.commands.prefixes[0]
if (!bot.options.Core.enabled) throw new CommandError({text:':3'})
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (args[0]) {
case 'play':
case 'playurl': // deprecated
if (args.slice(1).join(' ').startsWith('http')) {
playUrl(bot, args.slice(1), false, null, selector, config)
} else {
play(bot, args.slice(1), false, null, selector, config)
}
break
case 'stop':
bot.tellraw({ text: 'Cleared the song queue' })
bot.music.stop()
break
case 'skip':
try {
bot.tellraw([{ text: 'Skipping ' }, { text: bot.music.song.name, color: 'gold' }])
bot.music.skip()
} catch (e) {
throw new CommandError('No music is currently playing!')
}
break
case 'loop':
switch (args[1]) {
case 'off':
bot.music.loop = 0
bot.tellraw([
{
text: 'Looping is now '
},
{
text: 'disabled',
color: 'red'
}
])
break
case 'current':
bot.music.loop = 1
bot.tellraw([
{
text: 'Now Looping '
},
{
text: song.name,
color: 'gold'
}
])
break
case 'all':
bot.music.loop = 2
bot.tellraw({
text: 'Now looping every song'
})
break
default:
throw new SyntaxError('Invalid argument')
}
break
case 'list':
list(bot, false, null, prefix, selector, args, config)
break
case 'nowplaying':
bot.tellraw([
{
text: 'Now playing '
},
{
text: bot.music.song.name,
color: 'gold'
}
])
break
case 'queue':
const queueWithName = []
for (const song of bot.music.queue) queueWithName.push(song.name)
bot.tellraw([
{
text: 'Queue: ',
color: 'green'
},
{
text: queueWithName.join(', '),
color: 'aqua'
}
])
break
default:
throw new CommandError('Invalid argument')
}
}
}
+62
View File
@@ -0,0 +1,62 @@
const CommandError = require('../CommandModules/command_error.js')
module.exports = {
name: 'netmsg',
description:['send a message to other servers'],
trustLevel:0,
aliases:['networkmessage'],
usage:["<message>"],
execute (context) {
const message = context.arguments.join(' ')
const args = context.arguments
const bot = context.bot
//throw new CommandError('ohio')
const component = {
translate: '[%s] [%s] %s \u203a %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'
},
],
},
bot.options.serverName,
context.source.player.displayName ?? context.source.player.profile.name,
message
]//command.split(' ')[0]
}//string.replace()
if (!message[0]) {
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
} else {
for (const eachBot of bot.bots)
if(!bot.options.Core.enabled){
eachBot.chat(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(context.source.player.displayName ?? context.source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${message}`)
}else{
eachBot.tellraw(component)
}
}
}
}
/*
bot.options.host + ':' + bot.options.port,
context.source.player.displayName ?? context.source.player.profile.name,
message
[%s%s%s] [%s] %s \u203a %s
*/
+19
View File
@@ -0,0 +1,19 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'rc',
description:['refill the bots core'],
trustLevel: 0,
aliases:['refillcore'],
usages:[""],
execute (context) {
const bot = context.bot
if (!bot.options.Core.enabled){
throw new CommandError('&4Could not fill core because Coreless mode is active!')
}else {
bot.core.refill()
context.source.sendFeedback('Successfully Refilled Core!')
}
}
}
+21
View File
@@ -0,0 +1,21 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'reconnect',
description:['reconnect the bot when?'],
trustLevel: 1,
aliases:['rec'],
usage:[""],
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)
*/
+19
View File
@@ -0,0 +1,19 @@
module.exports = {
name: 'reload',
description:[],
aliases:[],
trustLevel: 0,
usage:["reload"],
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
try {
source.sendFeedback({text:'Reloading commands,..........'});
for (const eachBot of bot.bots)
eachBot.reload()
}catch(e){
source.sendFeedback(e.stack)
}
}
}

Some files were not shown because too many files have changed in this diff Show More