Compare commits

..
14 Commits
163 changed files with 3924 additions and 37911 deletions
+3 -11
View File
@@ -1,12 +1,4 @@
node_modules
logs
midis
config.yml
.env
src/node_modules
src/config.js
src/.env
amog
src/commands/kick.js
src/modules/exploits.js
src/commands/kick.js
prototyping-crap/java/build/
prototying-crap/java/.gradle/
.git
-12
View File
@@ -1,12 +0,0 @@
exploits module was gitignored to prevent exploit leaks so the bot will not being able to run some commands without it
please make a file called exploits.js in modules and add this
```js
function exploits (bot, options, context) {
bot.exploits = {
hoe: ''
}
}
module.exports = exploits;
```
also src/commands/kick.js was gitignored so exploits wont be leaked
v5.0.8 is not done yet!
-6540
View File
File diff suppressed because it is too large Load Diff
-6542
View File
File diff suppressed because it is too large Load Diff
-6540
View File
File diff suppressed because it is too large Load Diff
-6539
View File
File diff suppressed because it is too large Load Diff
-6540
View File
File diff suppressed because it is too large Load Diff
-32
View File
@@ -1,32 +0,0 @@
function logger (bot,options) {
const { createGzip } = require('node:zlib');
const gzip = createGzip();
const fs = require('fs')
const path = require('path')
const currentDate = new Date();
const timestamp = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1).toString().padStart(2, '0')}-${currentDate.getDate().toString().padStart(2, '0')}`;
const logFolder = path.join(__dirname, '../../logs'); // idfk
const logFileName = `${timestamp}.txt`;//why is it not trying to find the folder tf
// i am having a stroke from this
if (!bot.Console.filelogging) return
try {
if (!fs.existsSync(logFolder)) { // existsSync might be for files and that's why it's breaking? | make the folder if it doesn't exist before writing to it
fs.mkdirSync(logFolder);//idfk
}//oh wait
} catch (e) {} // prevent it from throwing a ohio exception mabe mabe
const logFilePath = path.join(logFolder, logFileName);
const logStream = fs.createWriteStream(logFilePath, { flags: 'a' });
// const toWrite = `${message}`//wtf
if (!bot.Console.filelogging) return // instead of using bot why not just use options cause you already defined it
// if (toFile) logStream.write(toWrite + '\n');
bot.console.filelogger = function (message) {//.
logStream.write(message + '\n'); // toFile is not defined
};
//if (toConsole) console.log(toWrite);
};
module.exports = logger
-20
View File
@@ -1,20 +0,0 @@
{
"dependencies": {
"@vitalets/google-translate-api": "^9.2.0",
"color-convert": "^2.0.1",
"cowsay": "^1.6.0",
"cowsay2": "^2.0.4",
"discord.js": "^14.15.2",
"dockerode": "^4.0.2",
"dotenv": "^16.4.5",
"final-stream": "^2.0.4",
"isolated-vm": "^4.7.2",
"js-yaml": "^4.1.0",
"minecraft-protocol": "^1.47.0",
"moment-timezone": "^0.5.45",
"prettier": "^3.2.5",
"prismarine-chat": "^1.10.1",
"prismarine-registry": "^1.7.0",
"wikipedia": "^2.1.2"
}
}
-58
View File
@@ -1,58 +0,0 @@
testdata = {
"extra": [
{
"extra": [
{
"bold": 1,
"color": "dark_red",
"text": "["
},
{
"bold": 1,
"color": "red",
"text": "OP"
},
{
"bold": 1,
"color": "dark_red",
"text": "] "
},
{
"color": "red",
"text": ""
}
],
"text": ""
},
{
"extra": [
{
"color": "red",
"text": "Parker2991"
}
],
"text": ""
},
{"":":"},
{"":" "},
{"":"e"}
],
"text": ""
}
function parseMessage(message, color = true) {
console.log(message);
let ret = ""
if (color) {
for (thing in message) {
console.log(thing);
}
} else {
for (thing in message) {
console.log(thing);
}
}
return ret;
}
parseMessage(testdata)
-102
View File
@@ -1,102 +0,0 @@
# i bet theres gonna be some whiny assholes complaining about this because config is .yml and not .js since most java bots use .yml and no other
# javascript bot uses .yml, all i got to say is go cry somewhere else about it you wont change my mind, you little shit,
# it looks cleaner than config.js - Parker2991
# FNFBoyfriendBot Config
# commands
Commands:
prefixes:
- '!'
colors:
discord:
error: "#ff0000"
embed: "#00ffff"
help:
pub_lickColor: "#00FFFF"
t_rustedColor: "dark_purple"
own_herColor: "dark_red"
error: "#FF0000"
# core
Core:
JSON: ""
area:
start:
x: 0
y: 0
z: 0
end:
x: 15
y: 0
z: 15
#validation
validation:
discord:
roles:
trusted: "trusted"
owner: "owner"
channelId: "channel validation here" # for sending hashes to discord if someone is too lazy to add validation for the bot to their client
trustedKey: "trusted key here"
ownerKey: "owner key here"
#discord
Discord:
enabled: false
invite: "https://discord.gg/GCKtG4erux"
commandPrefix: "!"
presence:
name: "amongus"
type: 4
status: "online"
# console
console:
filelogging: false
prefix: "c."
# bots
bots :
# isKaboom = running the bot in kaboom
# isCreayun = running the bot in creayun
# useChat = running the bot in chat and not core
# usernameGen = regenerating the bot's username every join
# endcredits = the bot advertising
# serverName = the name of the server ofc
# Console.ratelimit = the number of messages that the bot can read in a few seconds before rejoining this is used to prevent spam, i do not recommend setting it to Infinity
# selfcare.interval = selfcare interval duh
- host: "localhost"
useChat: false
isKaboom: true
isCreayun: false
usernameGen: true
username: "FNFBoyfriendBot"
version: "1.20.2"
serverName: "localhost"
reconnectDelay: 6000
endcredits: false
Console:
enabled: true
ratelimit: 25
Core:
enabled: true
interval: 180000
discord:
channelId: ""
log: false
matrix:
roomId: ""
selfcare:
vanished: true
unmuted: true
prefix: true
cspy: true
tptoggle: true
skin: true
gmc: true
op: true
nickname: true
username: true
god: true
interval: 500
-2
View File
@@ -1,2 +0,0 @@
const { haxe } = require('haxe')
console.log(haxe())
-94
View File
@@ -1,94 +0,0 @@
const CommandError = require('./CommandModules/command_error.js');
const util = require("util");
const path = require('path');
const fs = require('fs');
const parseYaml = require('js-yaml')
/* if (!fs.existsSync('config.js')) {
console.log('Config not found creating config from default.js');
fs.copyFileSync(
path.join(__dirname, 'default.yml'),
path.join(__dirname, 'config.js'),
);
}; */
if (!fs.existsSync('config.yml')) {
console.log('Config not found creating config from default.yml');
fs.copyFileSync(
path.join(__dirname, 'default.yml'),
path.join(__dirname, 'config.yml'),
);
};
// const config = require(`../config.js`);
try {
config = parseYaml.load(fs.readFileSync('config.yml', 'utf8'));
console.log(config)
} catch (e) {
console.log(e.toString())
}
const { createBot } = require('./bot.js');
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
function load() {
require("dotenv").config();
const bots = [];
const core = config.Core;
const commands = config.Commands;
const Console = config.console;
const tellrawtag = config.tellrawTag;
// const helptheme = config.helpTheme;
const discord = config.Discord;
const matrix = config.matrix;
const validation = config.validation;
for (const options of config.bots) {
const bot = createBot(options);
bots.push(bot);
bot.bots = bots;
bot.Core = core;
bot.Commands = commands;
bot.Console = Console;
bot.Discord = discord;
bot.tellrawTag = tellrawtag;
// bot.helpTheme = helptheme;
bot.matrix = matrix;
bot.validation = validation;
bot.options.username;
bot.loadModule = (module) => module(bot, options);
for (const filename of fs.readdirSync(path.join(__dirname, "modules"))) {
try {
const module = require(path.join(__dirname, "modules", filename));
bot.loadModule(module);
} catch (error) {
console.log(
"Failed to load module",
filename,
":",
error,
);
}
}
bot.console.useReadlineInterface(rl);
try {
bot.on("error", error => {
bot?.console?.warn(error.toString())
});
} catch (error) {
console.log(error.stack);
}
}
}
process.on("uncaughtException", (e) => {
//console.log(e.stack)
});
load()
-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"
-10
View File
@@ -1,10 +0,0 @@
const version = require('./version.json');
const ChatMessage = require('prismarine-chat')('1.20.2');
console.log(version);
console.log(version.BotBuildstring.build);
console.log(version.BotBuildstring.codename);
console.log(version.BotBuildstring.version);
console.log(ChatMessage.fromNotch(`${version.BotBuildstring.version}-${version.BotBuildstring.codename}-${version.BotBuildstring.build}`)?.toAnsi())
console.log(ChatMessage.fromNotch(version.BotBuildstring.codename)?.toAnsi())
console.log(ChatMessage.fromNotch(version.BotBuildstring.name)?.toAnsi())
console.log(`${ChatMessage.fromNotch(version.BotBuildstring.name)?.toAnsi()}-${version.BotBuildstring.version}-${ChatMessage.fromNotch(version.BotBuildstring.codename)?.toAnsi()}`)
-35
View File
@@ -1,35 +0,0 @@
{
"BotBuildstring": {
"name": [
{
"translate":"%s%s%s",
"with": [
{
"text": "FridayNightFunkin",
"color": "dark_purple"
},
{
"text": "Boyfriend",
"color": "#00FFFF"
},
{
"text": "Bot",
"color": "#ff0000"
}
]
}
],
"build":"#500",
"codename": [
{
"text": "Censory ",
"color": "dark_red"
},
{
"text": "Overload",
"color": "red"
}
],
"version":"v5.0.8"
}
}
+12 -3
View File
@@ -1,17 +1,26 @@
class CommandSource {
constructor (player, sources, hash, owner,) {
constructor (player, sources, hash, owner, discordMessageEvent = null, consoleOnly, name, profile, bot, prefix = "~") {
this.player = player//kaboom on crack!
// idk fr // mabe
// /shrug
//am i good to restart it?
this.sources = sources
this.profile = bot
this.hash = hash
this.owner = owner
this.consoleOnly = consoleOnly
this.discordMessageEvent = discordMessageEvent
this.prefix = prefix
}
sendFeedback () {}
sendError (message) {
this.sendFeedback([{ text: '', color: 'red' }, message], false)
}
}
module.exports = CommandSource
-1
View File
@@ -1 +0,0 @@
const haxe = require('haxe-js-kit')
+77 -70
View File
@@ -1,101 +1,108 @@
const mc = require("minecraft-protocol");
const mc = require("minecraft-protocol");
const { EventEmitter } = require("node:events");
const usernameGen = require('./util/usernameGen');
const fs = require("fs");
const path = require("path");
const util = require("node:util");
require("events").EventEmitter.defaultMaxListeners = Infinity;
const { execSync } = require('child_process');
const ChatMessage = require('prismarine-chat')('1.20.2')
function createBot(options = {}) {
const bot = new EventEmitter();
// const rs = require("randomstring");
// Set some default values in options
bot.options = {
host: options.host ??= "localhost",
username: options.username ??= usernameGen(),
hideErrors: options.hideErrors ??= true, // HACK: Hide errors by default as a lazy fix to console being spammed with the console
version: options.version ??= '1.20.2',
}
bot.options = {
host: options.host ??= "localhost",
username: options.username ??= "FNFBoyfriendBot",
hideErrors: options.hideErrors ??= false, // HACK: Hide errors by default as a lazy fix to console being spammed with the console
version: options.version ??= '1.20.2',
}
bot.options = options;
// Create our client object, put it on the bot, and register some events
bot.on("init_client", (client) => {
client.on("packet", (data, meta) => {
bot.emit("packet", data, meta);
bot.emit('packet.' + meta.name, data)
});
const timer = setInterval(() => {
if (!bot.options.endcredits) {
return
} else {
bot.chat(`Join the FNFBoyfriendBot discord ${bot.discord.invite}`)
try{
bot.emit('packet.' + meta.name, data)
} catch(e) {
if(e.toString() === 'RangeError: Invalid string length'){
bot._client.end()
}else{
console.log(e)
}
}
}, 280000)
client.on("login", async function (data) {
});
const timer = setInterval(() => {
if(!bot.options.endcredits){
return
}else{
bot.chat(`Join the FNFBoyfriendBot discord ${bot.options.discord.invite}`)
}
}, 280000)
client.on("login", async function (data) {
bot.uuid = client.uuid;
bot.username = client.username;
bot.port = bot.options.port;
bot.version = bot.options.version;
if (bot.options.isCreayun) {
}
var day = new Date().getDay()
if (day === 5) {
bot.chat("Gettin' freaky on a Friday Night!")
} else {
bot.chat(`&5FNF&bBoyfriend&4Bot &f- &4Parker&02991`)
}
timer;
if (bot.options.useChat) {
bot?.console?.warn(`useChat is active for ${bot.options.host} the bot will not be able to run commands in core`)
} else if (bot.options.isCreayun) {
bot?.console?.info(`Creayun mode is active for ${bot.options.host} please not that the bot will not read kaboom commands and messages when Creayun mode is active`)
}
if (bot.options.debug.enabled) {
bot.console.warn(`Debug mode is enabled for ${bot.options.host}:${bot.options.port} please note this WILL spam console is all options are enabled`)
}
})
bot.version = bot.options.version;
var day = new Date().getDay()
if(day === 5){
bot.chat('Getting freaky on a Friday Night!')
}else{
const buildstring = process.env["buildstring"]
bot.chat(ChatMessage.fromNotch(JSON.stringify(process.env['buildstring'])).toMotd().replaceAll('§', '&'))
}
timer
})
client.on("end", (reason) => {
const parsed = JSON.stringify(reason);
bot.emit('end', parsed);
bot.console.warn(`Disconnected: ${parsed}`);
bot.cloop.clear()
bot.memusage.off()
bot.tps.off()
bot.bruhifyText = ''
clearInterval(timer)
bot?.discord?.channel?.send('Disconnected: ' + '``' + parsed + '``')
});
bot.emit("end", reason);
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
bot.cloop.clear()
bot.memusage.off()
bot.tps.off()
clearInterval(timer)
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
});
client.on("disconnect", (data) => {
const parsed = JSON.parse(data.reason)
bot.emit(parsed, "disconnect");
if (parsed === 'Server is full!') {
bot.console.warn(`what the fuck?`)
} else {
bot.console.warn(`Disconnected: ${parsed}`);
bot?.discord?.channel?.send('Disconnected: ' + '``' + parsed + '``')
}
});
client.on("kick_disconnect", (data) => {
const parsed = JSON.parse(data.reason);
bot.emit(parsed, "kick_disconnect");
bot?.discord?.channel?.send('Disconnected: ' + '``' + parsed + '``')
bot.console.warn(`Disconnected: ${JSON.stringify(data.reason)}`);
});
client.on("disconnect", (reason) => {
bot.emit("disconnect", reason);
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
});
client.on("kick_disconnect", (reason) => {
bot.emit("kick_disconnect", reason);
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
//console.log(reason)
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
});
client.on("keep_alive", ({ keepAliveId }) => {
bot.emit("keep_alive", { keepAliveId });
});
client.on("error", (error) => {
bot?.discord?.channel?.send('Disconnected: ' + '``' + JSON.stringify(error.toString()) + '``')
bot.console.warn(error.toString())
// bot.emit("error", error)
})
});
bot?.discord?.channel?.send('``' + error.toString() + '``' )
bot.emit("error", error)
})
});
const client = options.client ?? mc.createClient(options);
bot._client = client;
bot.emit("init_client", client);
bot.bots = options.bots ?? [bot];
bot.bots = options.bots ?? [bot];
return bot;
}
+5 -5
View File
@@ -1,5 +1,5 @@
function chipmunkmod (message, data, context, bot) {
try {
try{
if (message === null || typeof message !== 'object') return
if (message.with?.length < 3 || (message.translate !== '[%s] %s › %s' && message.translate !== '%s %s › %s')) return
@@ -28,8 +28,8 @@ function chipmunkmod (message, data, context, bot) {
if (!sender) return null
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(e)
}
}catch(e){
console.error(e)
}
module.exports = chipmunkmod
}
module.exports = chipmunkmod
+24 -12
View File
@@ -2,20 +2,32 @@ function creayun (messageobj, data) { // this function is not getting called
const ChatMessage = require('prismarine-chat')('1.20.1')
const stringify = message => new ChatMessage(message).toString()
const message = stringify(messageobj);
const playerWithPrefix = /^(.*?) (\S*?) » (.*?)$/;
const playerWithoutPrefix = /^(\S*?) » (.*?)$/
// var pattern = /^(.*?) (\S*?) \u203a (.*?)$/;
var pattern = /^(.*?) (\S*?) » (.*?)$/;
// var pattern = /^(.*?) (\S*?) \u203a (.*?)$/;
//console.log('[debug] parsing a message');
// const match = message.match(pattern);
if (playerWithPrefix.test(message)) {
const match = message.match(pattern);
if(pattern.test(message)) {
// console.log('[debug]', match);
let match = message.match(playerWithPrefix)
return { sender: match[2], contents: match[3], type: 'minecraft:chat'}; //
// } else if (playerWithoutPrefix.test(message)) {
//let match = message.match(playerWitoutPrefix)
//return { sender: match[1], contents: match[2], type: 'minecraft:chat'};
} else {
//console.log('[debug] pattern does not match');
}//i just realized that the bot uses tellraw
//ima try to fix that
}
module.exports = creayun//:troll:
}//it picks players up as undefined in creayun
//and i tried using the kaboom chat parser but edited and that didnt work
// [] username »
module.exports = creayun//:troll:
// •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
// function(function(function(function(function(function(function(function(function(function(function(function(function(function(function(function)))))))))))))))
// i guess so because it connects you
// i think?
//🐔💨💩😎🐒🥶😁😂⏰❌🐒🛏
//very real
// theres so much things that get logged :sob:
//gotta love when it refuses to connect
// someones trying to be fake me in kaboom
//the bot is being waaay to sus
// i will crash him when i get on // sus // very
//k
// getting the fake parker out of kaboom
// pcrashed
+1 -1
View File
@@ -35,7 +35,7 @@ function kaboom (message, data) {
}
function isSeparatorAt (children, start) {
return (children[start]?.text === ':' || children[start]?.text === '\xa7r:') && children[start + 1]?.text === ' '
return (children[start]?.text === ':' || children[start]?.text === '\xa7f:') && children[start + 1]?.text === ' '
}
module.exports = kaboom
-47
View File
@@ -1,47 +0,0 @@
const util = require('util')
function savage (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 === '\xa79»\xa7r') && children[start + 1]?.text === ' '
}
// [prefix]&r [name] [suffix] &9»&r
// {DISPLAYNAME} &9»&r {MESSAGE}
/*
{"extra":[{"text":"e e"},{"text":" "},{"color":"dark_red","text":"Parker"},{"color":"black","text":"2991"},{"text":" "},
{"color":"blue","text":"»"},{"text":" "},{"color":"white","text":"duping fucking rank"}],"text":""}
*/
module.exports = savage;
-35
View File
@@ -1,35 +0,0 @@
function say (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]
// wtf spam again -
//console.log(senderComponent)//wtf...
const contents = message.with[1]
// spam lol - console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
//console.log(JSON.stringify(hoverEvent))
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent?.contents?.id
//
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 = say
+11 -61
View File
@@ -7,41 +7,6 @@ const bots = [
foundation: "java/mcprotocollib",
prefixes: ["#"],
},
{
name: { text: "CddehhBot", color: "red", bold: false },
authors: ["CaydennO1","spyingcreeper09"],
exclaimer: "WHAT IS THIS GOOFY AAAH FUCKING BOT",
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: "FleamBot", color: "dark_purple", bold: false },
authors: ["ZenZoya","Yaode_owo","Parker2991", "and others"],
exclaimer: "is it Flame or fleam?",
foundation: "nodejs/node-minecraft-protocol",
prefixes: ["^"],
},
{
name: { text: "64Bot", color: "gold", bold: false },
authors: ["64Will64"],
@@ -171,7 +136,7 @@ const bots = [
{
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",
exclaimer: "wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak",
foundation: "Java/MCProtocolLib",
prefixes: ["*", "cbot ", "/cbot "],
},
@@ -262,12 +227,10 @@ const bots = [
{ text: " chayapak", color: "yellow", bold: false },
{ text: " _yfd", color: "light_purple", bold: false },
{ text: "popbob", color: "gold" },
{ text: "MorganAnkan", color: "dark_green" },
{ text: "TurtleKid", color: "green" },
],
exclaimer: "FNFBoyfriendBot NMP Rewrite",
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ["~", "fnfbfbot ", "&"],
prefixes: ["~ % &"],
},
{
name: [
@@ -292,34 +255,21 @@ module.exports = {
description: ["shows a list of known bots"],
aliases: ["knownbots"],
trustLevel: 0,
usage:[""],
async execute(context) {
usage:[""],
execute(context) {
const query = context.arguments.join(" ").toLowerCase();
const bot = context.bot;
if (query.length === 0) {
const list = [];
if(!bot.options.Core.enabled){
throw new CommandError('Coreless mode is active can not execute command!')
}else{
for (const info of bots) {
if (list.length !== 0) {
list.push({ text: ", ", color: "gray" });
}
if (list.length !== 0) list.push({ text: ", ", color: "gray" }); // list.push(info.name)
list.push(info.name);
}
if (bot.options.isCreayun) {
let sus
// for ( sus instanceOf list)
bot.chat(bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - "])?.toMotd().replaceAll('§','&'));
await bot.chatDelay(2000)
// setTimeout(async function() {
// for (const sus of list) {
bot.chat(bot.getMessageAsPrismarine(list)?.toString());
await bot.chatDelay(2000)
// }, 2000)
return
} else {
bot.sendFeedback(
context.source.sendFeedback(
bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - ", ...list]).toMotd().replaceAll('\xa7','\xa7'),
false,
);
@@ -357,4 +307,4 @@ module.exports = {
},
};
//it doing it just for the ones i added lol
// prob a replit moment, it probably thinks there are regexes in the strings
// prob a replit moment, it probably thinks there are regexes in the strings
+3 -5
View File
@@ -10,13 +10,11 @@ usage:["smexy text here"],
const bot = context.bot
const args = context.arguments
const message = context.arguments.join(' ')
if (bot.options.isCreayun) {
throw new CommandError('isCreayun is active!')
} else {
bot.bruhifyText = args.join(' ')
bot.sendFeedback(JSON.stringify(bot.bruhifyText))
}
context.source.sendFeedback(JSON.stringify(bot.bruhifyText))
}
}
+1 -28
View File
@@ -56,33 +56,6 @@ const bots = [
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',
},
]//
//back
@@ -129,7 +102,7 @@ const bot = context.bot
]
}
bot.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\u00a7','\u00a7'), false)
context.source.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\u00a7','\u00a7'), false)
return
}
+1 -1
View File
@@ -375,7 +375,7 @@ const bot = context.bot
]
}
bot.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\xa7','\xa7'), false)
context.source.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\xa7','\xa7'), false)
return
}
+45 -127
View File
@@ -1,64 +1,63 @@
const CommandError = require('../CommandModules/command_error')
const {EmbedBuilder} = require('discord.js')
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cloop',
trustLevel: 1,
description:['command loop commands'],
aliases:['commandloop'],
usage:[
"add <interval> <command/message>",
"clear",
"remove <id>",
"list",
],
trustLevel: 1,
description:['command loop commands'],
aliases:['commandloop'],
usage:[
"add <interval> <command/message>",
"clear",
"remove <id>",
"list",
],
execute (context, selector) {
const args = context.arguments
const 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]) {
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
// throw new CommandError('temp disabled')
switch (selector, args[1]) {
case 'add':
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
const interval = parseInt(args[2])
const command = args.slice(3).join(' ')
bot.cloop.add(command, interval)
bot.sendFeedback({
source.sendFeedback({
translate: 'Added \'%s\' with interval %s to the cloops',
color:'gray',
with: [ command, interval ]
})
break
case 'remove':
//const aaa = args[2]
var id
// if (bot.cloop.list[args[2]].id === undefined) new CommandError({text:'Invalid index'})
try{
if (bot.cloop.list[args[2]].id === undefined) source.sendFeedback({ text: 'Invalid index', color: 'red' }, false)
const index = (args[2])
const index = (args[2])
bot.cloop.remove(index)
bot.sendFeedback({
source.sendFeedback({
translate: 'Removed cloop %s',
color: 'gray',
with: [ index ]
})
} catch(e) {
if (e.toString() === "TypeError: Cannot read properties of undefined (reading 'id')"){
bot.sendError({text:'Invalid Index'})
}
}
break
case 'clear':
bot.cloop.clear()
bot.sendFeedback({ text: 'Cleared all cloops' })
source.sendFeedback({ text: 'Cleared all cloops', color:'gray' }, false)
break
case 'list':
case 'list':
const component = []
const listComponent = []
@@ -66,91 +65,9 @@ bot.sendError({text:'Invalid Index'})
for (const cloop of bot.cloop.list) {
listComponent.push({
translate: '%s \u203a %s (%s)',
color: 'gray',
with: [
`id ${i}`,
cloop.command,
cloop.interval
]
})
listComponent.push('\n')
i++
}
listComponent.pop()
component.push({
translate: "Cloops (%s):",
with: [ JSON.stringify(bot.cloop.list.length) ]
})
component.push('\n')
component.push(listComponent)
if(bot.cloop.list.length === 0){
bot.sendFeedback({ translate: "Cloops (%s):", with: [ JSON.stringify(bot.cloop.list.length) ] })
}else{
bot.sendFeedback(component)
}
break
default:
bot.sendFeedback({ text: 'Invalid action', color: 'red' })
break
}
},
discordExecute(context) {
const args = context.arguments
const bot = context.bot
switch(args[0]) {
case 'add':
const interval = parseInt(args[1])
const command = args.slice(2).join(' ')
bot.cloop.add(command, interval)
var Embed = new EmbedBuilder()
.setColor(`${bot.Commands.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':
try {
var index = (args[1])
bot.cloop.remove(index)
var Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`removed cloop ${index}`)
bot?.discord?.Message?.reply({ embeds: [Embed] })
} catch(e) {
if (e.toString() === "TypeError: Cannot read properties of undefined (reading 'id')"){
throw new CommandError({text:'Invalid Index'})
}
}
break
case 'clear':
bot.cloop.clear()
var Embed = new EmbedBuilder()
.setColor(`${bot.Commands.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}`,
i,
cloop.command,
cloop.interval
]
@@ -164,20 +81,21 @@ case 'list':
component.push({
translate: 'Cloops (%s):',
color:'gray',
with: [ bot.cloop.list.length ]
})
component.push('\n')
component.push(listComponent)
component.push(listComponent)
var Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(bot.getMessageAsPrismarine(component)?.toString())
bot?.discord?.Message?.reply({ embeds: [Embed] })
break
default:
throw new CommandError('Invalid argument')
break
}
source.sendFeedback(component,true)
//console.log(`tellraw @a ${JSON.stringify(component)}`)
break
default:
source.sendFeedback({ text: 'Invalid action', color: 'red' })
break
}
}
}
}
+92 -60
View File
@@ -1,76 +1,108 @@
const CommandError = require('../CommandModules/command_error')
const CommandSource = require('../CommandModules/command_source')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'cmdtest',
description:['usages are test and msg error'],
trustLevel: 0,
aliases:['cmdtst', 'commandtest', 'commandtst'],
usage:[
"msg",
"error",
],
trustLevel: 0,
aliases:['cmdtst', 'commandtest', 'commandtst'],
usage:[
"msg",
"error",
],
execute (context) {
const bot = context.bot
const player = context?.source?.player?.profile?.name
const uuid = context?.source?.player?.uuid
const bot = context.bot
const player = context.source.player.profile.name
const uuid = context.source.player.uuid
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
const args = context.arguments
const source = context.source
switch (args[0]) {
case "message":
const args = context.arguments
const source = context.source
switch (args[0]) {
case 'msg':
if (bot.options.isCreayun || bot.options.useChat || bot.options.isSavage) {
bot.chat(`Hello, World!, Player: ${bot.getMessageAsPrismarine(context.source.player.displayName ?? context.source.player.profile.name).toMotd().replaceAll('§', '&')}, uuid: ${context.source.player.uuid}, Argument: ${args.slice(1).join(' ')}`)
const component = {
translate: '[%s] %s %s %s %s %s',
with: [
{
translate: '%s%s%s',
bold:false,
with: [
{
text: 'FNF',
bold: true,
color: 'dark_purple'
},
{
text: 'Boyfriend',
bold: true,
color: 'aqua'
},
{
text: 'Bot',
bold: true,
color: 'dark_red'
},
],
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
},
{
text:'Hello, World!,'
},{
text:'Player:'
},
context.source.player.displayName ?? context.source.player.profile.name,
{
text:`, uuid: ${uuid ?? context.source.player.uuid } , `
},
//entry.displayName
{text:`Argument: ${args.slice(1).join(' ')}`}
]//command.split(' ')[0]
}//context.source.player.displayName ?? context.source.player.profile.name
//ChatMessage.fromNotch(`${process.env["buildstring"]}`).toMotd().replaceAll('§', '&')
if (!bot.options.Core.enabled){
const ChatMessage = require('prismarine-chat')(bot.options.version)
bot.chat(`Hello, World!, Player: ${ChatMessage.fromNotch(context.source.player.displayName ?? context.source.player.profile.name).toMotd().replaceAll('§', '&')}, uuid: ${context.source.player.uuid}, Argument: ${args.slice(1).join(' ')}`)
} else {
bot.tellraw([
{
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,
}
])
bot.tellraw([component])
}
/*
const bot = context.bot
const player = context.source.player.profile.name
const uuid = context.source.player.uuid
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
context.source.sendFeedback(`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`, false)
*/
break
case 'error':
case 'err':
throw new Error(args.slice(1).join(' '))
break
default:
if (bot.options.isCreayun) {
bot.chat('&4Invalid action')
// bot.chat('the usages are msg and error')
} else {
bot.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
// bot.sendError([{ text: 'the usages are msg and error', color: 'gray', bold:false }])
}
}
},
discordExecute (context) {
const args = context.arguments;
const bot = context.bot;
switch (args[0]) {
case "message":
case "msg":
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`Hello world!, User: ${context?.source?.player?.displayName ?? context?.source?.player?.profile?.name}, Arguments: ${args.slice(1).join(' ')}`)
bot.discord.Message.reply({embeds: [Embed]})
break
case "error":
case "err":
throw new CommandError(`${args.slice(1).join(' ')}`)
}
}
throw new Error(args.slice(1).join(' '))
break
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
default:
if (bot.options.Core.CorelessMode){
bot.chat('&4Invalid action')
sleep(500)
bot.chat('the usages are msg and error')
}else{
context.source.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
context.source.sendError([{ text: 'the usages are msg and error', color: 'gray', bold:false }])
}
}
}
}
/*
*/
//context.source.player.displayName ?? context.source.player.profile.name,
//context.source.player.displayName ?? context.source.player.profile.name,
+20 -20
View File
@@ -1,25 +1,25 @@
const CommandError = require('../CommandModules/command_error');
const { EmbedBuilder } = require('discord.js');
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'core',
description: ['make me run a command in core'],
aliases: ['cb','corerun','run','commandblockrun','cbrun'],
trustLevel: 0,
usage: ["<command/message>"],
description:['make me run a command in core'],
aliases:['cb','corerun','run','commandblockrun','cbrun'],
trustLevel: 0,
usage:["<command/message>"],
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
const bot = context.bot
// const client = context.client
const args = context.arguments
const source = context.source
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.core.run(args.join(' ').substring(1))
return
// if (args.length === 0){
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
if (message.startsWith('/')) {
bot.core.run(message.substring(1))
return
}
bot.core.run(`${args.join(' ')}`)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
bot.core.run(`${args.join(' ')}`)
}
}
bot.core.run(message)
}
}
+49 -59
View File
@@ -1,18 +1,19 @@
const CommandError = require('../CommandModules/command_error')
const cowsay = require('cowsay2')
const cows = require('cowsay2/cows')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'cowsay',
description: ['mooooo'],
aliases: ['cws', 'cow'],
trustLevel: 0,
usage: ["list"],
execute (context) {
description:['mooooo'],
aliases:['cws', 'cow'],
trustLevel: 0,
usage:["list"],
execute (context, selector) {
const bot = context.bot
const args = context.arguments
const component = ['']
// const args = context.arguments
const source = context.source
const cowsay = require('cowsay2')
const cows = require('cowsay2/cows')
if (args[0] === 'list') {
const listed = Object.keys(cows)
@@ -22,64 +23,53 @@ module.exports = {
for (const value of listed) {
message.push({
text: value + ' ',
color: 'gray',
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
clickEvent: {
action: 'suggest_command',
value: `${bot.Commands.prefixes[0]}cowsay ${value} `
value: `${context.bot.options.commands.prefixes[0]}cowsay ${value} `
}
})
}
bot.sendFeedback(message)
} else if (cows[args[0]]) {
bot.tellraw({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
bot.tellraw(message)
} else {
bot.tellraw({ text: cowsay.say(args.slice(0).join(' ')) })
bot.tellraw({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
}
},
discordExecute (context) {
const bot = context.bot;
const source = context.source;
const args = context.arguments;
const component = ['']
if (args[0] === 'list') {
const listed = Object.keys(cows)
let primary = true
const message = []
for (const value of listed) {
message.push({
text: value + ' ',
})
}
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(bot.getMessageAsPrismarine(message)?.toString())
bot.discord.Message.reply({ embeds: [Embed] })
} else if (cows[args[0]]) {
let Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription('```' + bot.getMessageAsPrismarine({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })?.toString() + '```')
bot.discord.Message.reply({ embeds: [Embed] })
//bot.tellraw({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
} else {
let Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription('```' + bot.getMessageAsPrismarine({ text: cowsay.say(args.slice(0).join(' ')) })?.toString() + '```')
bot.discord.Message.reply({embeds: [Embed]})
// bot.tellraw({ text: cowsay.say(args.slice(0).join(' ')) })
}
}
}
/*
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
// bot.tellraw({ text: cowsay.say(context.arguments.join(' ').slice(1), { cow: cows[args[0]] })
//const listed = JSON.parse(cows)
//source.sendFeedback(`${listed}`, false)
/* if (args[0] === 'list') {
const listed = Object.keys(cows)
let primary = true
const message = []
for (const value of listed) {
message.push({
text: value + ' ',
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
clickEvent: {
action: 'suggest_command',
value: `${prefix}cowsay ${value} `
}
})
}
bot.tellraw(selector, message)
} else {
bot.tellraw(selector, { text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
}
},
*/
/*if (query.length === 0) {
const list = []
for (const info of bots) {
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
list.push(info.name)
}
*/
+41 -16
View File
@@ -2,20 +2,23 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'crash',
description:['crashes a server'],
trustLevel: 1,
aliases:['crashserver', '69'],//69 cuz yes
usage:["exe","give"],
execute (context) {
description:['crashes a server'],
trustLevel: 1,
aliases:['crashserver', '69'],//69 cuz yes
usage:["exe","give"],
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
// throw new CommandError('temp disabled')
const args = context.arguments
const source = context.source
if (!args && !args[0] && !args[1] && !args[2]) return
if (bot.options.useChat ?? bot.options.isCreayun) {
throw new CommandError('cannot execute command because useChat or isCreayun is enabled')
} else {
switch (args[1]) {
case `exe`:
if(!bot.options.Core.enabled){
throw new CommandError('&4Coreless mode is active can not execute command!')
}else {
switch (args[1] ?? (!source.sources.console && args[0])) {
case `exe`:
const amogus = process.env['amogus']
bot.core.run(`${amogus}`)
break
@@ -23,9 +26,31 @@ module.exports = {
const amogus2 = process.env['amogus2']
bot.core.run(`${amogus2}`)
break
default:
bot.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
}
}
}
const cmd = {//test.js
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'gold', text: 'crash'},
]
}
if(source.sources.console){
bot.console.info([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
// bot.console.info([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
}else{
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
// context.source.sendError([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
}
}
}
}
}
//what is wi
// IDK
+29 -19
View File
@@ -2,29 +2,39 @@ const CommandError = require("../CommandModules/command_error")
module.exports = {
name: 'discordmsg',
description:['make me say something in discord'],
description:['make me say something in discord'],
trustLevel: 0,
aliases:['discordmessage', 'ddmsg'],
usage:["message"],
aliases:['discordmessage', 'ddmsg'],
usage:["message"],
execute (context) {
//const args = context.args
const bot = context.bot
const args = context.arguments
if (!args[0]) {
bot.sendFeedback({text:'Message is empty', color:'red'}, false)
// if (args.translate !== '\u202e')
// throw new CommandError('u202e detected')
if (!args[0]) {
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
} else {
bot.discord.channel.send(args.join(' '))
console.log(args[0])
bot.sendFeedback({ text: `Recieved: ${args.join(' ')}`, color:'green'})
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
if (!args[0]) {
bot.discord.Message.reply('Recieve too few arguments')
} else {
bot.discord.Message.reply(`${args.join(' ')}`)
}
}
}
context.source.sendFeedback({ text: `Recieved: ${args.join(' ')}`, color:'green'})
//}
//}
}
}
}
//bot.discord.channel.send(args.join(' '))
/*
if(!args[0])
context.source.sendFeedback('message is empty')
else if (args[0])
bot.discord.channel.send(args[0])
console.log(args[0])
context.source.sendFeedback(`Recieved: ${args[0]}`)
return;
*/
+9 -24
View File
@@ -1,34 +1,19 @@
const CommandError = require('../CommandModules/command_error');
module.exports = {
name: 'echo',
description:['make me say something in chat'],
aliases:['chatsay', 'say', 'botsay'],
trustLevel: 0,
usage:[
"<command/message>",
],
description:['make me say something in chat'],
aliases:['chatsay'],
trustLevel: 0,
usage:[
"<command/message>",
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const bot = context.bot
const message = context.arguments.join(' ')
if (bot.options.isCreayun && args.join(' ') === '/sex') {
throw new CommandError('NUH UH FUCK YOU 🖕')
} else {
if (message.startsWith('/')) {
bot.command(message.substring(1))
return
}
bot.chat(message)
}
},
discordExecute(context) {
const bot = context.bot
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.command(message.substring(1))
return
}
bot.chat(message)
}
}
}
+19
View File
@@ -0,0 +1,19 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'end',
description:['/kill the bot or make it /suicide'],
trustLevel: 1,
aliases:['kys','kill','suicide'],
usage:[""],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
const source = context.source
source.sendFeedback(`${bot.username} fell out of the world`)
process.exit()
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
-44
View File
@@ -1,44 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const ivm = require('isolated-vm');
const { stylize } = require('../util/eval_colors');
const options = {
timeout: 1000,
}
const util = require('util');
module.exports = {
name: 'eval',
description:['run code via isolated vm, exclaimer: amcforum members had a shitfit over this command'],
aliases:['ivm'],
trustLevel: -1,
usage:[
"<code>",
],
async execute (context) {
const bot = context.bot;
const args = context.arguments;
const script = await args.join(' '); // Ensure script is a string
//let isolate = new ivm.Isolate({ memoryLimit: 50, options, global, cachedData: true })
//const evalcontext = await isolate.createContextSync({options});
let isolate = new ivm.Isolate({ memoryLimit: 50, options, global, cachedData: true })
const evalcontext = await isolate.createContextSync({options});
(async () => {
try {
let result = await (await evalcontext).evalSync(script, options, {
timeout: 1000
})
if (bot.options.useChat) {
bot.chat(bot.getMessageAsPrismarine([{ text: util.inspect(result, { stylize }).substring(0, 256) }])?.toMotd().replaceAll('§','&'))
} else {
bot.sendFeedback([{ text: util.inspect(result, { stylize }) }]);
}
} catch (reason) {
bot.sendError(`${reason.toString()}`)
}
})()
},
discordExecute(context) {
const bot = context.bot;
const args = context.arguments;
}
}
+8 -8
View File
@@ -6,7 +6,7 @@ const { stylize } = require('../util/eval_colors')
module.exports = {
name: 'evaljs',
trustLevel: -1,
trustLevel: 1,
aliases:['evaljsisolatedvm', 'evaljsnew', 'evaljsivm', 'eval', 'evalivm', 'evalisolatedvm', 'evaljsnew'],
description:['run code in a vm note: amcforum members had a sh##fit over this command'],
usage:["re fucking doing"],
@@ -64,17 +64,17 @@ try {
const script = await args.slice(2).join(' '); // Ensure script is a string
const cOmtext = await isolate.createContextSync({options});
if (script.includes('for(;;);')){
bot.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
source.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
return
}
else if (script.includes('Array') || script.includes('\u0041rray') || script.includes('\u0065val') || script.includes('.repeat') || script.includes('concat')){
bot.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
source.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
return
} else if(script.includes('eval')){
source.sendFeedback({text:'no',color:'dark_red'})
return
}else if(script.includes('.fill')){
bot.sendFeedback({text:'screw off',color:'dark_red'})
source.sendFeedback({text:'screw off',color:'dark_red'})
return
}
(async () => {
@@ -87,14 +87,14 @@ return
bot.chat(ChatMessage.fromNotch([cmd, { text: util.inspect(result, { stylize }) }]).toMotd().replaceAll('§', '&'))
}else{
bot.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
source.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
}
} catch (reason) {
nerd = reason;
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: String(reason.stack), color: 'white' }]).toMotd().replaceAll('§', '&'))
}else{
bot.sendFeedback([cmd, { text: String(reason.stack), color: 'white' }]);
source.sendFeedback([cmd, { text: String(reason.stack), color: 'white' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
}
@@ -120,14 +120,14 @@ if(!bot.options.Core.enabled){
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
}else{
bot.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
}
break
default:
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
}else{
bot.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
source.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
}
}
}
+3 -8
View File
@@ -12,7 +12,7 @@ module.exports = {
const args = context.arguments
const key = bot.validation.keys.ownerKey
const key = process.env['FNFBoyfriendBot_Owner_key']
//al
const time = Math.floor(Date.now() / 11000)
@@ -34,12 +34,7 @@ module.exports = {
clickevent: { action:"open_url", value: "https://doin-your.mom"}
}
// context.bot.tellraw(customchat)
if (bot.options.useChat ?? bot.options.isCreayun) {
bot.chat(command)
} else {
bot.tellraw(customchat)
}
context.bot.tellraw(customchat)
}
}
//const interval = setInterval(() => {
@@ -47,4 +42,4 @@ module.exports = {
// bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.ownerHashKey).digest('hex').substring(0, 16)
// Make a copy of this
// Make a copy of this
+98 -254
View File
@@ -1,137 +1,95 @@
const { EmbedBuilder } = require('discord.js')
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'help',
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
description:['shows the command list or the usage of a command'],
trustLevel: 0,
usage:'[COMMAND]',
trustLevel: 0,
usage:'[COMMAND]',
async execute (context) {
const bot = context.bot
const commandList = []
const source = context.source
const args = context.arguments
const CommandManager = bot.commandManager
const cmd = {
translate: '[%s] ',
const commandList = []
const source = context.source
const args = context.arguments
const {EmbedBuilder } = require('discord.js')
// const amogus = bot.prefix
const ChatMessage = require('prismarine-chat')(bot.options.version)
const CommandManager = bot.commandManager
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'blue', text: 'help cmd'},
]
]
}
const category = {
translate: '(%s%s%s%s%s) \u203a ',
translate: ' (%s%s%s%s%s) ',
bold: false,
color: 'dark_gray',
with: [
{ color: `${bot.Commands.colors.help.pub_lickColor}`, text: 'Public'},
color: 'white',
with: [
{ color: `${bot.helpTheme.pub_lickColor}`, text: 'Public'},
{ color: 'white', text: ' | '},
{ color: `${bot.Commands.colors.help.t_rustedColor}`, text: 'Trusted'},
{ color: `${bot.helpTheme.t_rustedColor}`, text: 'Trusted'},
{ color: 'white', text: ' | '},
{ color: `${bot.Commands.colors.help.own_herColor}`, text: 'Owner'},
{ color: `${bot.helpTheme.own_herColor}`, text: 'Owner'},
]
}
if (args[0]) {
let valid
//if (command.aliases) { command.aliases.map((a) => (this.commands[a] = command)); }
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
const command = bot.commandManager.commandlist[commands]
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
const command = bot.commandManager.commandlist[commands]
if (args[0].toLowerCase() === command.name)
if (args[0].toLowerCase() === command.name) {
//}//bot.getMessageAsPrismarine([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi()
{
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}//bot.getMessageAsPrismarine([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi()
valid = true
if (bot.options.useChat && !bot.options.isCreayun) {
bot.sendFeedback([{text:`Trust levels: -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console`,color:`${bot.Commands.colors.help.t_rustedColor}`}])
await bot.chatDelay(100)
bot.sendFeedback({text: `${bot.Commands.prefixes[0]}${command.name} `,color:`${bot.Commands.colors.help.pub_lickColor}`})
await bot.chatDelay(100)
bot.sendFeedback({text:`Aliases`,color:`${bot.Commands.colors.help.t_rustedColor}`})
await bot.chatDelay(100)
bot.sendFeedback({text:`${command.aliases}`,color:`${bot.Commands.colors.help.t_rustedColor}`})
await bot.chatDelay(100)
bot.sendFeedback({text:`${command.description}`})
await bot.chatDelay(100)
bot.sendFeedback([{text:`Trust Level: `,color:`${bot.Commands.colors.help.pub_lickColor}`},{text:`${command.trustLevel}`,color:`${bot.Commands.colors.help.t_rustedColor}`}])
await bot.chatDelay(100)
if (command.trustLevel === 2) {
await bot.chatDelay(100)
bot.sendFeedback([{text:`Usage: `,color:`${bot.Commands.colors.help.pub_lickColor}`},{text:`${bot.Commands.prefixes[0]}${command.name} <owner hash> `,color:`${bot.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${bot.Commands.colors.help.own_herColor}`}])
await bot.chatDelay(100)
} else if (command.trustLevel === 1) {
await bot.chatDelay(100)
bot.sendFeedback([{text:`Usage: `,color:`${bot.Commands.colors.help.pub_lickColor}`},{text:`${bot.Commands.prefixes[0]}${command.name} <trusted/owner hash> `,color:`${bot.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${bot.Commands.colors.help.own_herColor}`}])
await bot.chatDelay(100)
} else {
await bot.chatDelay(100)
bot.sendFeedback([{text:`Usage: `,color:`${bot.Commands.colors.help.pub_lickTheme}`},{text:`${bot.Commands.prefixes[0]}${command.name} `,color:`${bot.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${bot.Commands.colors.help.own_herColor}`}])
await bot.chatDelay(100)
}
if(source.sources.console){
bot.console.info(bot.getMessageAsPrismarine([cmd, {text:`${bot.options.commands.prefixes[0]}${command.name} `,color:'#00ffff'},{text:`${command.aliases} › ${command.description}`,color:'dark_purple'}])?.toAnsi())
bot.console.info(bot.getMessageAsPrismarine([cmd,{text:`Trust Level: `,color:'#00ffff'},{text:`${command.trustLevel}`,color:'dark_purple'}])?.toAnsi())
bot.console.info(bot.getMessageAsPrismarine([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.options.commands.prefixes[0]}${command.name} `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])?.toAnsi())
}else if(!bot.options.Core.enabled && !source.sources.console){
bot.chat(ChatMessage.fromNotch([cmd, `Description: ${command.description}`]).toMotd().replaceAll('§', '&'))
await sleep(1000)
bot.chat(ChatMessage.fromNotch([cmd, {text:`Trust Level: ${command.trustLevel}`}]).toMotd().replaceAll('§', '&'))//[cmd, {text:`Trust Level: ${command.trustLevel}`}]
await sleep(1000)
bot.chat(ChatMessage.fromNotch([cmd, `aliases: ${command.aliases}`]).toMotd().replaceAll('§', '&'))
}else{
} else if (bot.options.isCreayun) {
bot.chat(`Trust levels: -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console`)
await bot.chatDelay(2000)
bot.chat(`Aliases ↓↓↓`)
await bot.chatDelay(2000)
bot.chat(`${command.aliases}`)
await bot.chatDelay(2000)
bot.chat(`${command.description}`)
await bot.chatDelay(2000)
bot.chat(`Trust Level: ${command.trustLevel}`)
await bot.chatDelay(2000)
if (command.trustLevel === 2) {
await bot.chatDelay(2000)
bot.chat(`ඞ${bot.Commands.prefixes[0]}${command.name} <owner hash> ${command.usage}`)
await bot.chatDelay(2000)
} else if (command.trustLevel === 1) {
await bot.chatDelay(2000)
bot.chat(`ඞ${bot.Commands.prefixes[0]}${command.name} <owner/trusted hash> ${command.usage}`)
await bot.chatDelay(2000)
} else {
await bot.chatDelay(2000)
bot.chat(`ඞ${bot.Commands.prefixes[0]}${command.name} ${command.usage}`)
await bot.chatDelay(2000)
}
} else {
bot.sendFeedback([cmd,{text:`Trust levels: -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console`,color:`${bot.Commands.colors.help.t_rustedColor}`}])
bot.sendFeedback([cmd, {text:`${bot.Commands.prefixes[0]}${command.name} `,color:`${bot.Commands.colors.help.pub_lickColor}`},{text:`(Aliases: ${command.aliases}) › ${command.description}`,color:`${bot.Commands.colors.help.t_rustedColor}`}])
bot.sendFeedback([cmd,{text:`Trust Level: `,color:`${bot.Commands.colors.help.pub_lickColor}`},{text:`${command.trustLevel}`,color:`${bot.Commands.colors.help.t_rustedColor}`}])
if (command.trustLevel === 2) {
bot.sendFeedback([cmd,{text:`Usage: `,color:`${bot.Commands.colors.help.pub_lickColor}`},{text:`${bot.Commands.prefixes[0]}${command.name} <owner hash> `,color:`${bot.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${bot.Commands.colors.help.own_herColor}`}])
} else if (command.trustLevel === 1) {
bot.sendFeedback([cmd,{text:`Usage: `,color:`${bot.Commands.colors.help.pub_lickColor}`},{text:`${bot.Commands.prefixes[0]}${command.name} <trusted/owner hash> `,color:`${bot.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${bot.Commands.colors.help.own_herColor}`}])
} else {
bot.sendFeedback([cmd,{text:`Usage: `,color:`${bot.Commands.colors.help.pub_lickColor}`},{text:`${bot.Commands.prefixes[0]}${command.name} `,color:`${bot.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${bot.Commands.colors.help.own_herColor}`}])
}
}
source.sendFeedback([cmd, {text:`${bot.options.commands.prefixes[0]}${command.name} `,color:'#00ffff'},{text:`(${command.aliases}) › ${command.description}`,color:'dark_purple'}])
source.sendFeedback([cmd,{text:`Trust Level: `,color:'#00ffff'},{text:`${command.trustLevel}`,color:'dark_purple'}])
source.sendFeedback([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.options.commands.prefixes[0]}${command.name} `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
break
// }
}
} else valid = false
}
}
if (valid) {
} else if (!valid) {
} else {
const args = context.arguments
if (bot.options.isCreayun) {
bot.chat(bot.getMessageAsPrismarine({ translate: "command.unknown.command", color: "dark_red" })?.toMotd(bot.registry.language).replaceAll("§","&"))
await bot.chatDelay(1500)
bot.chat(bot.getMessageAsPrismarine({ translate: "command.context.here", color: "dark_red" })?.toMotd(bot.registry.language).replaceAll("§","&"))
} else {
bot.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.Commands.prefixes[0]}help" for help or click on this for the command`,color:'red', with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.Commands.prefixes[0]}help` } : undefined}])
source.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefixes[0]}help" for help or click on this for the command`,color:'red', with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefixes[0]}help` } : undefined}])
}
}
} else {
let pub_lick = [];
let t_rust = [];
let own_her = [];
let cons_ole = [];
let disabled = [];
let pub_lick = []
let t_rust = []
let own_her = []
let cons_ole = []
for (const commands in CommandManager.commandlist) {
const command = CommandManager.commandlist[commands]
@@ -166,16 +124,18 @@ break
}
else if (command.trustLevel === 2) {
if (bot.options.useChat && !source.sources.console && !source.sources.discord){
own_her.push(`&4${command.name + ' '}`)
} else {
else
if (command.trustLevel === 2) {
if(!bot.options.Core.enabled && !source.sources.console && !source.sources.discord){
own_her.push(`&4${command.name + ' '}`)
}else{
own_her.push(
{
text: command.name + ' ',
color: `${bot.Commands.colors.help.own_herColor}`,
color: `${bot.helpTheme.own_herColor}`,
translate:"",
@@ -202,13 +162,13 @@ break
}
else if (command.trustLevel === 1){
if(bot.options.useChat && !source.sources.console && !source.sources.discord){
if(!bot.options.Core.enabled && !source.sources.console && !source.sources.discord){
t_rust.push(`&5${command.name + ' '}`)
}else {
t_rust.push(
{
text: command.name + ' ',
color:`${bot.Commands.colors.help.t_rustedColor}`,
color:`${bot.helpTheme.t_rustedColor}`,
translate:"",
@@ -233,13 +193,13 @@ break
}
else if (command.trustLevel === 0){
if (bot.options.useChat && !source.sources.console && !source.sources.discord){
if (!bot.options.Core.enabled && !source.sources.console && !source.sources.discord){
pub_lick.push(`&b${command.name + ' '}`)
} else{
pub_lick.push(
{
text: command.name + ' ',
color: `${bot.Commands.colors.help.pub_lickColor}`,
color: `${bot.helpTheme.pub_lickColor}`,
translate:"",
hoverEvent:{
@@ -262,12 +222,7 @@ break
}
} else if (command.trustLevel === -1) {
disabled.push({
text: command.name + ' ',
color:`dark_blue`,
})
}
}
}
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms))
@@ -276,150 +231,39 @@ break
if(source.sources.console && !source.sources.discord) {
bot.console.info([cmd, 'Commands (', JSON.stringify(CommandManager.commandlist.length), ') ', category, ...pub_lick, t_rust, own_her, cons_ole], false)//[cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole]
} else if (bot.options.useChat && !bot.options.isCreayun) {
bot.console.info(bot.getMessageAsPrismarine([cmd, 'Commands (', CommandManager.commandlist.length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi(), false)//[cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole]
} else if(source.sources.discord&& !source.sources.console){
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle('help Command')
.setDescription(bot.getMessageAsPrismarine(['Commands (',JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3).length),')'])?.toString())
.addFields(
{ name: 'Public Commands', value:`${bot.getMessageAsPrismarine(pub_lick)?.toString()}`},
{ name: 'Trusted Commands', value: `${bot.getMessageAsPrismarine(t_rust)?.toString()}`, inline: true },
{ name: 'Owner Commands', value: `${bot.getMessageAsPrismarine(own_her)?.toString()}`, inline: true },
)
bot?.discord?.Message?.reply({ embeds: [Embed] })
}else if (!bot.options.Core.enabled) {
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
bot.chat('&8Commands &3(&6' + JSON.stringify(length) + '&3) (&bPublic &f| &5Trusted &f| &4Owner&f)')
await bot.chatDelay(200)
bot.chat(`${bot.getMessageAsPrismarine(pub_lick)?.toMotd().replaceAll(',','')}`)
await bot.chatDelay(200)
bot.chat(`${bot.getMessageAsPrismarine(t_rust)?.toMotd().replaceAll(',','')}`)
await bot.chatDelay(200)
bot.chat(`${bot.getMessageAsPrismarine(own_her)?.toMotd().replaceAll(',','')}`)
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
bot.chat('Commands (' + JSON.stringify(length) + ') (&bPublic &f| &5Trusted &f| &4Owner&f)')
await sleep(3000)
bot.chat(`${pub_lick}`)
await sleep(3000)
bot.chat(`${t_rust}`)
await sleep(3000)
bot.chat(`${own_her}`)
} else if (bot.options.isCreayun) {
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
bot.chat('Please note that the bot will not output all commands due the char limit')
await bot.chatDelay(1500)
bot.chat('&8Commands &3(&6' + JSON.stringify(length) + '&3) (&bPublic &f| &5Trusted &f| &4Owner&f)')
await bot.chatDelay(1500)
bot.chat(`${bot.getMessageAsPrismarine(pub_lick)?.toMotd()?.replaceAll(',','')}`)
await bot.chatDelay(1500)
bot.chat(`${bot.getMessageAsPrismarine(t_rust)?.toMotd().replaceAll(',','')}`)
await bot.chatDelay(1500)
bot.chat(`${bot.getMessageAsPrismarine(own_her)?.toMotd().replaceAll(',','')}`)
return
} else {
}else {
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
/*
bot.sendFeedback([
'Commands (',
{text:`${JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3 && c.trustLevel != -1).length)}`,color:'gold'}, ') ',
category,
...pub_lick,
t_rust
,own_her],
false)*/
bot.sendFeedback([
{ text:'Commands ',color:'dark_gray'},
{ text:'(',color:'dark_blue'},
{ text:`${JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3 && c.trustLevel != -1).length)}`,color:'gold'},
{ text:') ',color:'dark_blue'},
category,
...pub_lick,
t_rust,
own_her,
])
}
source.sendFeedback([cmd, 'Commands (', JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3).length), ') ', category, ...pub_lick, t_rust ,own_her], false)
}
}
},
discordExecute(context){
const bot = context.bot
const args = context.arguments
const message = args.join(' ')
const CommandManager = bot.commandManager
if (args[0]) {
let valid
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
const command = bot.commandManager.commandlist[commands]
if (args[0].toLowerCase() === command.name) {
valid = true
/* const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle('help Command')
.setDescription(`help \u203a ${command.name}`)
.addFields(
{ name: '', value:`` },
)
bot?.discord?.Message?.reply({embeds: [Embed]})
bot?.discord?.Message.react('♋')*/
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`${command.name} info`)
.addFields(
// { name: '', value: `${bot.Discord.commandPrefix + command.name}` }
{name: `${bot.Discord.commandPrefix}${command.name} (Aliases: ${command.aliases}) \u203a ${command.description}`, value: `\u200b`,inline:false},
{ name: `Trust Level \u203a ${command.trustLevel}`,value:'\u200b'},
{ name: `Usage \u203a ${bot.Discord.commandPrefix}${command.name} ${command.usage}`,value:'\u200b'},
)
bot?.discord?.Message?.reply({embeds: [Embed]})
bot?.discord?.Message.react('♋')
break
} else valid = false
}
//source is defined btw
//source.sendFeedback([cmd, 'This command is ' + valid + ' to this for loop'])
if (valid) {
} else {
const args = context.arguments
throw new CommandError(`Unknown command ${args[0]}. type "${bot.Discord.commandPrefix}" for help`)
}
const length = context.bot.commandManager.commandlist.length // ok
//context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
} else {
let pub_lick = []
let t_rust = []
let own_her = []
for (const commands in bot.commandManager.commandlist) {
const command = bot.commandManager.commandlist[commands]
// }
if (command.trustLevel === 2) {
own_her.push(
{
text: command.name + ' ',
})
}
else if (command.trustLevel === 1){
t_rust.push(
{
text: command.name + ' ',
})
}
else if (command.trustLevel === 0){
pub_lick.push(
{
text: command.name + ' ',
})
}
}
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`${bot.getMessageAsPrismarine(['Commands (',JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3).length),')'])?.toString()}`)
.addFields(
{ name: 'Public', value:`${bot.getMessageAsPrismarine(pub_lick)?.toString()}`, inline: false },
{ name: 'Trusted', value: `${bot.getMessageAsPrismarine(t_rust)?.toString()}`, inline: false },
{ name: 'Owner', value: `${bot.getMessageAsPrismarine(own_her)?.toString()}`,inline: false },
)
bot?.discord?.Message?.reply({embeds: [Embed]})
bot?.discord?.Message.react('♋')
}
}
}
+73 -309
View File
@@ -1,14 +1,33 @@
const CommandError = require("../CommandModules/command_error");
const path = require("path");
const fs = require("fs");
const packageJSON = require("../../package.json");
const packageJSON = require("../package.json");
const os = require('os');
const date = new Date().toLocaleDateString("en-US", {
timeZone: "America/CHICAGO",
});
const { execSync } = require('child_process');
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js')
function format(seconds) {
module.exports = {
name: "info",
description: [
"check the bots info",
],
aliases: ["information"],
trustLevel: 0,
usage:[
"version",
"invite",
"server",
"packages",
"login",
"config",
"uptime",
"contributors",
],
async execute(context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source
function format(seconds) {
function pad(s) {
return (s < 10 ? "0" : "") + s;
}
@@ -19,332 +38,77 @@ function format(seconds) {
pad(`${minutes} Minutes`) + " " +
pad(`${seconds} Seconds`))
}
module.exports = {
name: "info",
description: [
"check the bots info",
],
aliases: ["information"],
trustLevel: 0,
usage:[
"version",
"invites",
"server",
"loaded",
"login",
"config",
"uptime",
"contributors",
],
async execute(context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source
switch(args.join(' ').toLowerCase()) {
case 'version':
if (bot.options.useChat && !bot.options.isCreayun) {
bot.chat(`${bot.getMessageAsPrismarine({text:`${process.env.buildstring}-${execSync('git rev-parse HEAD').toString().slice(0, 10)}`})?.toMotd().replaceAll('§',"&")}`)
await bot.chatDelay(100)
bot.sendFeedback({text:`${process.env.FoundationBuildString}-${execSync('git rev-parse HEAD').toString().slice(0, 10)}`})
await bot.chatDelay(100)
bot.sendFeedback({text:`11/22/2022 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })}`})
} else if (bot.options.isCreayun) {
bot.chat(bot.getMessageAsPrismarine(process.env.buildstring)?.toMotd().replaceAll('§','&'))
await bot.chatDelay(1500)
bot.chat(process.env.FoundationBuildString)
await bot.chatDelay(1500)
bot.chat(`11/22/2022 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })}`)
} else {
bot.sendFeedback({text:`${process.env.buildstring}-${execSync('git rev-parse HEAD').toString().slice(0, 10)}`})
bot.sendFeedback({text:`${process.env.FoundationBuildString}-${execSync('git rev-parse HEAD').toString().slice(0, 10)}`})
bot.sendFeedback({text:`11/22/2022 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })}`})
}
source.sendFeedback({text:`${process.env.buildstring}`})
source.sendFeedback({text:`${process.env.FoundationBuildString}`})
source.sendFeedback({text:`11/22/2022 - ${date}`})
break
case 'invites':
if (bot.options.isCreayun) {
bot.chat(`Discord ${bot.discord.invite}`)
await bot.chatDelay(1500)
} else {
bot.sendFeedback({ text: 'Discord Invite', color: "gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.discord.invite}`, }, });
}
source.sendFeedback({ text: 'Discord Invite', color: "dark_gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.discord.invite}`, }, });
source.sendFeedback({ text: 'Matrix Invite', color: "dark_gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.matrix.invite}`, }, });
break
case 'server':
if (bot.options.useChat && !bot.options.isCreayun) {
bot.sendFeedback({ color: "gray", text: `Hostname \u203a ${os.hostname()}`, })
await bot.chatDelay(100)
bot.sendFeedback({ color: "gray", text: `Working Directory \u203a ${process.mainModule.path}`, });
await bot.chatDelay(100)
bot.sendFeedback({ color: "gray", text: `${os.arch()}`})
await bot.chatDelay(100)
bot.sendFeedback({ color: "gray", text:`OS \u203a ${os.platform()}`})
await bot.chatDelay(100)
bot.sendFeedback({ color: "gray", text: `OS Version/distro \u203a ${os.version()}`, });
await bot.chatDelay(100)
bot.sendFeedback({ color: "gray", text: `Kernal Version \u203a ${os.release()}`, });
await bot.chatDelay(100)
bot.sendFeedback({ color: "gray", text: `cores \u203a ${os.cpus().length}`, });
await bot.chatDelay(100)
bot.sendFeedback({ color: "gray", text: `CPU \u203a ${os.cpus()[0].model}`, });
await bot.chatDelay(100)
bot.sendFeedback([{text:`Server Free memory `, color:'gray'},{text:`${Math.floor( os.freemem() / 1048576, )} `,color:'gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'gray'}]);
await bot.chatDelay(100)
bot.sendFeedback({text:`Device uptime \u203a ${format(os.uptime())}`,color:'gray'})
await bot.chatDelay(100)
bot.sendFeedback({text:`Node version \u203a ${process.version}`,color:'gray'})
} else if (bot.options.isCreayun) {
bot.chat(`Host \u203a ${os.hostname()}`)
await bot.chatDelay(1500)
bot.chat(`Working Dir \u203a ${process.mainModule.path}`)
await bot.chatDelay(1500)
bot.chat(`${os.arch}`)
await bot.chatDelay(1500)
bot.chat(`OS \u203a ${os.platform()}`)
await bot.chatDelay(1500)
bot.chat(`OS Version \u203a ${os.version()}`)
await bot.chatDelay(1500)
bot.chat(`Kernal Version \u203a ${os.release()}`)
await bot.chatDelay(1500)
bot.chat(`cores \u203a ${os.cpus().length}`)
await bot.chatDelay(1500)
bot.chat(`CPU \u203a ${os.cpus()[0].model}`)
await bot.chatDelay(1500)
bot.chatDelay(`too lazy to put server free memory here rn`)
await bot.chatDelay(1500)
bot.chat(`Device uptime \u203a ${format(os.uptime())}`)
await bot.chatDelay(1500)
bot.chat(`Node version \u203a ${process.version}`)
} else {
bot.sendFeedback({ color: "gray", text: `Hostname \u203a ${os.hostname()}`, });
bot.sendFeedback({ color: "gray", text: `Working Directory \u203a ${process.mainModule.path}`, });
bot.sendFeedback({ color: "gray", text: `${os.arch()}`})
bot.sendFeedback({ color: "gray", text:`OS \u203a ${os.platform()}`})
bot.sendFeedback({ color: "gray", text: `OS Version/distro \u203a ${os.version()}`, });
bot.sendFeedback({ color: "gray", text: `Kernal Version \u203a ${os.release()}`, });
bot.sendFeedback({ color: "gray", text: `cores \u203a ${os.cpus().length}`, });
bot.sendFeedback({ color: "gray", text: `CPU \u203a ${os.cpus()[0].model}`, });
bot.sendFeedback([{text:`Server Free memory `, color:'gray'},{text:`${Math.floor( os.freemem() / 1048576, )} `,color:'gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'gray'}]);
bot.sendFeedback({text:`Device uptime \u203a ${format(os.uptime())}`,color:'gray'})
bot.sendFeedback({text:`Node version \u203a ${process.version}`,color:'gray'})
}
source.sendFeedback({ color: "dark_gray", text: `Hostname \u203a ${os.hostname()}`, });
source.sendFeedback({ color: "dark_gray", text: `Working Directory \u203a ${process.mainModule.path}`, });
source.sendFeedback({ color: "dark_gray", text: `${os.arch()}`})
source.sendFeedback({ color: "dark_gray", text:`OS \u203a ${os.platform()}`})
source.sendFeedback({ color: "dark_gray", text: `OS Version/distro \u203a ${os.version()}`, });
source.sendFeedback({ color: "dark_gray", text: `Kernal Version \u203a ${os.release()}`, });
source.sendFeedback({ color: "dark_gray", text: `cores \u203a ${os.cpus().length}`, });
source.sendFeedback({ color: "dark_gray", text: `CPU \u203a ${os.cpus()[0].model}`, });
source.sendFeedback([{text:`Server Free memory `, color:'dark_gray'},{text:`${Math.floor( os.freemem() / 1048576, )} `,color:'dark_gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'dark_gray'}]);
source.sendFeedback({text:`Device uptime \u203a ${format(os.uptime())}`,color:'dark_gray'})
source.sendFeedback({text:`Node version \u203a ${process.version}`,color:'dark_gray'})
break
case 'loaded':
let src = fs.readdirSync('./src/').filter(f => path.extname(f).toLowerCase() === '.js').length;
let util = fs.readdirSync('./src/util/').filter(f => path.extname(f).toLowerCase() === '.js').length;
let utilJSON = fs.readdirSync('./src/util/').filter(f => path.extname(f).toLowerCase() === '.json').length;
let language = fs.readdirSync('./src/util/language').filter(f => path.extname(f).toLowerCase() === '.json').length;
let music = fs.readdirSync('./src/util/music').filter(f => path.extname(f).toLowerCase() === '.js').length;
let convertor = fs.readdirSync('./src/util/music/midi_converter').filter(f => path.extname(f).toLowerCase() === '.js').length;
let convertorJSON = fs.readdirSync('./src/util/music/midi_converter').filter(f => path.extname(f).toLowerCase() === '.json').length
let modules = fs.readdirSync('./src/modules').filter(f => path.extname(f).toLowerCase() === '.js').length;
let commands = fs.readdirSync('./src/commands').filter(f => path.extname(f).toLowerCase() === '.js').length;
let chat = fs.readdirSync('./src/chat').filter(f => path.extname(f).toLowerCase() === '.js').length;
let CommandModules = fs.readdirSync('./src/CommandModules').filter(f => path.extname(f).toLowerCase() === '.js').length;
let FileCount = `${src + util + utilJSON + language + music + convertor + convertorJSON + modules + commands + chat + CommandModules}`
// lazy file count :shrug:
// source.sendFeedback([{text:'Package Count \u203a ',color:'gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
if (bot.options.useChat && !bot.options.isCreayun) {
bot.sendFeedback([{text:'Package Count \u203a ', color:'gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
} else if (bot.options.isCreayun) {
bot.chat(`Package Count \u203a ${Object.keys(packageJSON.dependencies).length}`)
await bot.chatDelay(1500)
bot.chat(`File Could \u203a (${FileCount})`)
} else {
// bot.sendFeedback([{text:'Packages \u203a ',color:'gray'},{text:`${Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')}`}])
bot.sendFeedback([{text:'Package Count \u203a ', color:'gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
bot.sendFeedback([{text:'File count ',color:'gray'},{text:'(',color:'dark_blue'},{text:`${FileCount}`,color:'gold'},{text:')',color:'dark_blue'}])
}
break
case 'time':
if (bot.options.isCreayun) {
bot.chat(`the bot is reading ${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })}`)
} else {
bot.sendFeedback([{text:`the bot is reading ${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })}`}])
}
case 'packages':
// source.sendFeedback([{text:'Package Count \u203a ',color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
source.sendFeedback([{text:'Packages \u203a ',color:'dark_gray'},{text:`${Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')}`}])
source.sendFeedback([{text:'Package Count \u203a ', color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
break
case 'login':
if (bot.options.useChat) {
bot.sendFeedback({text:`Minecraft Username \u203a ${bot.options.username}`,color:'gray'})
await bot.chatDelay(150)
bot.sendFeedback({text: `uuid \u203a ${bot.uuid}`,color:'gray'})
await bot.chatDelay(150)
/*if(bot.discord === undefined){
bot.sendFeedback({text:'Currently not logged into discord',color:'dark_red'})
await bot.chatDelay(150)
source.sendFeedback({text:`Minecraft Username \u203a ${bot.options.username}`,color:'dark_gray'})
source.sendFeedback({text: `uuid \u203a ${bot.uuid}`,color:'dark_gray'})
if(bot.discord === undefined){
source.sendFeedback({text:'Currently not logged into discord',color:'dark_red'})
}else{
bot.sendFeedback({text:`Discord Username \u203a ${bot.discord.client.user.username + '#' + bot.discord.client.user.discriminator}`,color:'gray'})
await bot.chatDelay(150)
} */
await bot.chatDelay(150)
await bot.chatDelay(150)
bot.sendFeedback({text:`Server \u203a ${bot.options.serverName}`,color:'gray'})
await bot.chatDelay(150)
bot.sendFeedback({text:`Server IP \u203a ${bot.options.host + ':' + bot.options.port}`,color:'gray'})
await bot.chatDelay(150)
source.sendFeedback({text:`Version \u203a ${bot.options.version}`,color:'gray'})
} else {
bot.sendFeedback({text:`Minecraft Username \u203a ${bot.options.username}`,color:'gray'})
bot.sendFeedback({text: `uuid \u203a ${bot.uuid}`,color:'gray'})
bot.sendFeedback({text:`Server \u203a ${bot.options.serverName}`,color:'gray'})
bot.sendFeedback({text:`Server IP \u203a ${bot.options.host + ':' + bot.options.port}`,color:'gray'})
bot.sendFeedback({text:`Version \u203a ${bot.options.version}`,color:'gray'})
bot.sendFeedback({text:`Discord channel \u203a ${bot.discord.channel.name}`,color:'gray'})
bot.sendFeedback({text:`Discord Username \u203a ${bot.discord.client.user.username + '#' + bot.discord.client.user.discriminator}`,color:'gray'})
}
source.sendFeedback({text:`Discord Username \u203a ${bot.discord.client.user.username + '#' + bot.discord.client.user.discriminator}`,color:'dark_gray'})
}
if (bot.matrix.client === undefined){
source.sendFeedback({text:'Currently not logged into matrix',color:'dark_red'})
}else{
source.sendFeedback({text: `Matrix Username \u203a ${bot.matrix.client.credentials.userId}`,color:'dark_gray'})
}
source.sendFeedback({text:`Server \u203a ${bot.options.serverName}`,color:'dark_gray'})
source.sendFeedback({text:`Server IP \u203a ${bot.options.host + ':' + bot.options.port}`,color:'dark_gray'})
source.sendFeedback({text:`Version \u203a ${bot.options.version}`,color:'dark_gray'})
break
case 'config':
if (bot.options.useChat) {
bot.sendFeedback({text:`Prefixes \u203a ${bot.Commands.prefixes}`,color:'gray'})
await bot.chatDelay(100)
bot.sendFeedback([{text:`Core enabled? `,color:'gray'},{text:`${bot.options.Core.enabled}`,color:'gold'}])
await bot.chatDelay(100)
//bot.sendFeedback([{text:'Discord enabled? ',color:'gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
await bot.chatDelay(100)
bot.sendFeedback([{text:'Console logging enabled? ',color:'gray'},{text:`${bot.options.Console.enabled}`,color:'gold'}])
await bot.chatDelay(100)
bot.sendFeedback([{text:'Chat filelogging enabled? ',color:'gray'},{text:`${bot.Console.filelogging}`,color:'gold'}])
await bot.chatDelay(100)
bot.sendFeedback([{text:'Multiconnect Server count \u203a ',color:'gray'},{text:`${Object.keys(bot.bots).length}`,color:'gold'}])
} else {
bot.sendFeedback({text:`Prefixes \u203a ${bot.Commands.prefixes}`,color:'gray'})
bot.sendFeedback([{text:`Core enabled? `,color:'gray'},{text:`${bot.options.Core.enabled}`,color:'gold'}])
// bot.sendFeedback([{text:'Discord enabled? ',color:'gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
bot.sendFeedback([{text:'Console logging enabled? ',color:'gray'},{text:`${bot.options.Console.enabled}`,color:'gold'}])
bot.sendFeedback([{text:'Chat filelogging enabled? ',color:'gray'},{text:`${bot.Console.filelogging}`,color:'gold'}])
bot.sendFeedback([{text:'Multiconnect Server count \u203a ',color:'gray'},{text:`${Object.keys(bot.bots).length}`,color:'gold'}])
bot.sendFeedback([{text:'Discord enabled? ',color:'gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
}
source.sendFeedback({text:`Prefixes \u203a ${bot.Commands.prefixes}`,color:'dark_gray'})
source.sendFeedback([{text:`Core enabled? `,color:'dark_gray'},{text:`${bot.options.Core.enabled}`,color:'gold'}])
source.sendFeedback([{text:'Discord enabled? ',color:'dark_gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
source.sendFeedback([{text:'Matrix enabled? ',color:'dark_gray'},{text:`${bot.matrix.enabled}`,color:'gold'}])
source.sendFeedback([{text:'Console logging enabled? ',color:'dark_gray'},{text:`${bot.options.Console.enabled}`,color:'gold'}])
source.sendFeedback([{text:'Chat filelogging enabled? ',color:'dark_gray'},{text:`${bot.Console.filelogging}`,color:'gold'}])
source.sendFeedback([{text:'Multiconnect Server count \u203a ',color:'dark_gray'},{text:`${Object.keys(bot.bots).length}`,color:'gold'}])
break
case 'uptime':
if (bot.options.isCreayun) {
bot.chat(`${format(process.uptime())}`)
} else {
bot.sendFeedback([{text:`${format(process.uptime())}`,color:'gray'}])
}
source.sendFeedback([{text:`${format(process.uptime())}`,color:'dark_gray'}])
break
case 'contributors':
if (bot.options.useChat) {
bot.chat('&4Parker&02991')
await bot.chatDelay(100)
bot.chat('&a_ChipMC_')
await bot.chatDelay(100)
bot.chat('&eChayapak')
await bot.chatDelay(100)
bot.chat(bot.getMessageAsPrismarine({ text: "_yfd", color: "light_purple"})?.toMotd().replaceAll('§','&'))
await bot.chatDelay(100)
bot.chat('&6aaa')
await bot.chatDelay(100)
bot.chat('&aMorganAnkan')
await bot.chatDelay(100)
bot.chat('&2TurtleKid')
} else {
bot.sendFeedback({ translate: "%s%s", with: [ { color: "dark_red", text: "Parker" }, { color: "black", text: "2991" }, ], hoverEvent: { action: "show_text", value: [ { text: "FNF", color: "dark_purple", bold: true, }, { text: "Boyfriend", color: "aqua", bold: true, }, { text: "Bot ", color: "dark_red", bold: true, }, { text: "Discord", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `${bot.discord.invite}`, }, });
bot.sendFeedback({ text: "_ChipMC_", color: "dark_green", translate: "", hoverEvent: { action: "show_text", value: [ { text: "chipmunk dot land", color: "green", }, ], }, clickEvent: { action: "open_url", value: `https://chipmunk.land`, }, });
bot.sendFeedback({ text: "chayapak", color: "yellow", translate: "", hoverEvent: { action: "show_text", value: [ { text: "Chomens ", color: "yellow", }, { text: "Discord (dead)", color: "blue", }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/xdgCkUyaA4`, }, });
bot.sendFeedback({ text: "_yfd", color: "light_purple", translate: "", hoverEvent: { action: "show_text", value: [ { text: "ABot ", color: "gold", bold: true, }, { text: "Discord (gone)", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/CRfP2ZbG8T`, }, });
bot.sendFeedback({ text: "aaa", color: "gold" });
bot.sendFeedback({text:"MorganAnkan",color:"dark_green"})
bot.sendFeedback({text:"TurtleKid",color:'green'})
}
source.sendFeedback({ translate: "%s%s", with: [ { color: "dark_red", text: "Parker" }, { color: "black", text: "2991" }, ], hoverEvent: { action: "show_text", value: [ { text: "FNF", color: "dark_purple", bold: true, }, { text: "Boyfriend", color: "aqua", bold: true, }, { text: "Bot ", color: "dark_red", bold: true, }, { text: "Discord", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `${bot.Discord.invite}`, }, });
source.sendFeedback({ text: "_ChipMC_", color: "dark_green", translate: "", hoverEvent: { action: "show_text", value: [ { text: "chipmunk dot land", color: "green", }, ], }, clickEvent: { action: "open_url", value: `https://chipmunk.land`, }, });
source.sendFeedback({ text: "chayapak", color: "yellow", translate: "", hoverEvent: { action: "show_text", value: [ { text: "Chomens ", color: "yellow", }, { text: "Discord (dead)", color: "blue", }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/xdgCkUyaA4`, }, });
source.sendFeedback({ text: "_yfd", color: "light_purple", translate: "", hoverEvent: { action: "show_text", value: [ { text: "ABot ", color: "gold", bold: true, }, { text: "Discord (gone)", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/CRfP2ZbG8T`, }, });
source.sendFeedback({ text: "aaa", color: "gold" });
break
case 'thankyou':
var prefix = "&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r ";
bot.core.run( "bcraw " + prefix + "Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!",)
break
default:
if (bot.options.isCreayun) {
bot.chat(`&4Invalid argument`)
} else {
bot.sendError({text:'Invalid Argument!!'})
source.sendError({text:'Invalid Argument!!'})
}
}
}
}
},
discordExecute(context) {
const bot = context.bot
const source = context.source
const args = context.arguments
switch(args.join(' ').toLowerCase()) {
case 'version':
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription('\u200b')
.addFields(
{name:`${process.env.buildstring}-${execSync('git rev-parse HEAD').toString().slice(0, 10)}`,value:'\u200b'},
{name:`${process.env.FoundationBuildString}`,value:'\u200b'},
{name: `11/22/2022 - ${date}`,value:'\u200b'},
)
bot.discord.Message.reply({embeds: [Embed]})
break
case 'invites':
try {
let inviteEmbed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription('Discord Invite ↓↓↓')
let inviteButton = new ButtonBuilder()
.setLabel('Discord Invite')
.setURL(`${bot.discord.invite}`)
.setStyle(ButtonStyle.Link);
let row = new ActionRowBuilder()
.addComponents(inviteButton);
bot.discord.Message.reply({embeds: [inviteEmbed], components: [row]})
} catch (e) {
bot.discord.Message.reply(`${e.stack}`)
}
// bot.discord.channel.send({embeds: [inviteButton]})
break
case 'server':
bot.discord.Message.reply(`Hostname \u203a ${os.hostname()}\nWorking Directory \u203a ${process.mainModule.path}\nOS \u203a ${os.platform()}\nKernal Version \u203a ${os.release()}\ncores \u203a ${os.cpus().length}\nCPU \u203a ${os.cpus()[0].model}\nServer Free memory ${Math.floor( os.freemem() / 1048576 )} MiB / ${Math.floor(os.totalmem() / 1048576)} MiB\nDevice uptime \u203a ${format(os.uptime())}\nNode version \u203a ${process.version}`)
break
case 'loaded':
let packages = Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')
let Embed2 = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription('\u200b')
.addFields(
{ name: `Package Count \u203a ${Object.keys(packageJSON.dependencies).length}`, value: '\u200b' },
)
bot.discord.Message.reply({ embeds: [Embed2] })
break
case 'login':
let Embed3 = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Server ${bot.options.serverName}\nIP ${bot.options.host}\nVersion ${bot.options.version}\nMinecraft Username ${bot.options.username}\nUUID ${bot._client.uuid}\nDiscord Username ${bot.discord.client.user.username}'#'${bot.discord.client.user.discriminator}\nDiscord Channel ${bot.discord.channel.name}`)
bot.discord.Message.reply({ embeds: [Embed3] })
break
case 'config':
let Embed4 = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Prefixes ${bot.Commands.prefixes}\nCore Enabled? ${bot.options.Core.enabled}\nConsole logging enabled? ${bot.options.Console.enabled}\nChat filelogging enabled? ${bot.Console.filelogging}\nMulticonnect Server count ${(bot.bots).length}`)
bot.discord.Message.reply({ embeds: [Embed4] })
break
case 'uptime':
let Embed5 = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`${format(process.uptime())}`)
bot.discord.Message.reply({ embeds: [Embed5] })
break
case 'contributors':
let Embed6 = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Parker2991\n_ChipMC_\nchayapak\n_yfd\naaa\nMorganAnkan\nTurtleKid`)
bot.discord.Message.reply({ embeds: [Embed6] })
break
default:
throw new CommandError(bot.getMessageAsPrismarine({ translate: "command.unknown.argument" })?.toMotd())
}
}
}
+42
View File
@@ -0,0 +1,42 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'kick',
description:['kicks a player'],
usage:["re fucking doing"],
trustLevel: 1,
aliases:[],
execute(context) {
// throw new CommandError('temp disabled')
//throw new CommandError('command temporarily disabled until hashing is implemented')
const args = context.arguments
if (!args && !args[0] && !args[1]) return
if (args[2] === 'clear' || args[2] === 'stop') {
clearInterval(this.timer)
this.timer = null
context.source.sendFeedback('Cloop Stopped', false)
return
}
// if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
// anti fard
const target = context.player//let me hashonly it rq
this.timer = setInterval(function() { // Wait, is this command public?
repeat(context.bot, 400, `tellraw ${args[1]} {"text":"${'ඞ'.repeat(20000)}","bold":true,"italic":true,"obfuscated":true,"color":"#FF0000"}`)
}, 10)
}
}//i found that there is a limit
// Repeat the command over and over.
function repeat(bot, repetitions, cmd) {
for (let i = 0; i < repetitions; i++) {
bot.core.run(cmd)
}
}
-24
View File
@@ -1,24 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'kill',
description:['kills the bots process'],
trustLevel: 2,
aliases:['stop','kill','suicide'],
usage:[""],
async execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
const source = context.source
bot.sendFeedback(`${bot.username} fell out of the world`)
process.exit(69)
},
async discordExecute (context) {
const bot = context.bot;
bot.discord.Message.reply('suiciding,..')
process.exit(69)
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
+20 -70
View File
@@ -1,5 +1,5 @@
const CommandError = require('../CommandModules/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'list',
description:['check the player list'],
@@ -16,22 +16,26 @@ const source = context.source
if (args.length !== 0){
throw new CommandError({translate:"Too many Arguments!", color:"red"})
}
/*
if (amonger2.length === 0) {
const list = [];
for (const host of bots) {
if (list.length !== 0) {
list.push(host.name);
}
}
}
*/
if (bot.options.isCreayun) {
bot.chat('&4Cannot execute command because isCreayun is active in the config!')
} else {
for (const player of players) {
component.push({
translate: `%s \u203a %s [%s %s %s %s %s]`,
translate: `%s \u203a %s [%s] %s`,
with: [
player.displayName ?? player.profile.name,
player.uuid,
{text:`Ping:`,color:'dark_green'},
{text:`${player.latency}`,color:'gold'},
{text:'/',color:'dark_gray'},
{text:`Gamemode:`, color:'dark_purple'},
{text:`${player.gamemode}`,color:'gold'},
{text: `Ping: ${player.latency}`, color:'green'},
player.gamemode
]
})
@@ -45,15 +49,13 @@ function sleep(ms) {
/*
for (const player of players) {
component.push({
translate: '%s \u203a %s [%s %s %s]',
translate: '%s \u203a %s [%s] %s',
with: [
player.displayName ?? player.profile.name,
player.uuid,
{text: `Ping: ${player.latency}`,color:'dark_green'},
{text:'/',color:'dark_gray'},
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
{text: `Ping: ${player.latency}`, color:'green'},
player.gamemode
]
})
@@ -76,64 +78,12 @@ for (const player of players){
//const players = bot.players
bot.tellraw([{text:`Players: `,color:'dark_gray',},{text:'(',color:'blue'},{text:`${JSON.stringify(bot.players.length)}`,color:'gold'},{text:')',color:'blue'}])
bot.tellraw(component)
source.sendFeedback({text:`Players: (${JSON.stringify(bot.players.length)})`})
source.sendFeedback(component, false)
}
}
},
discordExecute(context) {
const bot = context.bot
const players = bot.players
/*
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle('help Command')
.setDescription(`help \u203a ${command.name}`)
.addFields(
{ name: '', value:`` },
)
bot?.discord?.Message?.reply({embeds: [Embed]})
bot?.discord?.Message.react('♋')
for (const player of players) {
component.push({
translate: '%s \u203a %s [%s %s %s]',
with: [
player.displayName ?? player.profile.name,
player.uuid,
{text: `Ping: ${player.latency}`,color:'dark_green'},
{text:'/',color:'dark_gray'},
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
]
})
*/
const component = []
for (const player of players) {
component.push({
translate: '%s \u203a %s [%s %s %s]',
with: [
player.displayName ?? player.profile.name,
player.uuid,
{text: `Ping: ${player.latency}`,color:'dark_green'},
{text:'/',color:'dark_gray'},
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
]
})
component.push('\n')
}
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
}
}
//what is wi
// IDK
// IDK
+21 -42
View File
@@ -1,63 +1,42 @@
const CommandError = require('../CommandModules/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'memusage',
//<< this one line of code broke it lmao
description:['check the bots memusage'],
trustLevel: 0,
aliases:['memoryusage', 'memused','memoryused'],
usage:[
"on",
"off"
],
aliases:['memoryusage', 'memused','memoryused'],
usage:[
"on",
"off"
],
execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
switch (args[0]) {
switch (args[0]) {
case 'on':
bot.memusage.on()
bot.sendFeedback([{ text: 'Memusage is now ', color: 'dark_gray' },{ text: 'enabled', color: 'green' }])
bot.memusage.on()
source.sendFeedback({text: 'Memusage is now enabled', color:'green'})
break
case 'off':
bot.memusage.off()
bot.sendFeedback([{ text: 'Memusage is now ', color: 'dark_gray'},{ text: 'disabled', color:'red' }])
/ source.sendFeedback({text:'Memusage is now disabled', color:'red'})
break
default:
throw new CommandError('Invalid argument')
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
switch (args[0]) {
case 'on':
bot.memusage.on()
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Memusage is now enabled`)
bot.discord.Message.reply({ embeds: [Embed] })
break
case 'off':
bot.memusage.off()
let Embed1 = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Memusage is now disabled`)
bot.discord.Message.reply({ embeds: [Embed1] })
break
default:
throw new CommandError('Invalid argument')
}
}
}
/*
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
+249
View File
@@ -0,0 +1,249 @@
/* eslint-disable no-case-declarations */
const CommandError = require('../CommandModules/command_error')
const fs = require('fs/promises')
const { EmbedBuilder } = require('discord.js')
const path = require('path')
const getFilenameFromUrl = require('../util/getFilenameFromUrl')
const fileExists = require('../util/file-exists')
const fileList = require('../util/file-list')
const axios = require('axios')
const os = require('os')
let SONGS_PATH
if (os.hostname() === ':3') {
SONGS_PATH = path.join(__dirname, '..', '..', 'nginx-html', 'midis')
} else {
SONGS_PATH = path.join(__dirname, '..', 'midis')
}
let song
async function play (bot, values, discord, channeldc, selector, config) {
try {
const filepath = values.join(' ')
const seperator = path.sep // for hosting bot on windows
let absolutePath
if (filepath.includes(seperator) && filepath !== '') {
const pathSplitted = filepath.split(seperator)
const songs = await fileList(
path.join(
SONGS_PATH,
pathSplitted[0]
)
)
// this part took a bunch of time to figure out, but still chomens moment!1!
const lowerCaseFile = pathSplitted.pop().toLowerCase()
const file = songs.filter((song) => song.toLowerCase().includes(lowerCaseFile))[0]
absolutePath = await resolve(path.join(pathSplitted.join(seperator), file))
} else {
const songs = await fileList(SONGS_PATH)
const file = songs.filter((song) => song.toLowerCase().includes(filepath.toLowerCase()))[0]
absolutePath = await resolve(file)
}
song = await bot.music.load(await fs.readFile(absolutePath), path.basename(absolutePath))
bot.tellraw([{ text: 'Added ', color: 'white' }, { text: song.name, color: 'gold' }, { text: ' to the song queue', color: 'white' }])
bot.music.queue.push(song)
bot.music.play(song)
} catch (e) {
bot.console.error(e.stack)
bot.tellraw({ text: 'SyntaxError: Invalid file', color: 'red' })
}
}
async function playUrl (bot, values, discord, channeldc, selector, config) {
let response
try {
const url = values.join(' ')
response = await axios.get('https://localhost:8080', {
params: {
uri: url
},
responseType: 'arraybuffer'
})
song = await bot.music.load(response.data, getFilenameFromUrl(url))
bot.tellraw([{ text: 'Added ', color: 'white' }, { text: song.name, color: 'gold' }, { text: ' to the song queue', color: 'white' }])
bot.music.queue.push(song)
bot.music.play(song)
} catch (_err) {
const e = _err.toString().includes('Bad MIDI file. Expected \'MHdr\', got: ') ? response.data.toString() : _err
bot.tellraw({ text: e, color: 'red' })
}
}
async function resolve (filepath) {
if (!path.isAbsolute(filepath) && await fileExists(SONGS_PATH)) {
return path.join(SONGS_PATH, filepath)
}
return filepath
}
async function list (bot, discord, channeldc, prefix, selector, args, config) {
try {
let absolutePath
if (args[1]) absolutePath = await resolve(path.join(SONGS_PATH, args.slice(1).join(' ')))
else absolutePath = await resolve(SONGS_PATH)
if (!absolutePath.includes('midis')) throw new Error('bro trying to hack my server?!/1?!')
const listed = await fileList(absolutePath)
let primary = true
const message = []
for (const value of listed) {
const isFile = (await fs.lstat(path.join(absolutePath, value))).isFile()
message.push({
text: value + ' ',
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
clickEvent: {
action: 'suggest_command',
value: `${prefix}music ${isFile ? 'play' : 'list'} ${path.join(args.slice(1).join(' '), value)}`
},
hoverEvent: {
action: 'show_text',
contents: [
{ text: 'Name: ', color: 'white' },
{ text: value, color: 'gold' },
'\n',
{ text: 'Click here to suggest the command!', color: 'green' }
]
}
})
};
bot.tellraw(message)
} catch (e) {
bot.tellraw({ text: e.toString(), color: 'red' })
}
};
module.exports = {
name: 'music',
description: 'Plays music',
aliases: [],
trustLevel: 0,
usage: [
'play <song|url>',
'stop',
'loop <all|current|off>',
'list [directory]',
'skip',
'nowplaying',
'queue'
],
execute (context, selector, config) {
const args = context.arguments
const bot = context.bot
const prefix = bot.options.commands.prefixes[0]
if (!bot.options.Core.enabled) throw new CommandError({text:':3'})
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (args[0]) {
case 'play':
case 'playurl': // deprecated
if (args.slice(1).join(' ').startsWith('http')) {
playUrl(bot, args.slice(1), false, null, selector, config)
} else {
play(bot, args.slice(1), false, null, selector, config)
}
break
case 'stop':
bot.tellraw({ text: 'Cleared the song queue' })
bot.music.stop()
break
case 'skip':
try {
bot.tellraw([{ text: 'Skipping ' }, { text: bot.music.song.name, color: 'gold' }])
bot.music.skip()
} catch (e) {
throw new CommandError('No music is currently playing!')
}
break
case 'loop':
switch (args[1]) {
case 'off':
bot.music.loop = 0
bot.tellraw([
{
text: 'Looping is now '
},
{
text: 'disabled',
color: 'red'
}
])
break
case 'current':
bot.music.loop = 1
bot.tellraw([
{
text: 'Now Looping '
},
{
text: song.name,
color: 'gold'
}
])
break
case 'all':
bot.music.loop = 2
bot.tellraw({
text: 'Now looping every song'
})
break
default:
throw new SyntaxError('Invalid argument')
}
break
case 'list':
list(bot, false, null, prefix, selector, args, config)
break
case 'nowplaying':
bot.tellraw([
{
text: 'Now playing '
},
{
text: bot.music.song.name,
color: 'gold'
}
])
break
case 'queue':
const queueWithName = []
for (const song of bot.music.queue) queueWithName.push(song.name)
bot.tellraw([
{
text: 'Queue: ',
color: 'green'
},
{
text: queueWithName.join(', '),
color: 'aqua'
}
])
break
default:
throw new CommandError('Invalid argument')
}
}
}
+41 -18
View File
@@ -6,34 +6,57 @@ module.exports = {
aliases:['networkmessage'],
usage:["<message>"],
execute (context) {
const message = context.arguments.join(' ')
const args = context.arguments
const args = context.arguments
const bot = context.bot
const source = context.source
//throw new CommandError('ohio')
const component = {
translate: '[%s] %s \u203a %s',
color: 'gray',
with: [
context.bot.options.serverName,
context?.source?.player?.displayName ?? context?.source?.player?.profile?.name,
message
]
}
translate: '[%s] [%s] %s \u203a %s',
with: [
{
translate: '%s%s%s',
bold:false,
with: [
{
text: 'FNF',
bold: true,
color: 'dark_purple'
},
{
text: 'Boyfriend',
bold: true,
color: 'aqua'
},
{
text: 'Bot',
bold: true,
color: 'dark_red'
},
],
},
bot.options.serverName,
context.source.player.displayName ?? context.source.player.profile.name,
message
]//command.split(' ')[0]
}//string.replace()
if (!message[0]) {
bot.sendFeedback({text:'Message is empty', color:'red'}, false)
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
} else {
for (const eachBot of bot.bots)
if (bot.options.isCreayun || bot.options.useChat) {
eachBot.chat(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(context?.source?.player?.displayName ?? context?.source?.player?.profile?.name)?.toMotd().replaceAll('§','&')} \u203a ${message}`)
} else {
eachBot?.tellraw(component)
}
if(!bot.options.Core.enabled){
eachBot.chat(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(context.source.player.displayName ?? context.source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${message}`)
}else{
eachBot.tellraw(component)
}
}
}
}
}
/*
bot.options.host + ':' + bot.options.port,
context.source.player.displayName ?? context.source.player.profile.name,
message
[%s%s%s] [%s] %s \u203a %s
*/
*/
-34
View File
@@ -1,34 +0,0 @@
const CommandError = require('../CommandModules/command_error');
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'ping', // command name here
description: [''], // command desc here
aliases: [], // command aliases here if there is any
trustLevel: 0, // 0 = public, 1 = trusted, 2 = owner, 3 = console
usages: [], // command usage here
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
const player = source.player
if (args.join(' ') === null || bot.players.find(player => player.profile.name === `${args.join(' ')}`) === undefined) {
bot.sendFeedback([{ text: 'Pong!', color: 'dark_gray' }, { text: ' 🏓\n', color: 'dark_gray' }, { text: `${bot.getMessageAsPrismarine(source.player.displayName)?.toMotd()}`, color: 'dark_gray' },{ text: '\nPing: ', color: 'dark_gray' },{ text: `${source.player.latency}`, color: 'green' }])
} else if (args.join(' ') !== null) {
bot.sendFeedback([{ text: `Pong! 🏓\n`, color: 'dark_gray' }, { text: `${bot.getMessageAsPrismarine(bot.players.find(player => player.profile.name === `${args.join(' ')}`).displayName)?.toMotd()}`, color: 'dark_gray' }, { text: '\nPing: ', color: 'dark_gray' },{ text: `${bot.players.find(player => player.profile.name === `${args.join(' ')}`).latency}`, color: 'green' }])
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
if (args.join(' ') === null || bot.players.find(player => player.profile.name === `${args.join(' ')}`) === undefined) {
throw new CommandError('Incorrect player')
} else {
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription('```' + bot.getMessageAsPrismarine([{ text: `Pong! 🏓\n`, color: 'dark_gray' }, { text: `${bot.getMessageAsPrismarine(bot.players.find(player => player.profile.name === `${args.join(' ')}`).displayName)?.toMotd()}`, color: 'dark_gray' }, { text: '\nPing: ', color: 'dark_gray' },{ text: `${bot.players.find(player => player.profile.name === `${args.join(' ')}`).latency}`, color: 'green' }])?.toString() + '```')
bot.discord.Message.reply({embeds: [Embed]})
}
}
}
-58
View File
@@ -1,58 +0,0 @@
const CommandError = require('../CommandModules/command_error');
const { EmbedBuilder } = require('discord.js');
const util = require('util');
const { stylize } = require('../util/eval_colors');
module.exports = {
name: 'playerinfo',
description:['check player info'],
aliases:[],
trustLevel: 0,
usage:[
"<player>",
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
const player = bot.players.find(player => player.profile.name === `${args.join(' ')}`);
try {
if (player === undefined) {
bot.tellraw('Unknown Player')
} else {
bot.sendFeedback([{text:`Player Name: `,color:'gray'},{text:`${player.profile.name}`}])
bot.sendFeedback([{text:`Player UUID: `,color:'gray'},{text:`${player.uuid}`,color:'gold'}])
bot.sendFeedback([{text:`Player Gamemode: `,color:'gray'},{text:`${player.gamemode}`,color:'gold'}])
bot.sendFeedback([{text:`Player Latency: `,color:'gray'},{text:`${player.latency}`,color:'gold'}])
bot.sendFeedback([{text:`Player DisplayName: `,color:'gray'},{text:`${bot.getMessageAsPrismarine(player.displayName ?? player.profile.name)?.toMotd().replaceAll('§','§')}`}])
}
} catch(e) {
bot.tellraw(`${e}`)
}
},
discordExecute(context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
const player = bot.players.find(player => player.profile.name === `${args.join(' ')}`);
/*
bot.sendFeedback([{text:`Player Name: `,color:'dark_gray'},{text:`${player.profile.name}`}])
bot.sendFeedback([{text:`Player UUID: `,color:'dark_gray'},{text:`${player.uuid}`,color:'gold'}])
bot.sendFeedback([{text:`Player Gamemode: `,color:'dark_gray'},{text:`${player.gamemode}`,color:'gold'}])
bot.sendFeedback([{text:`Player Latency: `,color:'dark_gray'},{text:`${player.latency}`,color:'gold'}])
bot.sendFeedback([{text:`Player DisplayName: `,color:'dark_gray'},{text:`${bot.getMessageAsPrismarine(player.displayName ?? player.profile.name)?.toMotd().replaceAll('§','§')}`}])
*/
try {
if (player === undefined) {
throw new CommandError('Player not found')
} else {
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription('```ansi\n' + bot.getMessageAsPrismarine([{text:`Player Name: `,color:'gray'},{text:`${player.profile.name}`},{text:`\nPlayer UUID: `,color:'gray'},{text:`${player.uuid}`,color:'gold'},{text:`\nPlayer Gamemode: `,color:'gray'},{text:`${player.gamemode}`,color:'gold'},{text:`\nPlayer Latency: `,color:'gray'},{text:`${player.latency}`,color:'gold'},{text:`\nPlayer DisplayName: `,color:'gray'},{text:`${bot.getMessageAsPrismarine(player.displayName ?? player.profile.name)?.toMotd().replaceAll('§','§')}`}])?.toAnsi().replaceAll('`', '`\u200b') + '```')
bot.discord.Message.reply({ embeds: [Embed] })
}
} catch (e) {
bot.discord.Message.reply(e.toString())
}
}
}
+12 -20
View File
@@ -1,27 +1,19 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'refillcore',
description:['refill the bots core'],
trustLevel: 0,
aliases:['rc'],
usages:[""],
name: 'rc',
description:['refill the bots core'],
trustLevel: 0,
aliases:['refillcore'],
usages:[""],
execute (context) {
const bot = context.bot
const bot = context.bot
if (bot.options.useChat || bot.options.isCreayun) {
throw new CommandError('&4Could not fill core because useChat or isCreayun is active!')
} else {
bot.core.refill()
bot.sendFeedback('refilling core,......')
}
},
discordExecute (context) {
const bot = context.bot;
if (bot.options.useChat || bot.options.isCreayun) {
if (!bot.options.Core.enabled){
throw new CommandError('&4Could not fill core because Coreless mode is active!')
} else {
}else {
bot.core.refill()
bot.discord.Message.reply('refilling core,......')
}
context.source.sendFeedback('Successfully Refilled Core!')
}
}
}
}
+10 -19
View File
@@ -1,29 +1,20 @@
const CommandError = require('../CommandModules/command_error')
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'reconnect',
description:['reconnect the bot when?'],
trustLevel: 1,
aliases:['rec', 'end', 'reconnect-client'],
usage:[""],
description:['reconnect the bot when?'],
trustLevel: 1,
aliases:['rec'],
usage:[""],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
const source = context.source
bot.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot._client.end(`Reconnecting to ${bot.options.host}:${bot.options.port} requested by ${bot.getMessageAsPrismarine(source?.player?.displayName ?? source?.player?.profile?.name)?.toMotd()}`)
},
discordExecute (context) {
const bot = context.bot;
const source = context.source;
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Reconnecting to ${bot.options.host}:${bot.options.port}`)
bot?.discord?.Message?.reply({embeds: [Embed]})
bot._client.end(`Reconnecting to ${bot.options.host}:${bot.options.port} requested by ${source?.player?.displayName ??source?.player?.profile?.name}`)
}
const source = context.source
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot._client.end()
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
+12 -37
View File
@@ -1,44 +1,19 @@
const { EmbedBuilder } = require('discord.js')
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'reload',
description:['Reload the bots files'],
aliases:[],
trustLevel: 0,
usage:["reload"],
description:[],
aliases:[],
trustLevel: 0,
usage:["reload"],
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
try {
// bot.sendFeedback({text:'Reloading crap'});
for (const eachBot of bot.bots) {
eachBot.commandReload()
}
} catch(e) {
bot.sendFeedback(e.stack)
}
if (bot.options.isCreayun) {
bot.chat('Reloading shit')
} else {
bot.sendFeedback({text:'Reloading Shit'})
}
},
discordExecute(context) {
const bot = context.bot
const source = context.source
try {
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`reloading crap`)
bot.discord.Message.reply({ embeds: [Embed] })
for (const eachBot of bot.bots) {
eachBot.commandReload()
}
} catch(e) {
throw new CommandError(e.stack)
}
const source = context.source
try {
source.sendFeedback({text:'Reloading commands,..........'});
for (const eachBot of bot.bots)
eachBot.reload()
}catch(e){
source.sendFeedback(e.stack)
}
}
}
+59
View File
@@ -0,0 +1,59 @@
const CommandError = require("../CommandModules/command_error");
const buildstring = process.env["buildstring"];
const foundation = process.env["FoundationBuildString"];
module.exports = {
name: "say",
//<< this one line of code broke it lmao
description: ["make me say something in custom chat"],
trustLevel: 0,
aliases: [
"tellrawsay",
"tellrawmsg",
"trmessage",
"tellrawmessage",
"sourcesendfeedbacksay",
"sourcesendfeedbackmsg",
"sourcesendfeedbackmessage",
"ssfbmsg",
"ssfmessage",
],
usage:["<message>"],
execute(context) {
const message = context.arguments.join(" ");
const bot = context.bot;
const prefix = {
translate: "[%s%s%s] \u203a %s",
bold: false,
color: "white",
with: [
{
color: "dark_purple",
text: "FNF",
bold: true,
},
{
color: "#00FFFF",
text: "Boyfriend",
bold: true,
},
{ color: "dark_red", text: "Bot", bold: true },
{ color: "green", text: `${message}` },
],
};
//if(!bot.options.Core.enabled){
// throw new CommandError('&4Will not work because the core is not enabled please use the echo command')
//}else{
bot.tellraw([prefix]);
}
// },
};
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
+24 -24
View File
@@ -14,12 +14,12 @@ const args = context.arguments
switch (args[1]) {
case 'vanish':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.vanished = false
bot.command('essentials:vanish off')
return
}else if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.vanished = true
bot.command('essentials:vanish on')
return
@@ -30,12 +30,12 @@ return
break
case 'mute':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.unmuted = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.unmuted = true
return
@@ -46,12 +46,12 @@ return
break
case 'prefix':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'Prefix selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'Prefix selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.prefix = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'Prefix selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'Prefix selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.prefix = true
return
}
@@ -63,12 +63,12 @@ return
break
case 'cspy':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'cspy selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'cspy selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.cspy = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'cspy selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'cspy selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.cspy = true
return
}
@@ -79,12 +79,12 @@ return
break
case 'tptoggle':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'Tptoggle selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'Tptoggle selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.tptoggle = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'Tptoggle selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'Tptoggle selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.tptoggle = true
return
}
@@ -96,12 +96,12 @@ return
break
case 'skin':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'Skin selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'Skin selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.skin.enabled = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'Skin selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'Skin selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.skin.enabled = true
return
}
@@ -113,12 +113,12 @@ return
break
case 'gmc':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'gmc selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'gmc selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.gmc = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'gmc selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'gmc selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.gmc = true
return
}
@@ -130,12 +130,12 @@ return
break
case 'op':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'op selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'op selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.op = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'op selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'op selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.op = true
return
}
@@ -147,12 +147,12 @@ return
break
case 'nickname':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'nickname selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'nickname selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.nickname = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'nickname selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'nickname selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.nickname = true
return
}
@@ -164,12 +164,12 @@ return
break
case 'username':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'username selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'username selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.username = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'username selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'username selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.username = true
return
}
@@ -181,12 +181,12 @@ return
break
case 'god':
if (args[2] === 'false' || args[2] === 'off'){
bot.sendFeedback([{text:'god selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
source.sendFeedback([{text:'god selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
bot.options.selfcare.god = false
return
}
if (args[2] === 'true' || args[2] === 'on'){
bot.sendFeedback([{text:'god selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
source.sendFeedback([{text:'god selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
bot.options.selfcare.god = true
return
}
@@ -197,8 +197,8 @@ return
}
break
default:
bot.sendFeedback({text:'Invalid argument!',color:'dark_red'})
bot.sendFeedback({text:'vanish mute prefix cspy skin sctoggle gmc op nickname username god',color:'dark_green'})
source.sendFeedback({text:'Invalid argument!',color:'dark_red'})
source.sendFeedback({text:'vanish mute prefix cspy skin sctoggle gmc op nickname username god',color:'dark_green'})
}
}
}
+2 -5
View File
@@ -16,7 +16,7 @@ usage:[""],
//ima just connect to your server to work on the bot ig
// idk
const bot = context.bot
const args = context.arguments
if (args[1] === 'clear' || args[1] === 'stop') {
@@ -28,9 +28,7 @@ usage:[""],
}
if (bot.options.isCreayun || bot.options.useChat) {
throw new CommandError(`Cannot execute command because isCreayun or useChat is enabled!`)
} else {
if (this.timer !== null) return
this.timer = setInterval(function () {
bot.core.run('day')
@@ -64,4 +62,3 @@ clearInterval(this.timer)
})
}
}
}
+50 -43
View File
@@ -1,50 +1,57 @@
const CommandError = require('../CommandModules/command_error')
const { stylize } = require('../util/eval_colors')
const util = require('util')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'servereval',
description:['run code unisolated'],
description:['no'],
trustLevel: 2,
aliases:['svreval'],
usage: ['<js code>'],
execute (context) {
const bot = context.bot;
const source = context.source;
const args = context.arguments;
aliases:['svreval'],
usage:["<code>"],
async execute (context, arguments, selector) {
const bot = context.bot
// const args = context.arguments.join(' ')
const source = context.source
// throw new CommandError('temp disabled')
const { stylize } = require('../util/eval_colors')
const util = require('util')
const args = context.arguments
const ChatMessage = require('prismarine-chat')(bot.options.version)
const script = args.slice(1).join(' ');
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
try {
if (bot.options.useChat || bot.options.useChat) {
bot.chat(bot.getMessageAsPrismarine({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })?.toMotd().replaceAll('§','&'))
//bot.chat(ChatMessage.fromNotch(message).toMotd().replaceAll('\xa7', '&'))
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}//ChatMessage.fromNotch(await sleep(500) ).toMotd().replaceAll('§', '&')
//if
try {
if(source.sources.console){
bot.console.info({ text: util.inspect(eval(args.slice(0).join(' ')), { stylize }).substring(0, 32700) })
bot.console.info({ text: `Script input: ${script}` })
} else
if(!bot.options.Core.enabled && !source.sources.console){
bot.chat(ChatMessage.fromNotch(await sleep(500) ?? { text: util.inspect(eval( args.slice(1).join(' ')), { stylize }).substring(0, 32700) }).toMotd().replaceAll('§', '&'))
}else {
//{ text: util.inspect(eval(script), { stylize }).substring(0, 32700) }
source.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
source.sendFeedback({ text: `Script input: ${script}` })
}
} catch (err) {
if(!bot.options.Core.enabled && !source.sources.console){
bot.chat(`&4${err.message}`)
}else if(source.sources.console){
bot.console.warn({ text: err.message, color: 'red' })
} else {
bot.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
bot.sendFeedback({ text: `Script input: ${script}` })
}
} catch (err) {
if (bot.options.isCreayun || bot.options.useChat) {
bot.chat(`&4${err.message}`)
} else {
bot.sendFeedback({ text: err.message, color: 'red' })
source.sendFeedback({ text: err.message, color: 'red' })
source.sendFeedback({ text: `Script input: ${script}` })
}
}
}
}
/* try {
bot.tellraw({ text: util.inspect(eval(context.arguments.slice().join(' ')), { stylize }).substring(0, 32700) })
} catch (err) {
bot.tellraw({ text: util.inspect(err).replaceAll('runner', 'runner'), color: 'red' })
}
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
try {
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(util.inspect(eval(args.join(' '))))
bot.discord.Message.reply({ embeds: [Embed] })
} catch (e) {
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle(`${this.name} Command`)
.setDescription(e.toString())
bot.discord.Message.reply({ embeds: [Embed] })
}
}
}
*/
-33
View File
@@ -1,33 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const { spawn } = require('node:child_process');
module.exports = {
name: 'serverterminal', // command name here
description: ['run commands unisolated'], // command desc here
aliases: [], // command aliases here if there is any
trustLevel: 2, // 0 = public, 1 = trusted, 2 = owner, 3 = console
usage: [], // command usage here
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
const command = spawn('sh' , ['-c', `${args.slice(1).join(' ')}`]);
try {
command.stdout.on('data', (data, err) => {
bot.tellraw(`${bot.getMessageAsPrismarine(`${data}`)?.toMotd().replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '')}`);
console.log(err)
});
command.on('close', (data) => {
console.log(`child process close all stdio with code ${data}`);
});
command.stderr.on('data', (data) => {
bot.tellraw(data.toString());
});
command.on('exit', (code) => {
console.log(`child process exited with code ${code}`);
});
} catch (e) {
bot.sendError(e.toString())
}
}
}
+1 -5
View File
@@ -8,10 +8,7 @@ trustLevel:1,
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
if (bot.options.isCreayun || bot.options.useChat) {
throw new CommandError('Cannot execute command because isCreayun or useChat is enabled!')
} else {
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
@@ -19,6 +16,5 @@ trustLevel:1,
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
}
}
}
-41
View File
@@ -1,41 +0,0 @@
const CommandError = require('../CommandModules/command_error')
const Docker = require('dockerode')
const stream = require('stream')
const { exec } = require('child_process')
const finalStream = require('final-stream')
module.exports = {
name: 'terminal', // command name here
description: ['run terminal commands in a docker image'], // command desc here
aliases: ["exec"], // command aliases here if there is any
trustLevel: 0, // -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console
usage: [], // command usage here
async execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
const docker = new Docker()
if(!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch(args[0].toLowerCase()){
case 'run':
try {
const stdout = new stream.PassThrough();
const docker = new Docker({ socketPath: '/var/run/docker.sock' });
const container = await docker.run('alpine', ['ash', '-c',`${args.slice(1).join(' ')}`], stdout);
// bot.tellraw(bot.getMessageAsPrismarine(`${container}`)?.toString())
const data = await finalStream(stdout).then(buffer => buffer.toString());
bot.tellraw(data);
// console.log(data)
} catch(e) {
if (e.toString() === "Error: connect ENOENT /var/run/docker.sock" || e.toString() === "Error: connect EACCES /var/run/docker.sock") {
bot.sendError("The bot isnt running as root or docker daemon isnt started!")
} else {
bot.sendFeedback({text:`${e.toString()}`})
}
}
break
case "rebuild":
break
}
}
}
+13 -28
View File
@@ -1,32 +1,17 @@
const CommandError = require('../CommandModules/command_error');
module.exports = {
name: 'theme',
description:['change the bots theme'],
aliases:[],
trustLevel: 0,
usage:["<color 1> <color 2> <color 3>"],
name: 'theme',
description:['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'],
aliases:[],
trustLevel: 0,
usage:[":3"],
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
if (args[0] === undefined || args[1] === undefined || args[2] === undefined) {
bot.Commands.colors.help.pub_lickColor = 'white'
bot.Commands.colors.help.t_rustedColor = 'white'
bot.Commands.colors.help.own_herColor = 'white'
bot.sendFeedback(`Reseting theme colors,.,.,..`)
} else {
bot.Commands.colors.help.pub_lickColor = args[0]
bot.Commands.colors.help.t_rustedColor = args[1]
bot.Commands.colors.help.own_herColor = args[2]
bot.sendFeedback({text:`Set Help theme colors to ${bot.Commands.colors.help.pub_lickColor} ${bot.Commands.colors.help.t_rustedColor} ${bot.Commands.colors.help.own_herColor}`})
const bot = context.bot
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.command(message.substring(1))
return
}
bot.chat(message)
}
}
}
/*
helpTheme:{
pub_lickColor:"#00FFFF",
t_rustedColor:"dark_purple",
own_herColor:"dark_red",
},
*/
+9 -12
View File
@@ -2,28 +2,25 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'time',
description:['check the time'],
aliases:['clock', 'timezone'],
trustLevel:0,
usage:["timezone"],
description:['check the time'],
aliases:['clock', 'timezone'],
trustLevel:0,
usage:["timezone"],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const moment = require('moment-timezone')
const source = context.source
const source = context.source
const args = context.arguments
const timezone = args.join(' ')
if (!moment.tz.names().map((zone) => zone.toLowerCase()).includes(timezone.toLowerCase())) {
throw new CommandError('Invalid timezone')
}
const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A')
const component = [{ text: 'date and time for the timezone ', color: 'dark_gray' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'dark_gray' }, { text: momented, color: 'green' }]
if (bot.options.isCreayun) {
bot.chat(bot.getMessageAsPrismarine(component)?.toMotd().replaceAll('§','&'))
} else {
bot.sendFeedback(component)
}
const component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: momented, color: 'green' }]
source.sendFeedback(component)
}
}
+9 -10
View File
@@ -3,25 +3,24 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'tpr',
description:['teleport to a random place'],
trustLevel: 1,
trustLevel: 0,
aliases:['rtp', 'teleportrandom', 'randomteleport'],
usage:[""],
async execute (context) {
execute (context) {
const bot = context.bot
const sender = context.source.player
const source = context.source
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)
if (bot.options.useChat) {
bot.chat(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
await bot.chatDelay(100)
bot.command(`tp ${sender.uuid} ${x} ${y} ${z}`)
} else {
bot.sendFeedback(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
if (!bot.options.Core.enabled){
throw new CommandError('Coreless mode is active can not execute command!')
}else{
source.sendFeedback(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
}
}
}
}
+18 -45
View File
@@ -1,67 +1,40 @@
const CommandError = require('../CommandModules/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'tpsbar',
description:['tps'],
trustLevel: 0,
aliases:['tickspersecondbar', 'tickspersecond', 'tps'],
usage:["on","off"],
//<< this one line of code broke it lmao
description:['tps'],
trustLevel: 0,
aliases:['tickspersecondbar', 'tickspersecond', 'tps'],
usage:["on","off"],
execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
if (bot.options.isCreayun || bot.options.useChat) {
throw new CommandError('Cannot execute command because isCreayun or useChat is active!')
} else {
switch (args[0]) {
case 'on':
bot.tps.on()
bot.sendFeedback([{ text: 'TPSBar is now', color: 'dark_gray' },{ text: ' enabled', color: 'green' }])
bot.tps.on()
source.sendFeedback({text: 'TPSBar is now enabled', color:'green'})
break
case 'off':
bot.tps.off()
bot.sendFeedback([{ text: 'TPSBar is now ', color: 'dark_gray' },{ text: 'disabled', color: 'red' }])
bot.tps.off()
source.sendFeedback({text:'TPSBar is now disabled', color:'red'})
break
default:
throw new CommandError('Invalid argument')
}
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (bot.options.isCreayun || bot.options.useChat) {
throw new CommandError('Cannot execute command because isCreayun or useChat is active!')
} else {
switch (args[0]) {
case 'on':
bot.tps.on()
// bot.sendFeedback([{ text: 'TPSBar is now', color: 'dark_gray' },{ text: ' enabled', color: 'green' }])
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`TPSBar is now enabled`)
bot.discord.Message.reply({ embeds: [Embed] })
break
case 'off':
bot.tps.off()
let Embed1 = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`TPSBar is now disabled`)
bot.discord.Message.reply({ embeds: [Embed1] })
break
default:
throw new CommandError('Invalid argument')
}
}
},
}
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
//wdym
+32 -43
View File
@@ -1,50 +1,39 @@
const CommandError = require('../CommandModules/command_error');
const { translate } = require('@vitalets/google-translate-api');
const { EmbedBuilder } = require('discord.js');
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'translate',
usage:['<from language> <to language> <message>'],
aliases:['translation'],
name: 'translate',
//<< this one line of code broke it lmao
usage:['<language 1> <message>'],
aliases:['translation'],
trustLevel: 0,
description:["translate languages"],
description:["translate languages"],
async execute (context) {
const { translate } = require('@vitalets/google-translate-api')
const bot = context.bot
const args = context.arguments
const source = context.source
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
try {
const { text } = await translate(`${args.slice(2).join(' ')}`, {
from: `${args[0]}`,
to: `${args[1]}`,
});
if (bot.options.isCreayun) {
bot.chat(`Result \u203a &6${text}`);
} else {
bot.sendFeedback([{text:'Result \u203a '},{text:`${text}`,color:'gold'}])
}
} catch(e) {
bot.tellraw(`${e}`)
}
},
async discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
try {
const { text } = await translate(`${args.slice(2).join(' ')}`, {
from: `${args[0]}`,
to: `${args[1]}`,
});
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`Result \u203a ${text}`)
bot.discord.Message.reply({ embeds: [Embed] })
} catch (e) {
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle(`${this.name} Command`)
.setDescription(`${e.toString()}`)
bot.discord.Message.reply({ embeds: [Embed] })
}
const { HttpProxyAgent } = require('http-proxy-agent');
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
try {
const agent = new HttpProxyAgent('http://103.152.112.162:80');
const { text } = await translate(`${args.slice(1).join(' ')}`, {
to: 'args[0]',
fetchOptions: {agent}
});
source.sendFeedback([{text:'Result \u203a '},{text:`${text}`,color:'gold'}])
}catch(e){
//if (e.name === 'TooManyRequestsError') {
// source.sendFeedback({text:'reconnecting proxy'})
//}else{
bot.tellraw(`${e}`)
//}
}
}
}
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
+13 -16
View File
@@ -4,32 +4,30 @@ let timer = null
module.exports = {
name: 'troll',
trustLevel:1,
usage:[""],
trustLevel:1,
usage:[""],
execute (context) {
const bot = context.bot
const source = context.source
const source = context.source
const args = context.arguments
if (source.sources.console) {
if (args[0] === 'clear'||args[0] === 'stop') {
clearInterval(this.timer)
this.time= undefined
bot.console.info('Cloop stopped')
return
}
} else if (!source.sources.console) {
if(source.sources.console){
if (args[0] === 'clear'||args[0] === 'stop'){
clearInterval(this.timer)
this.time= undefined
bot.console.info('Cloop stopped')
return
}
}else if(!source.sources.console){
if (args[1] === 'clear' || args[1] === 'stop') {
clearInterval(this.timer)
this.timer = undefined
bot.sendFeedback('Cloop Stopped', false)
context.source.sendFeedback('Cloop Stopped', false)
return
}
}
if (bot.options.isCreayun || bot.options.useChat) {
throw new CommandError(`Cannot execute command because isCreayun or useChat is enabled!`)
} else {
if (this.timer !== null)
this.timer = setInterval(function () {
bot.core.run('day')
@@ -59,4 +57,3 @@ clearInterval(this.timer)
})
}
}
}
+87 -86
View File
@@ -1,97 +1,98 @@
const CommandError = require('../CommandModules/command_error')
const { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, SlashCommandBuilder } = require('discord.js');
const { request } = require('undici');
const urban = require('urban-dictionary')
module.exports = {
name: 'urban',
description:['urban dictionary'],
aliases:['urbandictionary'],
trustLevel: 0,
usage:[
"all <definition>",
"single <definition>",
],
aliases:['urbandictionary'],
trustLevel: 0,
usage:["re fucking doing"],
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.sendError('No results found');
}
for (const 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')}`,
color: 'dark_blue'
},
{
text: `Word \u203a ${definitions.word.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
color: 'dark_blue',
},
{
text: `Author \u203a ${definitions.author.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
color: 'dark_blue'
},
{
text: `written on \u203a ${definitions.written_on.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
color: 'dark_blue'
},
{
text: `Rating \u203a Thumbs-Up ${definitions.thumbs_up} / Thumbs-Down ${definitions.thumbs_down}`,
color: 'gray'
}
]
},
clickEvent: {
action: 'open_url',
value: `${definitions.permalink}`
}
},
])
// console.log(Object.entries(list).map((key, value) => key).join(' ').replaceAll('[object Object]', '\n').replaceAll(',',''))
const bot = context.bot
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'dark_red', text: 'Urban Cmd'},
]
}
if (bot.options.isSavage) {
for (const definitions of list) {
await bot.chatDelay(500);
bot.chat(bot.getMessageAsPrismarine({ text: `${definitions.definition.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`})?.toMotd().replaceAll('\xa7','&'));
await bot.chatDelay(500);
bot.chat(bot.getMessageAsPrismarine({ text: `${definitions.example.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`})?.toMotd().replaceAll('\xa7','&'));
await bot.chatDelay(500);
} // text: `${definitions.definition.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa78')}\n`,
} else {
bot.tellraw(component)
const example = {
translate: '%s - ',
bold: false,
color: 'white',
with: [
{ color: 'dark_gray', text: 'Example text'},
]
}
const definition5 = {
translate: '%s - ',
bold: false,
color: 'white',
with: [
{ color: 'dark_gray', text: 'Definition text'},
]
}
async function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
try {
const definitions = await urban.define(args.join(' '))
const definitions2 = await urban.define(args.join(' '))
//const definitions2 = await urban.example(args.join(' '))
//ChatMessage.fromNotch(await sleep(500) ?? player.displayName ?? player.profile.name ).toMotd().replaceAll('§', '&')
if(!bot.options.Core.enabled){
const ChatMessage = require('prismarine-chat')(bot.options.version)
for (const definition of definitions) {
bot.chat(ChatMessage.fromNotch(await sleep(2300)
?? [cmd, example, { text: definition.example.replaceAll("\r", ""), color: 'gray' }, { text: ' - ', color: 'white' }]).toMotd().replaceAll('§', '&'))
await sleep(500)
bot.chat(ChatMessage.fromNotch(await sleep(2300) ?? [cmd, definition5,{ text: definition.definition.replaceAll("\r", ""), color: 'gray' } ]).toMotd().replaceAll('§', '&'))
}//oh
}else{//??
for (const definition of definitions) {
source.sendFeedback([cmd, example, { text: definition.example.replaceAll("\r", ""), color: 'gray' }, { text: ' - ', color: 'white' }])
source.sendFeedback([cmd, definition5,{ text: definition.definition.replaceAll("\r", ""), color: 'gray' } ])
}
urban.define(args.join(' ')).then((results) => {
source.sendFeedback([cmd,{text:`Definition: ${results[0].word}`, color:'dark_gray'}])
source.sendFeedback([cmd,{text:`Author: ${results[0].author}`, color:'dark_gray'}])
//source.sendFeedback(results[0].thumbs_down)
source.sendFeedback([cmd,{text:`👍 ${results[0].thumbs_up} | 👎 ${results[0].thumbs_down}`, color:'gray'}])
//source.sendFeedback(results[0].written_on)
//thumbs_down
//source.sendFeedback(results[0].data)
}).catch((error) => {
console.error(error.message)
})
//source.sendFeedback(results[0].data)
}
// source.sendFeedback([cmd, { text: definitions2.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
//console.log(urban.define.definition.example(args.join(' ')))
//text: definition.word text: definition.definition
} catch (e) {
if (!bot.options.Core.enabled){
const ChatMessage = require('prismarine-chat')(bot.options.version)
bot.chat(ChatMessage.fromNotch([cmd,{ text: e.toString(), color: 'red' }]).toMotd().replaceAll('§', '&'))
}else {
source.sendFeedback([cmd,{ text: e.toString(), color: 'red' }])
}
}
},
async discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const component = [];
}
}
/*
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
+32 -36
View File
@@ -1,41 +1,37 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'validate',
description: ['validate in the bot'],
description:['validate in the bot'],
trustLevel: 1,
aliases: ['val'],
usage: ['<hash>'],
execute (context) {
const source = context.source
const bot = context.bot
const hash = bot.hash
const args = context.arguments
const ownerhash = bot.owner
const discordHash = bot.hashing.hash
if (args[0] === bot.hash || bot.hashing.hash && args[0] !== bot.owner) {
if (bot.options.isCreayun) {
} else {
bot.sendFeedback([{ text: 'Valid ', color: 'dark_green' },{ text: 'Trusted ', color: 'dark_purple' },{ text: 'hash', color: 'dark_green'}])
}
} else if (args[0] === bot.owner) {
if (bot.options.isCreayun) {
bot.chat('&aValid &4Owner &aHash')
} else {
bot.sendFeedback([{ text: 'Valid ', color: 'dark_green' },{ text: 'Owner ', color: 'dark_red' },{ text: 'hash', color: 'dark_green'}])
}
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const event = bot?.discord?.Message
const roles = event?.member?.roles?.cache
if (roles?.some(role => role.name === `${bot.validation.discord.roles.trusted}`)) {
bot.discord.Message.reply('Valid trusted user')
} else if (roles?.some(role => role.name === `${bot.validation.discord.roles.owner}`)) {
bot.discord.Message.reply('Valid Owner user')
trustLevel: 1,
aliases:['val'],
usage:["hash"],
execute (context) {
const source = context.source
const bot = context.bot
const hash = bot.hash
const args = context.arguments
const ownerhash = bot.owner
const discordHash = bot.hashing.hash
if (args[0] === hash) {
if(!bot.options.Core.enabled){
bot.chat('&aValid Hash')
}else{
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
}
}else if (args[0] === ownerhash) {
if(!bot.options.Core.enabled){
bot.chat('&aValid Owner Hash')
}else{
source.sendFeedback({text: 'Valid Owner Hash', color:'green'})
}
}
else if (discordHash) {
if(!bot.options.Core.enabled){
bot.chat('&aValid Hash')
}else{
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
}
}
}
}
}
//if (args[0] === hash) {
+35
View File
@@ -0,0 +1,35 @@
module.exports = {
name: 'weather',
description:['check the weather in a location via zip code or city name'],
aliases:[],
trustLevel: 0,
usage:["redoing mabe"],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
const source = context.source
// const script = args.slice(1).join(' ');
const weather = require('weather-js')
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
weather.find({degreeType:args[0], search:args.slice(1).join(' ')}, function(err, result){
//"skytext" "feelslike" "humidity" "winddisplay"
//{search: args.join(' '), degreeType: 'F'}
source.sendFeedback([{text:`Location: `,color:'gray'},{text:`${result[0].location.name}`,color:'dark_green'}])
source.sendFeedback([{text:`Temperature: `,color:'gray'},{text:`${result[0].current.temperature}${result[0].location.degreetype}`,color:'dark_green'}])
source.sendFeedback([{text:'Date: ',color:'gray'},{text:result[0].current.date,color:'dark_green'}])
// console.log(JSON.stringify(result, null, 2));
source.sendFeedback([{text:`${result[0].current.skytext}`,color:'dark_green'}])
source.sendFeedback([{text:`Feels like `,color:'gray'},{text:`${result[0].current.feelslike}${result[0].location.degreetype}`,color:'dark_green'}])
source.sendFeedback([{text:'Humidity ',color:'gray'},{text:`${result[0].current.humidity}`,color:'dark_green'}])
source.sendFeedback([{text:'Wind Speed ',color:'gray'},{text:`${result[0].current.winddisplay}`,color:'dark_green'}])
//if(result[0].location.alert === ''){
//source.sendFeedback('There is no alerts!')
//}else{
source.sendFeedback(result[0].location.alert)
//}
})
}
}
+26 -60
View File
@@ -1,64 +1,30 @@
const CommandError = require('../CommandModules/command_error');
const https = require('https');
const util = require('util');
const { EmbedBuilder } = require('discord.js');
const CommandError = require('../CommandModules/command_error')
//const fetch = import("node-fetch");
module.exports = {
name: 'website',
trustLevel:0,
aliases:['web','websitedata','webdata'],
description:['check website data'],
usage:["<url>"],
trustLevel:0,
aliases:['web','websitedata','webdata'],
description:['check website data'],
usage:["<url"],
async execute (context) {
const bot = context.bot;
const source = context.source
const args = context.arguments
try {
https.get(`${args.join(' ')}`, (res) => {
res.setEncoding('utf8');
res.on('data', (data) => {
bot.tellraw({ text: data, color: 'dark_gray' })
});
}).on('error', (e) => {
bot.sendError(`${e.toString()}`);
});
} catch (e) {
bot.sendError(`${e.toString()}`)
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
try {
https.get(`${args.join(' ')}`, (res) => {
res.setEncoding('utf8');
res.on('data', (data) => {
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription('```' + bot.getMessageAsPrismarine(data)?.toString() + '```')
bot.discord.Message.reply({embeds: [Embed]})
})
}).on('error', (e) => {
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle(`${this.name} Command`)
.setDescription('```' + bot.getMessageAsPrismarine(e.toString())?.toString() + '```')
bot.discord.Message.reply({embeds: [Embed]})
});
} catch (e) {
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle(`${this.name} Command`)
.setDescription('```' + bot.getMessageAsPrismarine(e.toString())?.toString() + '```')
bot.discord.Message.reply({embeds: [Embed]})
}
}
try{
const fetch = require("node-fetch");
const source = context.source
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
if (!args && !args[0] && !args[1] && !args[2]) return
const response = await fetch(args[0]);
const body = await response.text();
bot.tellraw({text:body,color:'green'})
} catch(e) {
const bot = context.bot
const source = context.source
// source.sendFeedback({text:e.stack, color:'dark_red'})
source.sendFeedback({text:e.toString(), color:'dark_red'})
}
}
}
/*
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
+21 -57
View File
@@ -1,64 +1,28 @@
const wiki = require('wikipedia')
const wiki = require('wikipedia') //
const CommandError = require('../CommandModules/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
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.sendFeedback({text:`${summary}`,color:'dark_gray'});
} catch (error) {
if (error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')") {
bot.sendFeedback({text:'Definition not found!',color:'dark_red'})
} else {
bot.sendFeedback(`${error.toString()}`)
}
}
},
async discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
try {
const page = await wiki.page(args.join(' '))
const summary = await page.intro();
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription('```' + summary + '```')
bot.discord.Message.reply({ embeds: [Embed] })
const bot = context.bot
} catch (error) {
if (error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')") {
// throw new CommandError({ text: 'Definition not found!', color: 'dark_red' })
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle(`${this.name} Command`)
.setDescription(`Definition not found!`)
bot.discord.Message.reply({ embeds: [Embed] })
} else {
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle(`${this.name} Command`)
.setDescription(`${e.toString()}`)
bot.discord.Message.reply({ embeds: [Embed] })
bot.console.warn(e.toString())
}
}
}
try {
const page = await wiki.page(args.join(' '))
// source.sendFeedback({text:`${page.html()}`,color:'dark_gray'})
const summary = await page.intro();
source.sendFeedback({text:`${summary}`,color:'dark_gray'});
} catch (error) {
if(error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')"){
source.sendFeedback({text:'Definition not found!',color:'dark_red'})
}
// source.sendFeedback(error.toString());
}
}
}
/*
const Embed = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
-13
View File
@@ -1,13 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: '', // command name here
description: [''], // command desc here
aliases: [], // command aliases here if there is any
trustLevel: 0, // 0 = public, 1 = trusted, 2 = owner, 3 = console
usages: [], // command usage here
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
}
}
+95
View File
@@ -0,0 +1,95 @@
{
module.exports = {
Commands:{
prefixes:['!']
//since the prefix array doesnt have a set number more prefixes can be set
},
Core:{
JSON:``,//needs to be a valid json
area:{
start:{ x: 0, y: 0, z: 0 },
end:{ x: 15, y: 0, z: 15 },
}
},
tellrawTag:{
fnftellraw:{text:"FNF",color:"dark_purple"},
boyfriendtellraw:{text:"Boyfriend",color:"#00FFFF"},
bottellraw:{text:"Bot",color:"dark_red"},
},
helpTheme:{
pub_lickColor:"#00FFFF",
t_rustedColor:"dark_purple",
own_herColor:"dark_red",
},
Discord: {
enabled:false,
invite: "https://discord.gg/GCKtG4erux",
commandPrefix: "!",
presence:{
name:'', //set status text here
type:4,
status:'dnd',//status here
}
},
console:{
filelogging:false,
prefix:'c.',
},
bots: [
{
host: "localhost",
username:username(),
version:"1.20.2",
serverName:'localhost',
reconnectDelay: 6000,
endcredits:false,
Console:{
enabled:false,
ratelimit:10,
},
Core: {
enabled: true,
interval:180000
},
discord: {
channelId: "",//discord channel id here
},
matrix:{
roomId:'',//matrix room id here
},
selfcare: {
vanished: false,
unmuted: false,
prefix: false,
cspy: false,
tptoggle:false,
skin:false,
gmc:false,
op:false,
nickname:false,
username:false,
god: false,
interval:500,
}
},
]
}
function username() {
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; // remove sus characters like ` or like ( or whatever because it breaks whatever
let username = '';
for (let i = 0; i < 9; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
username += characters[randomIndex];
}
return username;
}
}
-136
View File
@@ -1,136 +0,0 @@
# i bet theres gonna be some whiny assholes complaining about this because config is .yml and not .js since most java bots use .yml and no other
# javascript bot uses .yml, all i got to say is go cry somewhere else about it you wont change my mind, you little shit,
# it looks cleaner than config.js - Parker2991
# FNFBoyfriendBot Config
# commands
Commands:
prefixes:
- "!"
ratelimit: 2
colors:
discord:
error: "#FF0000"
embed: "#000000"
help:
pub_lickColor: "#2b7589"
t_rustedColor: "#219696"
own_herColor: "#2081c3"
error: "#FF0000"
savage:
password: "password here"
# core
Core:
# PLEASE MAKE THIS A VALID JSON
JSON: '{"text":"FNFBoyfriendBot Core","color":"aqua","clickEvent":{"action":"open_url","value":"https://doin-your.mom"}}'
area:
start:
x: 0
y: 0
z: 0
end:
x: 15
y: 0
z: 15
#validation
validation:
discord:
roles:
trusted: "trusted"
owner: "FNFBoyfriendBot Owner"
channelId: "" # for sending hashes to discord if someone is too lazy to add validation for the bot to their client
keys:
trustedKey: "trusted key here"
ownerKey: "Owner key here"
#discord
Discord:
enabled: true
invite: "https://discord.gg/GCKtG4erux"
commandPrefix: "!"
token: "discord token here"
presence:
name: "amongus"
type: 4
status: "dnd"
# console
console:
filelogging: false
prefix: "c."
reconnectErrors: false
# best to have reconnectErrors set to false when debug is active
# bots
bots:
# isKaboom = running the bot in kaboom
# isCreayun = running the bot in creayun
# useChat = running the bot in chat and not core
# usernameGen = regenerating the bot's username every join
# endcredits = the bot advertising
# serverName = the name of the server ofc
# Console.ratelimit = the number of messages that the bot can read in a few seconds before rejoining this is used to prevent spam, i do not recommend setting it to Infinity
# selfcare.interval = selfcare interval duh
# if username is commented out it will default to bot.js and use a random username
# the bot can run on versions 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2
# debug is for ofc debug i do not recommend turning them all on unless you want a god damn warzone
- host: "localhost"
useChat: false
isSavage: false
isKaboom: true
isCreayun: false
usernameGen: true
username: "FNFBoyfriendBot"
version: "1.20.2"
serverName: "localhost"
reconnectDelay: 6000
endcredits: false
Console:
enabled: false
ratelimit: Infinity
Core:
enabled: true
interval: 180000
discord:
channelId: ""
debug:
enabled: false
core: false
chat:
player:
json: true
ansi: false
motd: false
system:
json: true
ansi: false
motd: false
profileless:
name:
json: false
ansi: false
motd: false
message:
json: false
ansi: false
motd: false
type: true
selfcare:
vanished: true
unmuted: true
prefix: true
cspy: true
tptoggle: true
skin: true
gmc: true
op: true
nickname: true
username: true
god: true
icu: false
interval: 1000
+78 -44
View File
@@ -1,57 +1,91 @@
const CommandError = require('./CommandModules/command_error.js');
const CommandError = require('./CommandModules/command_error.js')
const util = require("util");
const path = require('path');
const fs = require('fs');
const parseYaml = require('js-yaml');
const { loadModules } = require('./util/loadModules')
if (!fs.existsSync(path.join(__dirname, '../config.yml'))) {
console.log('Config not found creating config from default.yml');
fs.copyFileSync(
path.join(__dirname, 'default.yml'),
path.join(__dirname, '../config.yml'),
);
};
const createBot = require('./bot.js');
const createBot = require("./bot.js");
// TODO: Load a default config
const fs = require("fs");
const fileExist = require("./util/file-exists");
const path = require("path");
const readline = require("readline");
try {
config = parseYaml.load(fs.readFileSync('config.yml', 'utf8'));
} catch (e) {
console.log(e.toString())
}
require("dotenv").config();
const bots = [];
const core = config.Core;
const commands = config.Commands;
const Console = config.console;
const discord = config.Discord;
const validation = config.validation;
const savage = config.savage;
for (const options of config.bots) {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
function load() {
//const config = require('./config.js')
require("dotenv").config();
const bots = [];
const core = config.Core
const commands = config.Commands;
const Console = config.console;
const tellrawtag = config.tellrawTag
const helptheme = config.helpTheme
const discord = config.Discord
const matrix = config.matrix
for (const options of config.bots) {
const bot = createBot(options);
bots.push(bot);
bot.bots = bots;
bot.Core = core;
bot.Commands = commands;
bot.Console = Console;
bot.discord = discord;
bot.validation = validation;
bot.savage = savage;
bot.options.username;
// createBot(options, bot.core, bot.commands, bot.Console, bot.discord, bot.validation, bot.savage)
// bot.loadModule = (module) => module(bot, options);
loadModules(bot, options);
/*for (const filename of fs.readdirSync(path.join(__dirname, "modules"))) {
try {
const module = require(path.join(__dirname, 'modules', filename))
bot.loadModule(module);
} catch (error) {
console.error("Failed to load module",filename,":",error);
}
}*/
bot.Discord = discord;
bot.tellrawTag = tellrawtag;
bot.helpTheme = helptheme;
bot.matrix = matrix
bot.options.username;
bot.loadModule = (module) => module(bot, options);
for (const filename of fs.readdirSync(path.join(__dirname, "modules"))) {
try {
const module = require(path.join(__dirname, "modules", filename));
bot.loadModule(module);
} catch (error) {
console.log(
"Failed to load module",
filename,
":",
error,
);
}
}
//bot.console.useReadlineInterface(rl);
bot.console.useReadlineInterface(rl);
try {
bot.on("error", console.error);
} catch (error) {
console.log(error.stack);
}
}
}
process.on("uncaughtException", (e) => {
console?.warn(e.stack)
console.log(e.stack)
});
async function checkConfig() {
if (!(await fileExist(path.join(__dirname, "config.js")))) {
console.error("Config not found! Creating a new Config from ");
await fs.copyFileSync(
path.join(__dirname, "default.js"),
path.join(__dirname, "config.js"),
);
}
config = require("./config.js");
load();
}
checkConfig();

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