Compare commits

...

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

111 changed files with 748 additions and 15645 deletions

9
.gitignore vendored
View file

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

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())
})

2974
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,25 +0,0 @@
{
"dependencies": {
"color-convert": "^2.0.1",
"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",
"proxy-agent": "^6.4.0",
"socks": "^2.8.3",
"wikipedia": "^2.1.2",
"xml2js": "^0.6.2"
}
}

View file

@ -1,2 +0,0 @@
this folder is for removed / scrapped concepts just in case people want to reimplement them

View file

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

View file

@ -1,64 +0,0 @@
const bots = require('../../data/bots.json');
const CommandError = require('../../util/command_error')
module.exports = {
data: {
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,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,114 +0,0 @@
const trustedPlayers = require('../data/trustedPlayers.json');
module.exports = (bot, options, config) => {
let component;
trustedPlayers.map((trusted) => {
/*component.push({
translate: "%s",
color: config.colors.commands.tertiary,
with: [
{ text: "ea" }
]
})*/
bot.on('message', (data) => {
try {
let stringMessage = bot.getMessageAsPrismarine(data)?.toString();
// console.log(JSON.stringify(data))
// console.log(data?.with[0]?.clickEvent);
// console.log(data.color);
// for (const players of bot.players) {
if (
/*
stringMessage.startsWith(`${trusted.player}`) &&
data.translate === "multiplayer.player.joined" &&
data.color === "yellow" &&
data.with.insertion === `${trusted.player}` &&
data?.with[0]?.clickEvent === `{action:'suggest_command',value:'/tell ${trusted.player} '}` &&*/
JSON.stringify(data) ===
JSON.stringify({
color:'yellow',
translate:'multiplayer.player.joined',
with:[{insertion:`${trusted.player}`,
clickEvent:{
action:'suggest_command',
value:`/tell ${trusted.player} `
},
hoverEvent:{
action:'show_entity',
contents:{
type:'minecraft:player',
id:`${bot.players.find((player) => player.profile.name === trusted.player)?.uuid}`,
name:{
text:`${trusted.player}`
}
}
},
text:`${trusted.player}`
}]
})
) {
if (bot.players.map((e) => { e.profile.name === trusted.player })) {
bot.tellraw(`@a[name="${trusted.player}"]`, "e");
component = "e";
}
}
// bot.tellraw(`@a[name="${bot.players.find((player) => player.profile.name === trusted.player).profile.name}"]`, component);
/* for (const players of bot.players) {
// console.log(players);
if (players.profile.name === trusted.player) {
let e = players.profile.name === trusted.player;
for (const eachBot of bot.bots) {
eachBot.tellraw(`@a[name="${trusted.player}"]`, "e");
}
}*/
// }
//if (bot.players.find((player) => player.profile.name !== trusted.player)) return
//for (const eachBot of bot.bots) {
// if (bot.players.find((player) => player.profile.name === trusted.player)) {
// bot.tellraw(`@a[name="${bot.players.find((player) => player.profile.name === trusted.player).profile.name}"]`, "e");
// }
//}
// bot.chat.message(`${trusted.player} joined the game`);
// }
// }
} catch (e) {
console.log(e.stack);
}
})
})
/* bot.on('packet.login', (data) => {
console.log(bot.players.find((players) => players.profile.name === trusted.player))
console.log(bot.players)
if (bot.players.find((player) => player.profile.name === trusted.player)) {
bot.chat.message('player joined the game')
}
})
multiplayer.player.joined
[{"insertion":"Parker2991","clickEvent":{"action":"suggest_command",
"value":"/tell Parker2991 "},"hoverEvent":{"action":"show_entity",
"contents":{"type":"minecraft:player",
"id":"85f5b68d-a567-3877-9701-3cd7404bc9d9",
"name":{"text":"Parker2991"}}},"text":"Parker2991"}]
[
{
insertion: 'Parker2991',
clickEvent: { action: 'suggest_command', value: '/tell Parker2991 ' },
hoverEvent: { action: 'show_entity', contents: [Object] },
text: 'Parker2991'
}
]
yellow
*/
/*for (const trusted in trustedPlayers) {
component.push({
translate: '%s',
color: config.colors.commands.tertiary,
with: [
{ text: 'e' }
]
})
// console.log(component)
}*/
// bot.tellraw("@a", component)
}

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,81 +0,0 @@
const mc = require('minecraft-protocol');
const { EventEmitter } = require('events');
EventEmitter.defaultMaxListeners = 5e6;
const util = require('util');
const ChatMessage = require('prismarine-chat');
function createBot(options = {}, config) {
let endCount = 0;
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;
// 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', (data) => {
bot.uuid = client.uuid
bot.username = client.username
bot.registry = require('prismarine-registry')(client.version);
bot.registry.language = require('./data/language.json');
bot.emit('registry_ready', bot.registry);
})
client.on('disconnect', data => {
bot.emit("disconnect", data);
bot.console.warn(`${ChatMessage(bot._client.version).fromNotch("§8[§bClient Reconnect§8]§r")?.toAnsi()} ${ChatMessage(bot._client.version).fromNotch(data.reason)?.toAnsi()}`)
})
client.on('end', reason => {
bot.emit('end', reason);
if (reason === "socketClosed") return;
bot.console.warn(ChatMessage(bot._client.version).fromNotch(`§8[§bClient Reconnect§8]§r ${reason}`)?.toAnsi());
})
client.on('error', error => {
endCount++
if (endCount === 10) {
bot.console.info('stopped logging disconnect messages for now...');
bot?.discord?.channel?.send('stopped logging disconnect messages for now...');
return;
} else if (endCount > 10) {
return;
} else {
bot.console.warn(ChatMessage(bot._client.version).fromNotch('§8[§bClient Reconnect§8]§r ')?.toAnsi() + util.inspect(error.toString()))
bot?.discord?.channel?.send(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(bot._client.version).fromNotch("§8[§bClient Reconnect§8]§r")?.toAnsi()} ${ChatMessage(bot._client.version).fromNotch(data.reason)?.toAnsi()}`)
bot?.discord?.channel?.send(util.inspect(data.reason))
})
client.on('success', (data) => {
endCount = 0;
})
process.on("uncaughtException", (e) => {
// console?.warn(e.stack)
});
})
const client = options.client ?? new mc.createClient(bot.options)
bot._client = client
bot.emit('init_client', client)
bot.bots = options.bots ?? [bot]
return bot
}
module.exports = createBot;

View file

@ -1,102 +0,0 @@
const CommandError = require('../../util/command_error');
module.exports = {
data: {
name: 'coresettings',
trustLevel: 2,
aliases: [
"cbsettings"
],
description: 'change the bots core settings',
usages: [
"useplacedcommandblock <on/off/true/false/enable/disable>",
"area start <positions>",
"area end <positions>",
"refillmethod/rcmethod <item/chat>"
],
},
execute (context) {
const bot = context.bot
const args = context.arguments;
const config = context.config;
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] && !args[5]) return;
switch (args[1]?.toLowerCase()) {
case "useplacedcommandblock":
switch (args[2]?.toLowerCase()) {
case "on":
case "true":
case "enable":
bot.core.usePlacedCommandBlock = true;
bot.chat.message('now using the placed command block');
break;
case "off":
case "false":
case "disable":
bot.core.usePlacedCommandBlock = false;
bot.chat.message('no longer using the placed command block');
break;
default:
if (bot.core.usePlacedCommandBlock) {
bot.chat.message("the bot is currently using the placed command block to run its commands");
} else {
bot.chat.message("the bot is currently using its command block core to run its commands");
}
}
break;
case "area":
switch (args[2]?.toLowerCase()) {
case "start":
if (isNaN(args[3]) || isNaN(args[4]) || isNaN(args[5])) {
bot.core.area.start = config.core.area.start;
bot.chat.message("arguments were NaN, defaulting to config core start coords");
} else {
bot.core.area.start = {
x: Number(args[3]),
y: Number(args[4]),
z: Number(args[5])
};
bot.chat.message(`setting core start pos to x: ${args[3]}, y: ${args[4]}, z: ${args[5]}`);
}
break;
case "end":
if (isNaN(args[3]) || isNaN(args[4]) || isNaN(args[5])) {
bot.core.area.end = config.core.area.end;
bot.chat.message("arguments were NaN, defaulting to config core end coords");
} else {
bot.core.area.end = {
x: Number(args[3]),
y: Number(args[4]),
z: Number(args[5])
};
bot.chat.message(`setting core end pos to x: ${args[3]}, y: ${args[4]}, z: ${args[5]}`);
}
break;
default:
bot.chat.message(`core start pos: x: ${bot.core.area.start.x}, y: ${bot.core.area.start.y}, z: ${bot.core.area.start.z}, and end pos: x: ${bot.core.area.end.x}, y: ${bot.core.area.end.y}, z: ${bot.core.area.end.z} `)
}
break;
case "refillmethod":
case "rcmethod":
switch (args[2]?.toLowerCase()) {
case "item":
config.core.itemRefill = true;
bot.chat.message('now refilling via item');
break;
case "chat":
config.core.itemRefill = false;
bot.chat.message('now refilling via chat');
break;
default:
if (config.core.itemRefill) {
bot.chat.message("currently filling core via item");
} else {
bot.chat.message("currently filling core via chat");
}
}
break;
default:
throw new CommandError('invalid argument');
}
},
}

View file

@ -1,32 +0,0 @@
module.exports = {
data: {
name: 'vanish',
trustLevel: 2,
aliases: [
"vanishtoggle"
],
description: 'toggle the bots vanish selfcare',
usages: [
],
},
execute (context) {
const bot = context.bot
const args = context.arguments;
if (args.slice(1).join('') === 'true') {
bot.vanished = true
bot.chat.message('enabled vanish selfcare')
}
if (args.slice(1).join('') === 'false') {
bot.vanished = false;
bot.chat.message('disabled vanish selfcare')
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
bot.vanished = false;
bot.chat.message('disabling vanish selfcare,...');
bot.chat.command('v off')
}
}

View file

@ -1,126 +0,0 @@
module.exports = {
data: {
name: 'console',
trustLevel: 4,
description: "",
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(' ')}`)
}
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.trusted} ${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,23 +0,0 @@
module.exports = {
data: {
name: 'kill',
trustLevel: 3,
aliases: [
"suicide",
"quit",
],
description: 'kill the bots process',
usages: [
""
],
},
execute (context) {
const bot = context.bot;
process.exit(1);
},
discordExecute (context) {
const bot = context.bot;
process.exit(1)
}
}

View file

@ -1,50 +0,0 @@
const CommandError = require('../../util/command_error.js');
const { stylize } = require('../../util/stylizeEval');
const util = require('util');
module.exports = {
data: {
name: 'servereval',
trustLevel: 3,
aliases: [
"se"
],
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,27 +0,0 @@
const CommandError = require('../../util/command_error')
module.exports = {
data: {
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,81 +0,0 @@
const cowsay = require('cowsay2');
const cows = require('cowsay2/cows');
const { EmbedBuilder } = require('discord.js');
const fixansi = require('../../util/ansi');
module.exports = {
data: {
name: 'cowsay',
trustLevel: 0,
aliases: [
],
description: 'cows',
usages: [
"<message>",
"list"
],
},
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.data.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.data.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,32 +0,0 @@
module.exports = {
data: {
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
}
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,482 +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 = {
data: {
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.data.usages) {
if (command?.data?.trustLevel === 1) {
usagesComponent.push({
translate: "%s%s %s",
with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.data.name} <trusted/admin/owner hashes>`, color: "blue" },
{ text: `${usages}`, color: "aqua" },
]
})
} else if (command?.data.trustLevel === 2) {
usagesComponent.push({
translate: "%s%s %s",
with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.data.name} <admin/owner hashes>`, color: "blue" },
{ text: `${usages}`, color: "aqua" },
]
})
} else if (command?.data.trustLevel === 3) {
usagesComponent.push({
translate: "%s%s %s",
with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.data.name} <owner hash>`, color: "blue" },
{ text: `${usages}`, color: "aqua" },
]
})
} else if (command?.data.trustLevel === 0 || command.data.trustLevel === 4) {
usagesComponent.push({
translate: "%s%s %s",
with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.data.name}`, color: "blue" },
{ text: `${usages}`, 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.data.name}`, color: "blue" },
{ text: "Aliases", color: "dark_blue" },
{ text: "\u203a" },
{ text: `${command.data.aliases.toString().replaceAll(',',' ')}`, color: "blue" },
{ text: "Description", color: "dark_blue" },
{ text: "\u203a" },
{ text: `${command.data.description}`, color: "blue" },
{ text: "Trust Level", color: "dark_blue" },
{ text: "\u203a" },
{ text: `${command.data.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.data.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)*/
// }
// tellraw @p {"text":"this","clickEvent":{"action":"suggest_command","value":"this"}}
if (command.data.trustLevel === 0) {
public.push([
{
text: command.data.name + ' ',
color: "aqua",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command: ${command.data.name}\n`,
color: 'blue'
},
{
text: `Trust Level: `,
color: 'blue'
},
{
text: `${command.data.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.data.description}\n`,
color: 'blue'
},
{
text: `Command Aliases: ${command.data.aliases}\n`,
color: 'blue'
},
{
text: 'click on me to use me :)',
color: 'dark_blue',
},
],
},
clickEvent: {
action: 'suggest_command',
value: `${config.prefixes[0]}${command?.data.name}`
}
}
])
} else if (command.data.trustLevel === 1) {
trusted.push([
{
text: command.data.name + ' ',
color: "dark_aqua",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command: ${command.data.name}\n`,
color: 'blue'
},
{
text: `Trust Level: `,
color: 'blue'
},
{
text: `${command.data.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.data.description}\n`,
color: 'blue'
},
{
text: `Command Aliases: ${command.data.aliases}\n`,
color: 'blue'
},
{
text: 'click on me to use me :)',
color: 'dark_blue',
},
],
},
clickEvent: {
action: 'suggest_command',
value: `${config.prefixes[0]}${command?.data.name}`
}
}
])
} else if (command.data.trustLevel === 2) {
admin.push([
{
text: command.data.name + ' ',
color: "blue",
translate: "",
hoverEvent: {
action:"show_text",
value: [
{
text: `Command: ${command.data.name}\n`,
color: 'blue'
},
{
text: `Trust Level: `,
color: 'blue'
},
{
text: `${command.data.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.data.description}\n`,
color: 'blue'
},
{
text: `Command Aliases: ${command.data.aliases}\n`,
color: 'blue'
},
{
text: 'click on me to use me :)',
color: 'dark_blue',
},
],
},
clickEvent: {
action: 'suggest_command',
value: `${config.prefixes[0]}${command?.data.name}`
}
}
])
} else if (command.data.trustLevel === 3) {
owner.push([
{
text: command.data.name + ' ',
color: "dark_blue",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command: ${command.data.name}\n`,
color: 'blue'
},
{
text: `Trust Level: `,
color: 'blue'
},
{
text: `${command.data.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.data.description}\n`,
color: 'blue'
},
{
text: `Command Aliases: ${command.data.aliases}\n`,
color: 'blue'
},
{
text: 'click on me to use me :)',
color: 'dark_blue',
},
],
},
clickEvent: {
action: 'suggest_command',
value: `${config.prefixes[0]}${command?.data.name}`
}
}
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.data.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 (bot.options.isCreayun) {
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("§","&"))
}, 2500)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(trusted)?.toMotd().replaceAll("§","&"));
}, 2500)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(admin)?.toMotd()?.replaceAll('§','&'))
}, 2500)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(owner).toMotd().replaceAll("§","&"));
}, 2500)
} 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.data.name) {
const ansi = bot.getMessageAsPrismarine([ { text: `CommandName \u203a ${command.data.name}\n`, color: 'gray', }, { text: `Aliases \u203a ${command.data.aliases}\n`, color: 'gray', }, { text: `Description \u203a ${command.data.description}\n`, color: 'gray', }, { text: `trustLevel \u203a ${command.data.trustLevel}\n`, color: 'gray' }, { text: `Usages \u203a ${command?.data.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.data.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
return
}
if (command?.data.trustLevel === 0 && command.discordExecute) {
public.push([
{
text: command.data.name + ' ',
color: "aqua",
}
])
} else if (command?.data.trustLevel === 1 && command.discordExecute) {
trusted.push([
{
text: command.data.name + ' ',
color: "dark_aqua"
}
])
} else if (command?.data.trustLevel === 2 && command.discordExecute) {
admin.push([
{
text: command.data.name + ' ',
color: 'blue'
}
])
} else if (command?.data.trustLevel === 3 && command.discordExecute) {
owner.push([
{
text: command.data.name + ' ',
color: "dark_blue",
}
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.data.trustLevel !== 4 && c.discordExecute).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.data.name} Command`)
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
bot?.discord?.message.react('♋')
}
}

View file

@ -1,363 +0,0 @@
const os = require("os");
const CommandError = require('../../util/command_error');
const fs = require("fs");
const botInfo = require('../../../package-lock.json');
const fixansi = require('../../util/ansi.js');
const { EmbedBuilder } = require('discord.js');
const { execSync } = 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 = {
data: {
name: 'info',
trustLevel: 0,
aliases: [
"information",
],
description: 'check the bots info',
usages: [
"about",
"config <client, discord, options, all>",
"contributors/credits",
"discord",
"usages <bot, server, all>",
"uptimes/uptime <bot, server, all>",
"server",
"version/ver",
],
},
execute (context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
const discordClient = context.discordClient;
const source = context.source;
let component = [];
switch (args[0]?.toLowerCase()) {
case "about":
component.push({
text: `FNFBoyfriendBot is a kaboom bot created by Parker2991\nThe source code and changelog can be found here ${botInfo.buildstring.url}`,
color: `${config.colors.commands.primary}`,
translate: "",
hoverEvent: {
action: "show_text",
value: [
{ text: "click here to view bots source code", color: `${config.colors.commands.primary}` }
]
},
clickEvent: {
action: "open_url",
value: `${botInfo.buildstring.url}`
}
})
break;
case "config":
if (bot.options.isKaboom) {
mode = "Kaboom";
} if (bot.options.useChat && bot.options.isKaboom) {
mode = "Kaboom/Coreless";
} if (bot.options.isSavage) {
mode = "Savage";
} if (bot.options.isCreayun) {
mode = "Creayun";
}
switch (args.slice(1).join(' ')?.toLowerCase()) {
case "client":
component.push({
translate: "%s: %s:%s\n%s: %s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Server", color: config.colors.commands.primary },
{ text: `${bot.options.host}`, color: config.colors.commands.secondary },
{ text: `${bot.options.port}`, color: config.colors.integer },
{ text: "Server Name", color: config.colors.commands.primary },
{ text: `${bot.options.serverName}`, color: config.colors.commands.secondary },
{ text: "Minecraft Username", color: config.colors.commands.primary },
{ text: `${bot.options.username}`, color: config.colors.commands.secondary },
{ text: "Version", color: config.colors.commands.primary },
{ text: `${bot.options.version}`, color: config.colors.integer },
]
})
break;
case "discord":
if (!config.discord.enabled || discordClient.user === null) {
throw new CommandError('Token is incorrect or discord isnt enabled!')
} else {
component.push({
translate: "%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Discord Username", color: config.colors.commands.primary },
{ text: `${discordClient.user.tag}`, color: config.colors.commands.secondary },
{ text: "Discord Channel", color: config.colors.commands.primary },
{ text: `${bot.discord?.channel?.name}`, color: config.colors.commands.secondary },
]
})
}
break;
case "options":
component.push({
translate: "%s: %s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Server Count", color: config.colors.commands.primary },
{ text: `${bot.bots.length}`, color: config.colors.integer },
{ text: "Prefixes", color: config.colors.commands.primary },
{ text: `${config.prefixes.map((e) => e + " ").join(' ')}`, color: config.colors.commands.secondary },
{ text: "Mode", color: config.colors.commands.primary },
{ text: `${mode}`, color: config.colors.commands.secondary },
]
})
break;
case "all":
component.push({
translate: "%s: %s:%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Server", color: config.colors.commands.primary },
{ text: `${bot.options.host}`, color: config.colors.commands.secondary },
{ text: `${bot.options.port}`, color: config.colors.integer },
{ text: "Server Name", color: config.colors.commands.primary },
{ text: `${bot.options.serverName}`, color: config.colors.commands.secondary },
{ text: "Minecraft Username", color: config.colors.commands.primary },
{ text: `${bot.options.username}`, color: config.colors.commands.secondary },
{ text: "Version", color: config.colors.commands.primary },
{ text: `${bot.options.version}`, color: config.colors.commands.secondary },
{ text: "Discord Username", color: config.colors.commands.primary },
{ text: `${discordClient.user?.tag}`, color: config.colors.commands.secondary },
{ text: "Discord Channel", color: config.colors.commands.primary },
{ text: `${bot.discord.channel?.name}`, color: config.colors.commands.secondary },
{ text: "Server Count", color: config.colors.commands.primary },
{ text: `${bot.bots.length}`, color: config.colors.integer },
{ text: "Prefixes", color: config.colors.commands.primary },
{ text: `${config.prefixes.map((e) => e + " ").join(' ')}`, color: config.colors.commands.secondary },
{ text: "Mode", color: config.colors.commands.primary },
{ text: `${mode}`, color: config.colors.commands.secondary }
]
})
break;
default:
throw new CommandError({ translate: "command.unknown.argument", color: "dark_red" });
}
break;
case "contributors":
case "credits":
component.push({
translate: "%s%s - %s\n%s:\n%s\n%s\n%s\n%s\n%s %s\n%s\n%s",
color: config.colors.commands.tertiary,
with: [
{ text: "Parker", color: "dark_red" },
{ text: "2991", color: "black" },
{ text: "Owner" },
{ text: "Contributors" },
{ text: "_ChipMC_", color: "dark_blue" },
{ text: "chayapak", color: "yellow" },
{ text: "_yfd", color: "light_purple" },
{ text: "aaa", color: "gold" },
{ text: "Morgan", color: "green" },
{ text: "Ankan", color: "dark_green" },
{ text: "TurtleKid", color: "green" },
{ text: "Ploat/ImGloriz", color: "#cd8ccb" },
]
})
break;
case "discord":
component.push({
text: `the discord server invite is ${config.discord.invite}`,
color: config.colors.commands.primary,
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: "click here to join the discord server!",
color: config.colors.commands.secondary,
}
]
},
clickEvent: {
action: "open_url",
value: `${config.discord.invite}`
}
})
break;
case "usages":
case "usage":
switch (args.slice(1).join(' ')?.toLowerCase()) {
case "bot":
component.push({
translate: "%s: %s %s / %s %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Bot Memory Usage", color: config.colors.commands.primary },
{ text: `${Math.floor(process.memoryUsage().heapUsed / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
{ text: `${Math.floor(process.memoryUsage().heapTotal / 1048576 )}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary }
]
})
break;
case "server":
component.push({
translate: "%s: %s %s / %s %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Free Server Memory", color: config.colors.commands.primary },
{ text: `${Math.floor(os.freemem() / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
{ text: `${Math.floor(os.totalmem() / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
]
})
break;
case "all":
component.push({
translate: "%s: %s %s / %s %s\n%s: %s %s / %s %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Free Server Memory", color: config.colors.commands.primary },
{ text: `${Math.floor(os.freemem() / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
{ text: `${Math.floor(os.totalmem() / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
{ text: "Bot Memory Usage", color: config.colors.commands.primary },
{ text: `${Math.floor(process.memoryUsage().heapUsed / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
{ text: `${Math.floor(process.memoryUsage().heapTotal / 1048576 )}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary }
]
})
break;
default:
throw new CommandError({ translate: "command.unknown.argument", color: "dark_red" });
}
break;
case "uptimes":
switch (args.slice(1).join(' ')?.toLowerCase()) {
case "bot":
component.push({
translate: "%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Bot Uptime", color: config.colors.commands.primary },
{ text: `${format(process.uptime())}`, color: config.colors.commands.secondary },
]
})
break;
case "server":
component.push({
translate: "%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Server Uptime", color: config.colors.commands.primary },
{ text: `${format(os.uptime())}`, color: config.colors.commands.secondary },
]
})
break;
case "all":
component.push({
translate: "%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Bot Uptime", color: config.colors.commands.primary },
{ text: `${format(process.uptime())}`, color: config.colors.commands.secondary },
{ text: "Server Uptime", color: config.colors.commands.primary },
{ text: `${format(os.uptime())}`, color: config.colors.commands.secondary },
]
})
break;
throw new CommandError({ translate: "command.unknown.argument", color: "dark_red" });
}
break;
case "server":
component.push({
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
color: config.colors.commands.tertiary,
with: [
{ text: "Hostname", color: config.colors.commands.primary },
{ text: `${os.hostname()}`, color: config.colors.commands.secondary },
{ text: "User", color: config.colors.commands.primary },
{ text: `${os.userInfo().username}`, color: config.colors.commands.secondary },
{ text: "Working Directory", color: config.colors.commands.primary },
{ text: `${process.mainModule.path}`, color: config.colors.commands.secondary },
{ text: "Arch", color: config.colors.commands.primary },
{ text: `${os.arch()}`, color: config.colors.commands.secondary },
{ text: "OS", color: config.colors.commands.primary },
{ text: `${os.platform}`, color: config.colors.commands.secondary },
{ text: "OS Version", color: config.colors.commands.primary },
{ text: `${os.version()}`, color: config.colors.commands.secondary },
{ text: "Kernel Version", color: config.colors.commands.primary },
{ text: `${os.release()}`, color: config.colors.commands.secondary },
{ text: "CPU", color: config.colors.commands.primary },
{ text: `${os.cpus()[0].model}`, color: config.colors.commands.secondary },
{ text: "CPU cores", color: config.colors.commands.primary },
{ text: `${os.cpus().length}`, color: config.colors.integer },
{ text: "Node Version", color: config.colors.commands.primary },
{ text: `${process.version}`, color: config.colors.commands.secondary },
{ text: "NPM Version", color: config.colors.commands.primary },
{ text: `${execSync('npm -v').toString().replaceAll('\n', '')}`, color: config.colors.commands.secondary },
]
})
break;
case "version":
case "ver":
if (botInfo.buildstring.codename.length > 0) {
component.push({
translate: "%s %s %s-%s-%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s-%s",
color: config.colors.commands.tertiary,
with: [
{ text: "Friday Night Funkin", color: "dark_blue" },
{ text: "Boyfriend", color: "dark_aqua" },
{ text: "Bot", color: "blue" },
{ text: `${botInfo.buildstring.version}`, color: config.colors.integer },
botInfo.buildstring.codename,
{ text: "Build", color: config.colors.commands.primary },
{ text: `${botInfo.buildstring.build}`, color: config.colors.integer },
{ text: "Repo Build", color: config.colors.commands.primary },
{ text: `${execSync('git rev-list --count --all').toString().replaceAll('\n','')}`, color: config.colors.integer },
{ text: "Version Release Date", color: config.colors.commands.primary },
{ text: `${new Date(execSync('git log -1 --format=%ci').toString()).toLocaleString("en-US", {timeZone: "America/CHICAGO"})}`, color: config.colors.commands.secondary },
{ text: "Commit", color: config.colors.commands.primary },
{ text: `${execSync("git rev-parse HEAD").toString().substring(0, 10)}`, color: config.colors.commands.secondary },
{ text: `${new Date().toLocaleDateString("en-US",{timeZone:"America/CHICAGO"})}`, color: config.colors.commands.secondary },
]
});
} else {
component.push({
translate: "%s %s %s-%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s-%s",
color: config.colors.commands.tertiary,
with: [
{ text: "Friday Night Funkin", color: "dark_blue" },
{ text: "Boyfriend", color: "dark_aqua" },
{ text: "Bot", color: "blue" },
{ text: `${botInfo.buildstring.version}`, color: config.colors.integer },
{ text: "Build", color: config.colors.commands.primary },
{ text: `${botInfo.buildstring.build}`, color: config.colors.integer },
{ text: "Repo Build", color: config.colors.commands.primary },
{ text: `${execSync('git rev-list --count --all').toString().replaceAll('\n','')}`, color: config.colors.integer },
{ text: "Version Release Date", color: config.colors.commands.primary },
{ text: `${new Date(execSync('git log -1 --format=%ci').toString()).toLocaleString("en-US", {timeZone: "America/CHICAGO"})}`, color: config.colors.commands.secondary },
{ text: "Commit", color: config.colors.commands.primary },
{ text: `${execSync("git rev-parse HEAD").toString().substring(0, 10)}`, color: config.colors.commands.secondary },
{ text: "11/22/22", color: config.colors.commands.primary },
{ text: `${new Date().toLocaleDateString("en-US",{timeZone:"America/CHICAGO"})}`, color: config.colors.commands.secondary },
]
});
}
break;
default:
throw new CommandError({ translate: "command.unknown.argument", color: "dark_red" });
}
bot.tellraw(`@a[name="${source.player.profile.name}"]`, component);
},
}

View file

@ -1,101 +0,0 @@
const CommandError = require('../../util/command_error');
const { EmbedBuilder } = require('discord.js');
const fixansi = require('../../util/ansi');
module.exports = {
data: {
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').substring(0, 3080))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.data.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
}
}

View file

@ -1,94 +0,0 @@
const { request } = require('undici');
const CommandError = require('../../util/command_error.js');
const mc = require('minecraft-protocol');
const util = require('util')
module.exports = {
data: {
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,32 +0,0 @@
module.exports = {
data: {
name: 'memusage',
trustLevel: 0,
aliases: [
],
description: 'check the bots and the servers ram usage',
usages: [
"on/enable/true",
"off/disable/false",
],
},
execute (context) {
const bot = context.bot
const args = context.arguments;
switch (args[0]?.toLowerCase()) {
case "on":
case "enable":
case "true":
bot.memUsage.enabled = true;
bot.chat.message('enabled memusage');
break;
case "off":
case "enable":
case "false":
bot.memUsage.enabled = false;
bot.chat.message('disabled memusage');
break;
throw new CommandError({ translate: "command.unknown.argument", color: "dark_red" });
}
},
}

View file

@ -1,96 +0,0 @@
const CommandError = require('../../util/command_error.js')
module.exports = {
data: {
name: 'netmsg',
trustLevel: 0,
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 (bot.options.private) {
component = {
translate: '[%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.serverName, color: "blue" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "blue" },
]
}
} else if (!bot.options.private) {
component = {
translate: '[%s:%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.host, color: "blue" },
{ text: `${bot.options.port}`, color: "gold" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "blue" },
]
}
}
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;
if (bot.options.private) {
component = {
translate: '[%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.serverName, color: "blue" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "blue" },
]
}
} else if (!bot.options.private) {
component = {
translate: '[%s:%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.host, color: "blue" },
{ text: `${bot.options.port}`, color: "gold" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "blue" },
]
}
}
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,27 +0,0 @@
module.exports = {
data: {
name: 'refillcore',
trustLevel: 0,
aliases: [
"rc",
"refill",
],
description: 'refill the bots core',
usages: [
],
},
execute (context) {
const bot = context.bot;
const config = context.config;
bot.core.move();
bot.tellraw("@a", "Refilling core,...")
},
discordExecute (context) {
const bot = context.bot;
const config = context.config;
bot.core.move();
bot.tellraw("@a", "Refilling core,...");
}
}

View file

@ -1,46 +0,0 @@
const CommandError = require('../../util/command_error');
module.exports = {
data: {
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
}
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,88 +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 = {
data: {
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,67 +0,0 @@
const CommandError = require('../../util/command_error');
const { request } = require('undici');
module.exports = {
data: {
name: 'weather',
trustLevel: 0,
aliases: [
],
description: 'check the weather of cities',
usages: [
"<city/zipcode>"
],
},
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(' ')?.replaceAll(' ', ',')}`);
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.commands.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,32 +0,0 @@
const wiki = require('wikipedia');
const CommandError = require('../../util/command_error');
const { EmbedBuilder } = require('discord.js');
module.exports = {
data: {
name: 'wiki',
description: 'wikipedia',
trustLevel: 0,
aliases: [
'wikipedia'
],
usages:[
"<article>"
],
},
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: 'Article not found!', color: 'dark_red' })
} else {
bot.tellraw(`@a`, `${error.toString()}`)
}
}
}
}

View file

@ -1,161 +0,0 @@
const { EmbedBuilder } = require('discord.js');
const CommandError = require('../../util/command_error');
module.exports = {
data: {
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 (isNaN(args[2])) throw new CommandError({ text: 'Invalid interval', color: 'red' })
//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,47 +0,0 @@
const CommandError = require('../../util/command_error');
const { EmbedBuilder } = require('discord.js');
module.exports = {
data: {
name: 'kick',
trustLevel: 1,
aliases: [
],
description: 'kick or crash players',
usages: [
"invalidstring <player>",
"item <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
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,23 +0,0 @@
module.exports = {
data: {
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,60 +0,0 @@
const between = require('../../util/between')
const CommandError = require('../../util/command_error')
module.exports = {
data: {
name: 'tpr',
description: 'teleport to very fucked up coords',
trustLevel: 1,
aliases: [
'rtp',
'teleportrandom',
'randomteleport'
],
usages: [
""
],
},
execute (context) {
const bot = context.bot
const args = context.arguments;
const source = context.source
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);
}
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,41 +0,0 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
data: {
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}` || role.name === `${config.discord.roles.fullAccess}`)) {
bot.discord.message.reply('Valid Owner user')
bot.chat.message(`Valid Owner User [${bot.discord.message.member.user.username}]`);
}
}
}

View file

@ -1,108 +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 = {
data: {
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.data.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.datta.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,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,19 +0,0 @@
module.exports = {
data: {
name: '<command name>',
trustLevel: 0, // trust levels: 0, 1, 2, 3, 4
aliases: [
""
],
description: '',
usages: [
""
],
},
execute (context) {
},
discordExecute (context) {
}
}

View file

@ -1,95 +0,0 @@
prefixes:
- "!"
discord:
token: "discord token here"
prefix: "!"
invite: "discord invite here"
enabled: false
roles:
trusted: "trusted"
admin: "admin"
fullAccess: "full access"
owner: "FNFBoyfriendBot Owner"
core:
name: { text: "FNFBoyfriendBot Core", color: "#00FFFF" }
itemName: { text: "FNFBoyfriendBot core item", color: "#00FFFF" }
itemRefill: true
# refilling core via item is buggy rn i recommend setting itemRefill to false for now
area:
start:
x: 0
y: 0
z: 0
end:
x: 15
y: 0
z: 15
team:
name: "FNFBoyfriendBot"
suffix: {
color: "dark_gray",
translate: " [ %s ]",
with: [
{ color: "dark_red", text: "https://sus.red" }
]
}
# make sure if nothing is set as the suffix it is set as { text: "" } as the packet reads "" as { text: "" }
prefix: {
color: "dark_gray",
translate: "[%s: %s] ",
with: [
{ color: "aqua", text: "Prefix" },
{ color: "dark_aqua", text: "!" }
]
}
displayName: {
translate: "%s%s%s",
with: [
{ color: "dark_blue", text: "FNF" },
{ color: "dark_aqua", text: "Boyfriend" },
{ color: "blue", text: "Bot" }
]
}
# color HAS to come first before any components or it will break! dont ask why, its because of how nmp parses it
commandSetMessage: false
# ^^ this is for when commands are ran in core
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."
bots:
- host: "localhost"
username: "FNFBoyfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "localhost"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: false
useChat: false
isKaboom: true
isSavage: false
isCreayun: false

View file

@ -1,19 +0,0 @@
export default {
data: {
name: '<command name>',
trustLevel: 0, // trust levels: 0, 1, 2, 3, 4
aliases: [
],
description: '',
usages: [
""
],
},
execute (context) {
},
discordExecute (context) {
}
}

View file

@ -1,19 +0,0 @@
module.exports = {
data: {
name: '<command name>',
trustLevel: 0, // trust levels: 0, 1, 2, 3, 4
aliases: [
""
],
description: '',
usages: [
""
],
},
execute (context) {
},
discordExecute (context) {
}
}

View file

@ -1,19 +0,0 @@
export default {
data: {
name: '<command name>',
trustLevel: 0, // trust levels: 0, 1, 2, 3, 4
aliases: [
],
description: '',
usages: [
""
],
},
execute (context) {
},
discordExecute (context) {
}
}

View file

@ -1,4 +0,0 @@
function whatevername (bot, options, config, discordClient) {
}
module.exports = whatevername

View file

@ -1,3 +0,0 @@
module.exports = (bot, options, config, discordClient) => {
}

View file

@ -1,3 +0,0 @@
export default function () {
}

File diff suppressed because it is too large Load diff

View file

@ -1,34 +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] });
require('./util/checks')();
console.log('Starting FNFBoyfriendBot');
process.stdout.write('\x1b]2;Starting FNFBoyfriendBot please wait,.....\x1b\x5c');
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,17 +0,0 @@
function boot (context) {
const bot = context.bot;
const config = context.config;
const options = context.options;
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');
}
})
setInterval(() => {
process.stdout.write(`\x1b]2; FNFBoyfriendBot | Time: ${new Date().toLocaleString("en-US",{timeZone: "America/CHICAGO"})} | \x1b\x5c`)
}, 1000)
}
module.exports = boot;

View file

@ -1,175 +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 (context) {
const bot = context.bot;
const config = context.config;
const options = context.options;
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('profilelessChat', { translate: "chat.type.emote", with: [ sender, message ]})
break
case 2:
bot.emit('profilelessChat', { translate: "commands.message.display.incoming", with: [ sender, message], color: "gray", italic: true })
break
case 3:
bot.emit('profilelessChat', [{ translate: "commands.message.display.outgoing", with: [ sender, message ], color: "gray", italic: true }])
break
case 4:
bot.emit('profilelessChat', [message]);
break
case 5:
bot.emit('profilelessChat', [{ 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('playerChat', { translate: "chat.type.announcement", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ]})
break
case 4:
bot.emit('playerChat', unsigned);
break
case 3:
bot.emit('playerChat', { 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('playerChat', { translate: "commands.message.display.incoming", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ], color: "gray", italic: true })
break
case 1:
bot.emit('playerChat', { translate: "chat.type.emote", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ]})
break
}
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('systemChat', message)
tryParsingMessage(message, { players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
bot.on('packet.action_bar', (message) => {
let parsedMessage = tryParse(message.text)
bot.emit('actionBar', {
translate: '[%s] %s',
color: 'dark_gray',
with: [
{ text: "Action Bar", color: "light_purple" },
parsedMessage
]
});
})
bot.on('packet.boss_bar', (data) => {
bot.emit('bossBar', {
translate: '[%s | %s: %s] %s',
color: 'dark_gray',
with: [
{ text: "Boss Bar", color: "dark_aqua" },
{ text: "Action ID", color: "blue" },
{ text: `${data.action}`, color: 'gold' },
tryParse(data.title)
]
})
})
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,27 +0,0 @@
const CommandSource = require('../util/command_source');
module.exports = (context) => {
let ratelimit = 0;
const bot = context.bot;
const config = context.config;
const options = context.options;
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)
}
})
})
}

View file

@ -1,197 +0,0 @@
const mcData = require('minecraft-data')('1.20.2');
const nbt = require('prismarine-nbt');
function core (context) {
const bot = context.bot;
const config = context.config;
const options = context.options;
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,
itemPosition: null,
currentBlockRelative: { x: 0, y: 0, z: 0 },
usePlacedCommandBlock: false,
chatRefill () {
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
*/
const 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)}'} destroy`
bot.chat.command(`${command}`)
},
itemRefill () {
const pos = bot.core.position;
const { start, end } = bot.core.area;
const itemPosition = bot.core.itemPosition;
if (!pos) return;
if (bot.options.useChat || bot.options.isCreayun || bot.options.isSavage) return;
if (isNaN(pos.x + pos.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
*/
const 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)}'} destroy`
bot._client.write('set_creative_slot', {
slot: 36,
item: {
present: true,
itemId: mcData.itemsByName.repeating_command_block.id,
itemCount: 1,
nbtData: nbt.comp({
BlockEntityTag: nbt.comp({
CustomName: nbt.string(JSON.stringify(config.core.itemName))
})
})
}
});
bot._client.write('block_dig', {
status: 0,
location: itemPosition,
face: 0
});
bot._client.write('block_place', {
hand: 0,
location: itemPosition,
direction: 0,
cursorX: 0.1,
cursorY: 0,
cursorZ: 0.1,
insideBlock: false
});
if (bot.core.usePlacedCommandBlock) {
return
} else {
bot._client.write('update_command_block', {
location: itemPosition,
command,
flags: 5,
mode: 1
})
}
},
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.itemPosition = {
x: pos.x,
y: pos.y -1,
z: pos.z
}
if (config.core.itemRefill === true) {
bot.core.itemRefill();
} else {
bot.core.chatRefill();
}
},
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();
const itemPosition = bot.core.itemPosition;
if (!location) return;
if (bot.options.isCreayun || bot.options.useChat || bot.options.isSavage) {
return
} else {
if (bot.core.usePlacedCommandBlock) {
bot._client.write('update_command_block', {
command: command.substring(0, 32767),
location: itemPosition,
mode: 1,
flags: 5,
});
bot.core.incrementCurrentBlock();
} else {
bot._client.write('update_command_block', {
command: command.substring(0, 32767),
location,
mode: 1,
flags: 5
});
bot.core.incrementCurrentBlock();
}
}
},
}
if (bot.options.isSavage || bot.options.isCreayun) return
bot.on('move', () => {
bot.core.move(bot.position)
})
bot.on('packet.block_change', (data) => {
// console.log('data pos ' + JSON.stringify(data.location))
// console.log('core pos ' +JSON.stringify(bot.core.position));
// if (data.type === 0) {
// console.log('data pos ' + JSON.stringify(data.location));
// console.log('core position ' + JSON.stringify(bot.core.position));
// bot.core.refill();
//}
})
}
module.exports = core;

View file

@ -1,32 +0,0 @@
function command_loop (context) {
const bot = context.bot;
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,193 +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');
async function command_manager (context) {
const bot = context.bot;
const config = context.config;
const discordClient = context.discordClient;
const options = context.options;
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)
bot.tellraw("@a", {
translate: "%s%s%s %s",
color: "dark_gray",
with: [
{ translate: "command.unknown.command", color: "red" },
{ text: "\n" },
{ text: `${commandName}` },
{ translate: "command.context.here", color: "red" }
]
})
} else if (source?.sources?.console && !source?.sources?.discord) {
if (!command || !command.execute)
bot.console.warn(bot.getMessageAsPrismarine({
translate: "%s%s%s %s",
color: "dark_gray",
with: [
{ translate: "command.unknown.command", color: "red" },
{ text: "\n" },
{ text: `${commandName}` },
{ translate: "command.context.here", color: "red" }
]
})?.toAnsi())
}
const event = bot.discord.message;
const roles = event?.member?.roles?.cache;
switch (command?.data?.trustLevel) {
case 0:
// do nothing since trust level 0 is public
break;
case 1:
if (source?.sources?.discord) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.trusted}` || role.name === `${config.discord.roles.admin}` || role.name === `${config.discord.roles.fullAccess}` || role.name === `${config.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not trusted or the owner!', color: "dark_red" })
} else if (!source?.sources.console) {
if (args.length === 0) throw new CommandError({ text: "Please provide a trusted, admin or owner hash", color: "dark_red" });
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.admin && args[0] !== bot.validation.owner) throw new CommandError({ translate: 'Invalid trusted, admin or owner hash', color: 'dark_red' });
}
break;
case 2:
if (source?.sources?.discord) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.admin}` || role.name === `${config.discord.roles.fullAccess}` ||role.name === `${config.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not trusted or the owner!', color: "dark_red" })
} else if (!source?.sources?.console) {
if (args.length === 0) throw new CommandError({ text: "Please provide an admin or owner hash", color: 'dark_red' })
if (args[0] !== bot.validation.admin && args[0] !== bot.validation.owner) throw new CommandError({ translate: 'Invalid admin or owner hash', color: 'dark_red' });
}
break;
case 3:
if (source?.sources?.discord) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.owner}` || role.name === `${config.discord.roles.fullAccess}`)
if (!hasRole) throw new CommandError({ translate: 'You are not the owner!', color: "dark_red" })
} else if (!source?.sources?.console) {
if (args.length === 0 && bot.validation.owner) throw new CommandError({ text: "Please provide an owner hash", color: "dark_red" })
if (args[0] !== bot.validation.owner) throw new CommandError({ translate: 'Invalid owner hash', color: 'dark_red' })
}
break;
case 4:
if (!source?.sources?.console) {
throw new CommandError({ text: 'This command can only be ran via console', color: "dark_red" })
}
break;
}
if (!command?.discordExecute && command && source?.sources?.discord) {
throw new CommandError(`${command.data.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.data.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)
if (source?.sources?.discord && !source?.sources?.console) {
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.error}`)
.setTitle(`${command?.data?.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 {
if (error.toString().length > 256) {
bot.tellraw("@a", error._message);
} else if (error.toString().length < 256) {
bot.chat.message(`${bot.getMessageAsPrismarine(error._message)?.toMotd().replaceAll('§','&')}`)
} else {
bot.tellraw("@a", error._message);
}
}
} 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}` } }])
}
}
}
}
},
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.data.name] = command
if (command.data.aliases) {
command.data.aliases.map((a) => (this.commands[a] = command));
}
},
getCommand (name) {
return this.commands[name]
},
getCommands () {
return Object.values(this.commands)
},
}
/*
file loader ported from my discord bot SkiBot
and edited to support mjs files and to support FNFBoyfriendBot's command format
*/
commandlist = [];
const foldersPath = path.join(__dirname, '../commands');
const commandFolders = fs.readdirSync(foldersPath);
for (const folder of commandFolders) {
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs.readdirSync(commandsPath)
for (const filename of commandFiles) {
try {
const filePath = path.join(commandsPath, filename);
if (filename.endsWith('.mjs')) {
let command = await import(filePath);
bot.commandManager.register(command.default);
bot.commandManager.commandlist.push(command.default);
}
if (filename.endsWith('.js')) {
let command = require(filePath);
bot.commandManager.register(command);
bot.commandManager.commandlist.push(command);
}
} catch (error) {
console.error('Failed to load command ', filename, ':', error);
}
}
}
}
module.exports = command_manager;

View file

@ -1,113 +0,0 @@
const CommandSource = require('../util/command_source');
const prismarineChat = require('prismarine-chat')('1.20.2');
function Console (context) {
const bot = context.bot;
const config = context.config;
const options = context.options;
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._client.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,
chat (message) {
const prefix = {
translate: '[%s] %s \u203a %s',
color:'dark_gray',
with: [
{
text: 'FNFBoyfriendBot Console',
color:'#00FFFF'
},
{
selector: `${bot.username}`, color:'#00FFFF',
clickEvent: { action: 'suggest_command', value: `${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)
}
}
}
setInterval(() => ratelimit = 0, 1000 * 2);
bot.on('profilelessChat', (message) => {
if (!options.logging) 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()}`);
})
bot.on('systemChat', (message) => {
if (!options.logging) return;
if (ratelimit > 15) 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()}`);
ratelimit++
})
bot.on('playerChat', (message) => {
if (!options.logging) return;
if (ratelimit > 15) 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()}`);
ratelimit++
})
bot.on('bossBar', (message) => {
if (!options.logging) return;
if (ratelimit > 10) 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()}`);
ratelimit++
})
bot.on('actionBar', (message) => {
if (!options.logging) return;
if (ratelimit > 10) 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()}`);
ratelimit++
})
}
module.exports = Console;

View file

@ -1,168 +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 (context) {
const bot = context.bot;
const config = context.config;
const discordClient = context.discordClient;
const options = context.options;
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) {
console.error(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('profilelessChat', (message) => {
sendComponent(message);
})
bot.on('systemChat', (message) => {
sendComponent(message);
})
bot.on('playerChat', (message) => {
sendComponent(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.nickname || message?.author.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.nickname || message.author.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,63 +0,0 @@
const fs = require("fs");
const path = require("path");
const { createGzip } = require("zlib");
const readline = require('readline');
const { Console } = require("console");
function fileLogger(context) {
const bot = context.bot;
const config = context.config;
const options = context.options;
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,37 +0,0 @@
const os = require('os');
module.exports = (context) => {
const bot = context.bot;
const config = context.config;
let timer;
bot.memUsage = {
enabled: false
}
timer = setInterval(() => {
component = {
translate: "%s%s%s %s | %s: %s%s / %s%s | %s: %s%s / %s%s |",
color: config.colors.commands.tertiary,
with: [
{ text: "FNF", color: "dark_blue" },
{ text: "Boyfriend", color: "dark_aqua" },
{ text: "Bot", color: "blue" },
{ text: "Memory Usage" },
{ text: "Free Server Memory", color: config.colors.commands.primary },
{ text: `${Math.floor(os.freemem() / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
{ text: `${Math.floor(os.totalmem() / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
{ text: "Bot Memory Usage", color: config.colors.commands.primary },
{ text: `${Math.floor(process.memoryUsage().heapUsed / 1048576)}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary },
{ text: `${Math.floor(process.memoryUsage().heapTotal / 1048576 )}`, color: config.colors.integer },
{ text: "MiB", color: config.colors.commands.secondary }
]
}
if (!bot.memUsage.enabled) return;
bot.core.run(`minecraft:title @a[tag=!memusage] actionbar ${JSON.stringify(component)}`)
}, 100)
bot.on('end', () => {
bot.memUsage.enabled = false;
})
}

View file

@ -1,97 +0,0 @@
function player_list (context) {
const bot = context.bot;
const config = context.config;
const options = context.options;
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.emit("player_info", packet);
})
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)
if (a.length >= 1) {
player.vanished = true;
} else {
bot.players = bot.players.filter(_ => _.uuid != player.uuid);
bot.emit("player_left", player);
}
})
})
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 },
chatSession: undefined,
gamemode: undefined,
listed: undefined,
latency: undefined,
displayName: undefined,
vanished: false
})
if (entry.vanished) {
bot.emit("player_vanished", entry);
} else {
bot.emit("player_joined", entry);
}
}
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
}
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,20 +0,0 @@
function position (context) {
const bot = context.bot;
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,26 +0,0 @@
const mc = require('minecraft-protocol');
const usernameGen = require("../util/usernameGen");
function reconnect (context) {
const bot = context.bot;
const config = context.config;
const options = context.options;
bot.on('end', () => {
//bot = undefined;
bot._client.removeAllListeners();
//client = undefined;
//bot._client = undefined;
if (bot.reconnectDelay < 0) return
setTimeout(() => {
if (options.usernameGen) {
client = options.client ?? mc.createClient(options, 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,131 +0,0 @@
const sleep = require('../util/sleep');
function selfcare (context) {
const bot = context.bot;
const config = context.config;
const options = context.options;
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;
let positionCount = 0;
bot.vanished = true
bot.on('systemChat', (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;
} else if (options.isKaboom) {
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;
})
bot.on("packet.position", (packet, position) => {
if (options.isSavage || options.isCreayun) return
positionCount++
setTimeout(() => {
positionCount--
if (positionCount > 4) {
bot.core.run('sudo * icu stop');
} if (permissionLevel < 2 || gameMode !== 1) {
bot._client.end('anti icu :3');
}
}, 1000)
})
let timer;
bot.on('packet.login', async (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 (gameMode !== 1) bot.chat.command('minecraft:gamemode creative');
else if (permissionLevel < 2) bot.chat.command(`minecraft:op ${bot.options.username}`);
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.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,17 +0,0 @@
module.exports = (context) => {
const bot = context.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,51 +0,0 @@
const sleep = require('../util/sleep');
module.exports = (context) => {
const bot = context.bot;
const options = context.options;
const config = context.config;
bot.on("packet.login", async () => {
if (options.isKaboom) {
await sleep(100);
bot.chat.command(`minecraft:team add ${config.team.name}`);
await sleep(100);
bot.core.run(`minecraft:team join ${config.team.name} @a[name="${bot.options.username}"]`);
}
})
bot.on("packet.teams", async (data) => {
if (options.isSavage || options.isCreayun) return;
try {
if (data.team === config.team.name) {
data?.players?.map(async (player) => {
if (player !== bot.options.username) {
await sleep(100);
bot.core.run(`minecraft:team empty ${config.team.name}`);
await sleep(100);
bot.core.run(`minecraft:team join ${config.team.name} @a[name="${bot.options.username}"]`);
// this removes players who are not the bot
}
});
if (data.mode == 1) {
// this is checking if the team has been deleted
bot.core.run(`minecraft:team add ${config.team.name}`);
await sleep(100);
bot.core.run(`minecraft:team join ${config.team.name} @a[name="${bot.options.username}"]`);
} if (data.name !== JSON.stringify(config.team.displayName)) {
// this checks if the team displayName matches the one set in the config
bot.core.run(`minecraft:team modify ${config.team.name} displayName ${JSON.stringify(config.team.displayName)}`);
} if (data.prefix !== JSON.stringify(config.team.prefix)) {
// this checks if the team prefix matches the one set in the config
bot.core.run(`minecraft:team modify ${config.team.name} prefix ${JSON.stringify(config.team.prefix)}`);
} if (data.suffix !== JSON.stringify(config.team.suffix)) {
// this checks if the team suffix matches the one set in the config
bot.core.run(`minecraft:team modify ${config.team.name} suffix ${JSON.stringify(config.team.suffix)}`)
}
}
} catch (e) {
console.log(e.stack)
}
})
}

View file

@ -1,13 +0,0 @@
const crypto = require('crypto')
function validation (context) {
const bot = context.bot;
const config = context.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,29 +0,0 @@
const ChatMessage = require('prismarine-chat')('1.20.2');
const util = require('util');
function creayun (messageobj, data) {
try {
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'};
}
} catch (e) {
console.log(e.toString())
}
}
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.stack}`)
}
}
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

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