Compare commits

..
6 Commits
Author SHA1 Message Date
Parker2991 bca181e8ec java shit idfk 2024-08-04 23:04:28 -04:00
Parker2991 7c85c53eb1 discord command support :3 2024-08-04 22:59:52 -04:00
Parker2991 47ff57eeb6 v6.0.0-alpha 2024-07-25 23:00:54 -04:00
Parker Griffith ebd52989bf BIG REEEEEEEEEEEEEEE;kldkldas;lpad 2024-07-20 20:58:40 -04:00
Parker2991 21040143c7 v6.0.0-alpha 2024-07-20 20:27:17 -04:00
Parker2991 2d49c8003f v6.0.0-alpha 2024-07-07 15:44:16 -04:00
137 changed files with 3750 additions and 40111 deletions
+2 -8
View File
@@ -1,11 +1,5 @@
node_modules
logs
midis
config.yml
.env
src/commands/kick.js
src/modules/exploits.js
src/commands/kick.js
prototyping-crap/java/build/
prototying-crap/java/.gradle/
.git
src/modules/exploits.js
logs
-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!
-10
View File
@@ -1,10 +0,0 @@
function hashGen () {
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()-_+={}[]\\|;:,.<>/?';
let username = '';
for (let i = 0; i < 16; i++ ) {
const randomIndex = Math.floor(Math.random() * characters.length);
username += characters[randomIndex];
}
return username;
}
console.log(hashGen())
-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
+121
View File
@@ -0,0 +1,121 @@
[10:02:52 PM 8/4/2024 logs] [Savage Friends] undefined
[10:02:52 PM 8/4/2024 logs] [Savage Friends] undefined
[10:02:52 PM 8/4/2024 logs] [Savage Friends] undefined
[10:02:52 PM 8/4/2024 logs] [Savage Friends] undefined
[10:02:52 PM 8/4/2024 logs] [Savage Friends] undefined
[10:02:52 PM 8/4/2024 logs] [Savage Friends] undefined
[10:02:52 PM 8/4/2024 logs] [Savage Friends] undefined
[10:02:53 PM 8/4/2024 logs] [chipmunk] FNFBoyfriendBot joind teh gaem
[10:02:53 PM 8/4/2024 logs] [faithtardboom] FNFBoyfriendBot joind teh gaem
[10:02:53 PM 8/4/2024 logs] [alexboom] FNFBoyfriendBot joind teh gaem
[10:02:53 PM 8/4/2024 logs] [chipmunk] [Prefix: ~] FNFBoyfriendBot: FNFBoyfriendBot created by Parker2991
[10:02:53 PM 8/4/2024 logs] [kaboom] FNFBoyfriendBot joind teh gaem
[10:02:53 PM 8/4/2024 logs] [faithtardboom]
[10:02:53 PM 8/4/2024 logs] [chipmunk] [ViaVersion] There is a newer plugin version available: 5.0.2, you're on: 5.0.1-SNAPSHOT
[10:02:53 PM 8/4/2024 logs] [faithtardboom] [ViaVersion] There is a newer plugin version available: 5.0.2, you're on: 5.0.2-SNAPSHOT
[10:02:53 PM 8/4/2024 logs] [faithtardboom] [Prefix: ~] FNFBoyfriendBot: FNFBoyfriendBot created by Parker2991
[10:02:53 PM 8/4/2024 logs] [faithtardboom] There's a new Geyser update available to support Bedrock version 1.21.2. Download it here: https://geysermc.org/download
[10:02:54 PM 8/4/2024 logs] [prljav] FNFBoyfriendBot joind teh gaem
[10:02:54 PM 8/4/2024 logs] [nekoboom] FNFBoyfriendBot joind teh gaem
[10:02:54 PM 8/4/2024 logs] [prljav] There's a new Geyser update available to support Bedrock version 1.21.2. Download it here: https://geysermc.org/download
[10:02:54 PM 8/4/2024 logs] [prljav] [ViaVersion] There is a newer plugin version available: 5.0.2, you're on: 5.0.2-SNAPSHOT
[10:02:54 PM 8/4/2024 logs] [chipmunk] FNFBoyfriendBot: /minecraft:fill 1000000 0 999984 1000015 0 999999 repeating_command_block{CustomName:'{"translate":"outOfMemory.message"}'}
[10:02:54 PM 8/4/2024 logs] [chipmunk] no blockz wuz filld
[10:02:54 PM 8/4/2024 logs] [chipmunk] There's a new Geyser update available to support Bedrock version 1.21.2. Download it here: https://geysermc.org/download
[10:02:54 PM 8/4/2024 logs] [prljav] [Prefix: ~] FNFBoyfriendBot: FNFBoyfriendBot created by Parker2991
[10:02:54 PM 8/4/2024 logs] [alexboom] There's a new Geyser update available to support Bedrock version 1.21.2. Download it here: https://geysermc.org/download
[10:02:55 PM 8/4/2024 logs] [kaboom] [Prefix: ~] FNFBoyfriendBot: FNFBoyfriendBot created by Parker2991
[10:02:55 PM 8/4/2024 logs] [faithtardboom] FNFBoyfriendBot: /minecraft:fill 0 0 0 15 0 15 repeating_command_block{CustomName:'{"translate":"outOfMemory.message"}'}
[10:02:55 PM 8/4/2024 logs] [faithtardboom] no blockz wuz filld
[10:02:55 PM 8/4/2024 logs] [nekoboom] [Prefix: ~] FNFBoyfriendBot: FNFBoyfriendBot created by Parker2991
[10:02:55 PM 8/4/2024 logs] [chipmunk] FNFBoyfriendBot: /commandspy on
[10:02:55 PM 8/4/2024 logs] [chipmunk] Successfully enabled CommandSpy
[10:02:55 PM 8/4/2024 logs] [prljav] FNFBoyfriendBot: /minecraft:fill 0 0 0 15 0 15 repeating_command_block{CustomName:'{"translate":"outOfMemory.message"}'}
[10:02:55 PM 8/4/2024 logs] [prljav] no blockz wuz filld
[10:02:55 PM 8/4/2024 logs] [prljav] FNFBoyfriendBot: /commandspy on
[10:02:55 PM 8/4/2024 logs] [prljav] Successfully enabled CommandSpy
[10:02:55 PM 8/4/2024 logs] [alexboom] [Prefix: ~] FNFBoyfriendBot: FNFBoyfriendBot created by Parker2991
[10:02:55 PM 8/4/2024 logs] [faithtardboom] FNFBoyfriendBot: /commandspy on
[10:02:55 PM 8/4/2024 logs] [faithtardboom] Successfully enabled CommandSpy
[10:02:55 PM 8/4/2024 logs] [faithtardboom] FNFBoyfriendBot: /commandspy on
[10:02:55 PM 8/4/2024 logs] [faithtardboom] Successfully enabled CommandSpy
[10:02:55 PM 8/4/2024 logs] [prljav] FNFBoyfriendBot: /commandspy on
[10:02:55 PM 8/4/2024 logs] [prljav] Successfully enabled CommandSpy
[10:02:55 PM 8/4/2024 logs] [kaboom] FNFBoyfriendBot: /minecraft:fill -48 0 32 -33 0 47 repeating_command_block{CustomName:'{"translate":"outOfMemory.message"}'}
[10:02:55 PM 8/4/2024 logs] [kaboom] no blockz wuz filld
[10:02:56 PM 8/4/2024 logs] [chipmunk] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [chipmunk] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [chipmunk] Vanish for FNFBoyfriendBot: enabled
[10:02:56 PM 8/4/2024 logs] [chipmunk] You are now completely invisible to normal users, and hidden from in-game commands.
[10:02:56 PM 8/4/2024 logs] [faithtardboom] Vanish for FNFBoyfriendBot: enabled
[10:02:56 PM 8/4/2024 logs] [faithtardboom] You are now completely invisible to normal users, and hidden from in-game commands.
[10:02:56 PM 8/4/2024 logs] [kaboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [kaboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [kaboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [kaboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [kaboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [kaboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [prljav] Vanish for FNFBoyfriendBot: enabled
[10:02:56 PM 8/4/2024 logs] [prljav] You are now completely invisible to normal users, and hidden from in-game commands.
[10:02:56 PM 8/4/2024 logs] [nekoboom] FNFBoyfriendBot: /minecraft:fill -32 0 -48 -17 0 -33 repeating_command_block{CustomName:'{"translate":"outOfMemory.message"}'}
[10:02:56 PM 8/4/2024 logs] [nekoboom] no blockz wuz filld
[10:02:56 PM 8/4/2024 logs] [nekoboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [nekoboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [nekoboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [nekoboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [nekoboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [nekoboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [alexboom] FNFBoyfriendBot: /minecraft:fill 80 0 0 95 0 15 repeating_command_block{CustomName:'{"translate":"outOfMemory.message"}'}
[10:02:56 PM 8/4/2024 logs] [alexboom] no blockz wuz filld
[10:02:56 PM 8/4/2024 logs] [alexboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [alexboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [alexboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [alexboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [alexboom] FNFBoyfriendBot: /commandspy on
[10:02:56 PM 8/4/2024 logs] [alexboom] Successfully enabled CommandSpy
[10:02:56 PM 8/4/2024 logs] [chipmunk] FNFBoyfriendBot: /prefix &8[&bPrefix&8: &3~&8]
[10:02:56 PM 8/4/2024 logs] [chipmunk] You now have the tag: &8[&bPrefix&8: &3~&8]
[10:02:56 PM 8/4/2024 logs] [Savage Friends] FNFBoyfriendBot » FNFBoyfriendBot created by Parker2991
[10:02:56 PM 8/4/2024 logs] [Savage Friends] Welcome, FNFBoyfriendBot!
[10:02:56 PM 8/4/2024 logs] [Savage Friends] Type /help for a list of commands.
[10:02:56 PM 8/4/2024 logs] [Savage Friends] Type /list to see who else is online.
[10:02:56 PM 8/4/2024 logs] [Savage Friends] Type /rank <user> <rank> to change your rank. (now supports spaces!)
[10:02:56 PM 8/4/2024 logs] [Savage Friends] Players online: 1 - World time: 6:00 AM
[10:02:56 PM 8/4/2024 logs] [Savage Friends] Please, login with the command: /login <password>
[10:02:57 PM 8/4/2024 logs] [alexboom] Vanish for FNFBoyfriendBot: enabled
[10:02:57 PM 8/4/2024 logs] [faithtardboom] FNFBoyfriendBot: /prefix &8[&bPrefix&8: &3~&8]
[10:02:57 PM 8/4/2024 logs] [alexboom] You are now completely invisible to normal users, and hidden from in-game commands.
[10:02:57 PM 8/4/2024 logs] [faithtardboom] You now have the tag: &8[&bPrefix&8: &3~&8]
[10:02:57 PM 8/4/2024 logs] [kaboom] Vanish for FNFBoyfriendBot: enabled
[10:02:57 PM 8/4/2024 logs] [kaboom] You are now completely invisible to normal users, and hidden from in-game commands.
[10:02:57 PM 8/4/2024 logs] [prljav] FNFBoyfriendBot: /prefix &8[&bPrefix&8: &3~&8]
[10:02:57 PM 8/4/2024 logs] [nekoboom] Vanish for FNFBoyfriendBot: enabled
[10:02:57 PM 8/4/2024 logs] [prljav] You now have the tag: &8[&bPrefix&8: &3~&8]
[10:02:57 PM 8/4/2024 logs] [nekoboom] You are now completely invisible to normal users, and hidden from in-game commands.
[10:02:57 PM 8/4/2024 logs] [chipmunk] God mode enabled.
[10:02:58 PM 8/4/2024 logs] [faithtardboom] God mode enabled.
[10:02:58 PM 8/4/2024 logs] [alexboom] FNFBoyfriendBot: /prefix &8[&bPrefix&8: &3~&8]
[10:02:58 PM 8/4/2024 logs] [alexboom] You now have the tag: &8[&bPrefix&8: &3~&8]
[10:02:58 PM 8/4/2024 logs] [chipmunk] [OP] LapisHusky: #help
[10:02:58 PM 8/4/2024 logs] [kaboom] FNFBoyfriendBot: /prefix &8[&bPrefix&8: &3~&8]
[10:02:58 PM 8/4/2024 logs] [kaboom] You now have the tag: &8[&bPrefix&8: &3~&8]
[10:02:58 PM 8/4/2024 logs] [prljav] God mode enabled.
[10:02:58 PM 8/4/2024 logs] [nekoboom] FNFBoyfriendBot: /prefix &8[&bPrefix&8: &3~&8]
[10:02:58 PM 8/4/2024 logs] [nekoboom] You now have the tag: &8[&bPrefix&8: &3~&8]
[10:02:58 PM 8/4/2024 logs] [chipmunk] Commands - hbot:cb hbot:creator hbot:discord hbot:echo hbot:help hbot:list hbot:loginname hbot:logquery hbot:mapart hbot:music hbot:orbit hbot:particlecannon hbot:rainbowify hbot:rtp hbot:schem hbot:sentry hbot:stoporbit hbot:treegen hbot:uuid hbot:badapple hbot:ban hbot:blacklist hbot:boxstructure hbot:cloop hbot:core hbot:debug hbot:dla hbot:entityspammer hbot:kick hbot:lock hbot:msgfilter hbot:pcrash hbot:playerfilter hbot:restart hbot:supercb hbot:togglevisibility hbot:validate hbot:stop
[10:02:58 PM 8/4/2024 logs] [chipmunk] Teleportation enabled.
[10:02:59 PM 8/4/2024 logs] [alexboom] God mode enabled.
[10:02:59 PM 8/4/2024 logs] [Savage Friends] Please, login with the command: /login <password>
[10:02:59 PM 8/4/2024 logs] [faithtardboom] Teleportation enabled.
[10:02:59 PM 8/4/2024 logs] [kaboom] God mode enabled.
[10:02:59 PM 8/4/2024 logs] [prljav] Teleportation enabled.
[10:02:59 PM 8/4/2024 logs] [nekoboom] God mode enabled.
[10:03:00 PM 8/4/2024 logs] [alexboom] Teleportation enabled.
[10:03:00 PM 8/4/2024 logs] [kaboom] Teleportation enabled.
[10:03:00 PM 8/4/2024 logs] [nekoboom] Teleportation enabled.
[10:03:01 PM 8/4/2024 logs] [nekoboom] Parker2991: /fill -32 0 -48 -17 0 -33 repeating_command_block{CustomName: '{"text":"https://doin-your.mom","color":"dark_red","clickEvent":{"action":"open_url","value":""}}'} destroy
[10:03:01 PM 8/4/2024 logs] [nekoboom] [Parker2991: Succeszfuly fild 256 blok(x)]
[10:03:04 PM 8/4/2024 logs] [Savage Friends] Please, login with the command: /login <password>
[10:03:06 PM 8/4/2024 logs] [kaboom] [OP] HBot: Say hbot:help in chat for a list of commands or say hbot:help [command] for more detail on a command.
[10:03:09 PM 8/4/2024 logs] [Savage Friends] Please, login with the command: /login <password>
[10:03:14 PM 8/4/2024 logs] [Savage Friends] Please, login with the command: /login <password>
-5
View File
@@ -1,5 +0,0 @@
while true; do
# echo "Starting FNFBoyfriendBot...."
node --max-old-space-size=1000 src/index.js
sleep 1
done
-56
View File
@@ -1,56 +0,0 @@
const CommandSource = require("../CommandModules/command_source");
const CommandError = require("../CommandModules/command_error");
//can i change the var?
const { execSync } = require('child_process');
function chat_command_handler(bot) {
let ratelimit = 0
bot.on("parsed_message", (data) => {
if (data.type !== "minecraft:chat") return;
const prefixes = bot.Commands.prefixes;
prefixes.map((prefix) => {
const plainMessage = bot
.getMessageAsPrismarine(data.contents)
?.toString();
if (!plainMessage.startsWith(prefix)) return;
const command = plainMessage.substring(prefix.length); // if the prefixes are the same length just make it 1 or the length
/*
lifes sus
*/
const source = new CommandSource(data.sender,{ discord: false, console: false });
bot.sendFeedback = (message) => {
if (bot.options.useChat) {
bot.tellraw([message]);
} else {
bot.tellraw(["", message]);
}
};
bot.sendError = (message) => {
bot.sendFeedback([{ text: '', color: `red` }, message], false)
}
try{
ratelimit++
setTimeout(() => {
ratelimit--
}, 1000)
if (ratelimit > bot.Commands.ratelimit) { // ,.
bot.sendFeedback({text:'You are using commands too fast!',color:'dark_red'})
// this isn't blocking running the command you know that right?
} else {
bot.commandManager.executeString(source, command);
}//oh real
//can i change the variable name so its name isnt confusing?
}catch(e){
console.log(e.stack)
};
});
})//
}
module.exports = chat_command_handler;
-7
View File
@@ -1,7 +0,0 @@
function chatDelay (bot,options, ms){
bot.chatDelay = function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
}
module.exports = chatDelay;
-150
View File
@@ -1,150 +0,0 @@
const ivm = require('isolated-vm');//new ivm.Isolate(options)
const CommandError = require('../CommandModules/command_error')
// const isolate = new ivm.isolate({ memoryLimit: 128 });
const { stylize } = require('../util/eval_colors')
// 32 seems fine
module.exports = {
name: 'evaljs',
trustLevel: -1,
aliases:['evaljsisolatedvm', 'evaljsnew', 'evaljsivm', 'eval', 'evalivm', 'evalisolatedvm', 'evaljsnew'],
description:['run code in a vm note: amcforum members had a sh##fit over this command'],
usage:["re fucking doing"],
async execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
const util = require('util')
const ChatMessage = require('prismarine-chat')(bot.options.version)
const cmd = {
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'dark_green', text: 'EvalJS'},
]
}
// throw new CommandError('temp disabled')
/* bot.tellraw(selector, { text: util.inspect(bot.vm.run(args.slice(1).join(' ')), { stylize }).substring(0, 32000) })
} catch (err) {
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
*/
//let hash = bot.hash
const options = {
timeout: 1000//?
}
let isolate = new ivm.Isolate({ memoryLimit: 50, options, global, cachedData: true })
//let cachedData = true
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
case `run`:
try {//context.eval()
/*
let kitty
const output = test.compileScript(args.slice(1).join(' '))// ivm.createContext(args.slice(1).join(' '))
const realoutput = output.then(result => {
kitty = result.run({
context: amonger,
})
}).catch(reason => {
console.error(reason) //
})
*/
// old coding
// YOU KILLED THE TERMINAL LMFAO
//let context = await isolate.createContext({ inspector: true });
//let script = await isolate.compileScript('for(;;)debugger;', { filename: 'example.js' });
// await script.run(context);
try {
let nerd = "";
const script = await args.slice(2).join(' '); // Ensure script is a string
const cOmtext = await isolate.createContextSync({options});
if (script.includes('for(;;);')){
bot.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'})
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'})
return
}
(async () => {
try {
let result = await (await cOmtext).evalSync(script, options, {
timeout: 1000
})
nerd = result;
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: util.inspect(result, { stylize }) }]).toMotd().replaceAll('§', '&'))
}else{
bot.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' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
}
})();
} catch (reason) {
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]).toMotd().replaceAll('§', '&'))
}else{
source.sendFeedback([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]);
console.log(`AAA at ${reason}\n${reason.stack}`);
}
}
// credits to chatgpt because im lazy mabe mabe? idfk again ty
//
break//
} catch (e) {
// ral
}
case 'reset':
isolate = null
isolate = new ivm.Isolate({ memoryLimit: 50 }) // 32 seems fine
if(!bot.options.Core.enabled){
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
}else{
bot.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' }])
}
}
}
}
/*
this is typescript
import ivm from 'isolated-vm';
const code = `(function() { return 'Hello, Isolate!'; })()`;
const isolate = new ivm.Isolate({ memoryLimit: 8 }); // mego bites
const script = isolate.compileScriptSync(code);
const context = isolate.createContextSync();
//this
// Prints "Hello, Isolate!"
console.log(script.runSync(context));
*/
-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
+1625 -1459
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -1,20 +1,20 @@
{
"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",
"discord.js": "^14.11.0",
"js-yaml": "^4.1.0",
"json-stringify": "^1.0.0",
"json5": "^2.2.3",
"jvm": "^0.5.3",
"man-db": "^1.0.3",
"matrix-js-sdk": "^31.5.0",
"minecraft-data": "^3.36.1",
"minecraft-protocol": "^1.47.0",
"moment-timezone": "^0.5.45",
"prettier": "^3.2.5",
"mojangson": "^2.0.4",
"prismarine-auth": "^2.2.0",
"prismarine-chat": "^1.10.1",
"prismarine-registry": "^1.7.0",
"wikipedia": "^2.1.2"
"wikipedia": "^2.1.2",
"xml2js": "^0.6.2"
}
}
-34
View File
@@ -1,34 +0,0 @@
const version = '1.20.4'
const { fromNotch } = require('prismarine-chat')(version)
const nbt = require('prismarine-nbt')
//const msg = {"type":"compound","value":{"extra":{"type":"list","value":{"type":"compound","value":[{"extra":{"type":"list","value":{"type":"compound","value":[{"color":{"type":"string","value":"dark_gray"},"text":{"type":"string","value":"["}},{"color":{"type":"string","value":"aqua"},"text":{"type":"string","value":"Prefix: "}},{"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"~"}},{"color":{"type":"string","value":"dark_gray"},"text":{"type":"string","value":"]"}},{"":{"type":"string","value":" "}}]}},"text":{"type":"string","value":""}},{"extra":{"type":"list","value":{"type":"compound","value":[{"color":{"type":"string","value":"red"},"text":{"type":"string","value":"FNFBoyfriendBot"}}]}},"text":{"type":"string","value":""}},{"":{"type":"string","value":":"}},{"":{"type":"string","value":" "}},{"extra":{"type":"list","value":{"type":"compound","value":[{"color":{"type":"string","value":"dark_purple"},"text":{"type":"string","value":"FNF"}},{"color":{"type":"string","value":"aqua"},"text":{"type":"string","value":"Boyfriend"}},{"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"Bot "}},{"color":{"type":"string","value":"white"},"text":{"type":"string","value":"- "}},{"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"Parker"}},{"color":{"type":"string","value":"black"},"text":{"type":"string","value":"2991"}}]}},"text":{"type":"string","value":""}}]}},"text":{"type":"string","value":""}}}
const msg = {"type":"compound","value":{"extra":{"type":"list","value":{"type":"compound","value":[{"extra":{"type":"list","value":{"type":"compound","value":[{"bold":{"type":"byte","value":1},"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"["}},{"bold":{"type":"byte","value":1},"color":{"type":"string","value":"red"},"text":{"type":"string","value":"OP"}},{"bold":{"type":"byte","value":1},"color":{"type":"string","value":"dark_red"},"text":{"type":"string","value":"] "}},{"color":{"type":"string","value":"red"},"text":{"type":"string","value":""}}]}},"text":{"type":"string","value":""}},{"extra":{"type":"list","value":{"type":"compound","value":[{"color":{"type":"string","value":"red"},"text":{"type":"string","value":"birdevent"}}]}},"text":{"type":"string","value":""}},{"":{"type":"string","value":":"}},{"":{"type":"string","value":" "}},{"":{"type":"string","value":"?"}}]}},"text":{"type":"string","value":""}}}
function tryParse (json) {
}
function processNbtMessage (msg) {
if (!msg || msg.type === 'end') return null
const simplified = nbt.simplify(msg)
const json = JSON.stringify(simplified, (key, val) => {
if (key === 'id' && Array.isArray(val)) return uuidFromIntArray(val)
return val
})
return json
}
console.log(fromNotch(processNbtMessage(msg)).toAnsi())
console.log(fromNotch(nbt.simplify(msg).extra).toAnsi())
async function nbtChat() {
const { parsed, type } = await nbt.parse(msg)
console.log(parsed)
}
//nbtChat()
/*
async function main(file) {
const buffer = fs.readFileSync(file)
const { parsed, type } = await nbt.parse(buffer)
console.log('JSON serialized', JSON.stringify(parsed, null, 2))
fs.createWriteStream('bigtest.nbt').write(nbt.writeUncompressed(parsed, type)) // Write it back
}
main('bigtest.nbt')
*/
+5
View File
@@ -0,0 +1,5 @@
const nbt = require('prismarine-nbt');
async function aaa () {
console.log(await nbt.stringify("e"));
}
aaa()
-7
View File
@@ -1,7 +0,0 @@
const fs = require('fs/promises');
const path = require('path');
const blacklist = require(path.join(__dirname, 'blacklist.json'));
for (const player of blacklist.players) {
console.log('whos blacklisted?',[player]);
}
-8
View File
@@ -1,8 +0,0 @@
{
"players": [
"CynicalDev",
"denisapain",
"Pan_Poppo",
"Parker2991"
]
}
-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
-139
View File
@@ -1,139 +0,0 @@
const fs = require('fs');
const path = require('path');
const filterList = require('../../filter.json');
function filter (bot, options) {
function join () {
for (const players of filterList.players) {
bot.on('message', message => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
if (
stringmessage.startsWith(`${players.username} joined the game`)
) {
bot.core.run(`/essentials:mute ${players.username} 10y Filtered by FNFBoyfriendBot`);
bot.core.run(`/execute at @e run deop ${players.username}`);
bot.core.run(`/execute at @e run gamemode spectator ${players.username}`);
// bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}
})
}
}
function login () {
for (const players of filterList.players) {
bot.on('login', data => {
if (bot.players.find((player) => player.profile.name === players.username).profile.username) {
bot.core.run(`/essentials:mute ${bot?.players?.find((player) => player?.profile?.name === players?.username).profile?.username} 10y Filtered by FNFBoyfriendBot`);
bot.core.run(`/execute at @e run ${players.username}`);
bot.core.run(`/execute at @e run gamemode spectator ${players.username}`);
// bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}
})
}
}
function mute () {
for (const players of filterList.players) {
bot.on('message', (message) => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
if (
stringmessage.startsWith(`${players.username}: /essentials:mute ${players.username}`)
||
stringmessage === `${players.username}: /essentials:mute ${bot?.players?.find((player) => player?.profile?.name === players?.username)?.uuid}`
||
stringmessage === `${players.username}: /emute `
||
stringmessage === `${players.username}: /mute ${bot?.players?.find((player) => player?.profile?.name === players?.username)?.uuid}`
||
stringmessage.startsWith(`${players.username}: /emute ${players.username}`)
||
stringmessage.startsWith(`${players.username}: /mute ${players.username}`)
||
stringmessage.includes(`${players.username}: `)
) {
bot.core.run(`/essentials:mute ${players.username} 10y Filtered by FNFBoyfriendBot`);
//bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}
})
}
}
function gamemode () {
for (const players of filterList.players) {
bot.on('message', (message) => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString();
if (
stringmessage.startsWith(`${players.username}: /gamemode creative`)
||
stringmessage.startsWith(`${players.username}: /minecraft:gamemode creative`)
||
stringmessage.startsWith(`${players.username}: /gmc`)
||
stringmessage.startsWith(`${players.username}: /egmc`)
||
stringmessage.startsWith(`${players.username}: /essentials:gamemode creative`)
||
stringmessage.startsWith(`${players.username}: /essentials:gm creative`)
||
stringmessage.startsWith(`${players.username}: /essentials:gmc creative`)
||
stringmessage.startsWith(`: /execute`) + stringmessage.endsWith(`gamemode creative ${players.username}`)
||
stringmessage.startsWith(`${players.username}: /egmc creative`)
||
stringmessage.startsWith(`${players.username}: /gmc creative`)
||
stringmessage.startsWith(`${players.username}: /egm creative`)
||
stringmessage.startsWith(`${players.username}: /egm creative`)
||
bot?.players?.find((player) => player?.profile?.name === players?.username)?.gamemode !== 3
) {
// bot.core.run(`gamemode spectator bot?.players?.find((player) => player?.profile?.name === players?.username)?.profile.username}`)
bot.core.run(`/gamemode spectator ${players.username}`);
//bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
bot.core.run(`/execute at @e run deop ${players.username}`);
}
})
}
}
function deop () {
for (const players of filterList.players) {
bot.on('message', (message) => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString();
if (
stringmessage.startsWith(`${players.username}: /minecraft:op`)
||
stringmessage.startsWith(`${players.username}: /op ${players.username}`)
||
stringmessage.startsWith(`${players.username}: /minecraft:op ${players.username}`)
||
stringmessage.startsWith(`: /execute`) + stringmessage.endsWith(`op ${players.username}`)
||
stringmessage.includes(`${players.username}: `)
) {
bot.core.run(`execute at @e run deop ${players.username}`)
bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}
})
}
}
if (bot.options.isSavage) return
join();
gamemode();
mute();
login();
deop();
}
module.exports = filter;
// stringmessage.startsWith(`${players.username}: /essentials:mute ${players.username}`)
// stringmessage.startsWith(`${players.username}: /emute Parker2991`)
// [chipmunkbot§: Made chipmunkbot a server operator]
// stringmessage.startsWith(`${players.username}: /minecraft:op`)
// stringmessage.startsWith(`${players.username}: /op ${players.username}`)
// stringmessage.startsWith(`: /execute`) + stringmessage.endsWith(`op ${players.username}`)
// stringmessage.startsWith(`${players.username}: /gmc`)
// stringmessage.startsWith(`${players.username}: /egmc`)
// stringmessage.startsWith(`${players.username}: /essentials:gamemode creative`)
// stringmessage.startsWith(`${players.username}: /essentials:gm creative`)
// stringmessage.startsWith(`${players.username}: /essentials:gmc creative`)
// stringmessage.startsWith(`: /execute`) + stringmessage.endsWith(`gamemode creative ${players.username}`)
-1
View File
@@ -1 +0,0 @@
{"players":[{"username":"Bu11D0g1337","ignorecase":false},{"username":"Pringels2","ignorecase":false},{"username":"denisapain","ignorecase":false},{"username":"CynicalDev","ignorecase":false}]}
-9
View File
@@ -1,9 +0,0 @@
e
e
e
e
e
e
e
-2
View File
@@ -1,2 +0,0 @@
const { haxe } = require('haxe')
console.log(haxe())
+26
View File
@@ -0,0 +1,26 @@
const CommandError = require('../util/command_error.js');
module.exports = {
name: 'json',
trustLevel: 0,
aliases: [
],
description: 'placeholder text here',
usages: [
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
try {
// bot.tellraw("@a", [
// { text: `Result \u203a` },
//JSON.parse(args.join(' ')),
// ])
// bot.tellraw("@a", `Result ${JSON.stringify(JSON.parse(args.join(' ')))}` )
bot.tellraw("@a", JSON.parse(JSON.stringify(args.join(' '))))
// console.log([ { text: `Result \u203a` }, { text: JSON.parse(args.join(' ')) } ])
} catch (e) {
bot.tellraw("@a", { text: e.toString(), color: "dark_red" })
}
}
}
-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"
}
}
+9
View File
@@ -0,0 +1,9 @@
const { request } = require("undici");
// https://en.wikipedia.org/w/api.php
async function sus () {
const query = new URLSearchParams("sus");
const wikiResult = await request(`https://en.wikipedia.org/wiki/sus`);
const result = await wikiResult.body;
console.log((await result.json()))
}
sus()
-17
View File
@@ -1,17 +0,0 @@
class CommandSource {
constructor (player, sources, hash, owner,) {
this.player = player//kaboom on crack!
// idk fr // mabe
// /shrug
//am i good to restart it?
this.sources = sources
this.hash = hash
this.owner = owner
}
}
module.exports = CommandSource
-5
View File
@@ -1,5 +0,0 @@
class HelloWorld {
static public function main():Void {
trace("Hello World");
}
}
View File
+48 -95
View File
@@ -1,108 +1,61 @@
const mc = require("minecraft-protocol");
const { EventEmitter } = require("node:events");
const usernameGen = require('./util/usernameGen');
const mc = require('minecraft-protocol')
const { EventEmitter } = require('events')
const fs = require('fs')
const path = require('path')
require("events").EventEmitter.defaultMaxListeners = Infinity;
const { execSync } = require('child_process');
function createBot(options = {}, config) {
const bot = new EventEmitter();
function createBot(options = {}) {
const bot = new EventEmitter()
bot.options = {
// 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 = options;
host: options.host ??= 'localhost',
username: options.username ??= 'Player',
hideErrors: options.hideErrors ??= true, // HACK: Hide errors by default as a lazy fix to console being spammed with them
};
bot.options = options
// Create our client object, put it on the bot, and register some events
bot.on("init_client", (client) => {
client.on("packet", (data, meta) => {
bot.emit("packet", data, meta);
bot.on('init_client', client => {
client.on('packet', (data, meta) => {
bot.emit('packet', data, meta)
bot.emit('packet.' + meta.name, data)
});
/* const timer = setInterval(() => {
if (!config.bots.endcredits) {
return
} else {
bot.chat(`Join the FNFBoyfriendBot discord ${bot.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`)
}*/
})
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 + '``')
});
client.on("disconnect", (data) => {
const parsed = JSON.parse(data.reason)
bot.emit(parsed, "disconnect");
if (parsed === 'Server is full!') {
bot.emit("disconnect", `what the fuck?`)
} else if (parsed === 'Wait 5 seconds before connecting, thanks! :)') {
bot.options.reconnectDelay = 1000 * 5
bot.console.info(`Setting reconnect delay to ${1000 * 5}`)
bot.discord.channel?.send(`Setting reconnecting delay to ${1000 * 5}`)
} else {
bot.console.warn(`Disconnected: ${JSON.stringify(parsed)}`);
bot?.discord?.channel?.send('Disconnected: ' + '``' + JSON.stringify(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('login', () => {
bot.uuid = client.uuid
bot.username = client.username
})
client.on('disconnect', (data) => {
bot.emit("disconnect", data.reason)
})
client.on('end', reason => {
bot.emit('end', reason);
})
client.on('error', error => {
// bot.emit('error', error)
console.log(error.toString())
bot?.discord?.channel?.send(error.toString())
})
client.on("keep_alive", ({ keepAliveId }) => {
bot.emit("keep_alive", { keepAliveId });
bot.emit("keep_alive", { keepAliveId })
})
client.on('kick_disconnect', (data) => {
bot.emit("kick_disconnect", data.reason)
})
process.on("uncaughtException", (e) => {
console?.warn(e.stack)
});
})
client.on("error", (error) => {
bot?.discord?.channel?.send('Disconnected: ' + '``' + JSON.stringify(error.toString()) + '``')
bot.console.warn(error.toString())
// bot.emit("error", error)
})
});
const client = options.client ?? mc.createClient(options)
bot._client = client
bot.emit('init_client', client)
const client = options.client ?? mc.createClient(options);
bot._client = client;
bot.emit("init_client", client);
bot.bots = options.bots ?? [bot];
return bot;
bot.bots = options.bots ?? [bot]
return bot
}
module.exports = createBot;
module.exports = createBot
-34
View File
@@ -1,34 +0,0 @@
function chatTypeEmote (message, data, context) {
try{
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.emote' && message.translate !== '%s %s')) return
const senderComponent = message.with[0]
// wtf spam again - console.log(senderComponent)//wtf...
//console.log(senderComponent)
const contents = message.with[1]
// spam lol - console.log(contents)
//console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.profile.name) //=== stringusername)
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.log(e.stack)
}
}
module.exports = chatTypeEmote
-34
View File
@@ -1,34 +0,0 @@
function chatTypeText (message, data, context) {
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 2 || (message.translate !== 'chat.type.text' && message.translate !== '%s %s')) return
const senderComponent = message.with[0]
// wtf spam again - console.log(senderComponent)//wtf...
//console.log(senderComponent)
const contents = message.with[1]
// spam lol - console.log(contents)
//console.log(contents)
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.profile.name) //=== stringusername)
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}catch(e){
console.log(e.stack)
}
}
module.exports = chatTypeText
-27
View File
@@ -1,27 +0,0 @@
function chipmunkmodBlackilyKat (message, data) {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 4 || (message.translate !== '[%s%s] %s › %s', message.color !== '#55FFFF' && message.translate !== '%s%s %s › %s', message.color !== '#55FFFF')) return
const senderComponent = message.with[1]
const contents = message.with[3]
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
//
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.profile.name) //=== stringusername)
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat', senderComponent }
}
module.exports = chipmunkmodBlackilyKat
-42
View File
@@ -1,42 +0,0 @@
function creayun (messageobj, data) { // this function is not getting called
const ChatMessage = require('prismarine-chat')('1.20.1')
const util = require('util')
const stringify = message => new ChatMessage(message).toString()
const message = stringify(messageobj);
const playerWithPrefix = /^(.*?) (\S*?) » (.*?)$/;
const playerWithoutPrefix = /^(\S*?) » (.*?)$/
// var pattern = /^(.*?) (\S*?) \u203a (.*?)$/;
//console.log('[debug] parsing a message');
// const match = message.match(pattern);
if (playerWithPrefix.test(message)) {
// console.log('[debug]', match);
let match = message.match(playerWithPrefix)
const sender = data.players.find((player) => player.uuid === player.uuid)
if (!sender) return undefined
return { sender, contents: match[3], type: 'minecraft:chat'};
}//i just realized that the bot uses tellraw
//ima try to fix that
}
module.exports = creayun;
// bot.players.find((player) => player.profile.name === players.username)
// let displayName = data.senderName ?? { text: '' }
/*
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 === '\xa7r:') && children[start + 1]?.text === ' '
}
*/
-61
View File
@@ -1,61 +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
}
/*
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
}
*/
// let sus = { text: ' ' }
const playerListDisplayName = { extra: [prefix, displayName, content]}
let sender
if (data.uuid) {
sender = data.players.find(player => player.uuid === data.senderUuid)
} else {
const playerListDisplayName = { extra: [prefix, displayName, content] }
sender = data.players.find(player => util.isDeepStrictEqual(player.displayName, playerListDisplayName))
}
if (!sender) return undefined
return { sender, contents, type: 'minecraft:chat' }
}
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":""}
*/
/*
{"extra":[{"bold":true,"color":"dark_red","text":"["},{"bold":true,"color":"red","text":"OP"},{"bold":true,"color":"dark_red","text":"]"},
{"text":" "},{"color":"red","text":"Parker2991"},{"text":" "},{"color":"blue","text":"»"},{"text":" e"}],"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
+20 -27
View File
@@ -7,6 +7,14 @@ const bots = [
foundation: "java/mcprotocollib",
prefixes: ["#"],
},
{
name: [{ text: "FBot", color: "gold" }],
authors: ["popbob/aaa"],
exclaimer: "",
foundation: "nodejs/node-minecraft-protocol",
prefixes: ["+"],
},
{
name: { text: "CddehhBot", color: "red", bold: false },
authors: ["CaydennO1","spyingcreeper09"],
@@ -36,9 +44,9 @@ const bots = [
prefixes: ["@"],
},
{
name: { text: "FleamBot", color: "dark_purple", bold: false },
name: { text: "HorizonBot", color: "gold", bold: false },
authors: ["ZenZoya","Yaode_owo","Parker2991", "and others"],
exclaimer: "is it Flame or fleam?",
exclaimer: "originally called §5FleamBot§r",
foundation: "nodejs/node-minecraft-protocol",
prefixes: ["^"],
},
@@ -161,7 +169,7 @@ const bots = [
prefixes: ["-"],
},
{
name: { text: "UBot", color: "grey", bold: false },
name: { text: "UBot", color: "gray", bold: false },
authors: ["HexWoman"],
exclaimer: "UwU OwO",
@@ -219,7 +227,7 @@ const bots = [
{ text: "Blurry", color: "dark_purple", bold: false },
{ text: "Bot", color: "red" },
],
exclaimer: "",
exclaimer: "KILL YOURSELF BIIIIIIIIIIIIIIIIIITCCCCCCCCCCCCH;lksadjklaklsjjk;lavsklja;kjlvkjladv;kjavdjkavjk;lvdkj;lsajvk;ds",
authors: ["SirLennox"],
foundation: "Java/custom",
prefixes: [","],
@@ -227,14 +235,14 @@ const bots = [
{
name: [{ text: "SnifferBot", color: "gold", bold: false }],
exclaimer: "sniff sniff FNFBoyfriendBot simp",
authors: ["popbob"],
authors: ["popbob/aaa"],
foundation: "NodeJS/Node-minecraft-protocol",
prefixes: [">"],
},
{
name: [{ text: "XBot", color: "dark_purple", bold: false }],
exclaimer: "",
authors: ["popbob"],
authors: ["popbob/aaa"],
foundation: "ts-Node/Node-minecraft-protocol",
prefixes: ["$"],
},
@@ -261,13 +269,13 @@ const bots = [
{ text: " _ChipMC_", color: "dark_green", bold: false },
{ text: " chayapak", color: "yellow", bold: false },
{ text: " _yfd", color: "light_purple", bold: false },
{ text: "popbob", color: "gold" },
{ text: "popbob/aaa", color: "gold" },
{ text: "MorganAnkan", color: "dark_green" },
{ text: "TurtleKid", color: "green" },
],
exclaimer: "FNFBoyfriendBot NMP Rewrite",
exclaimer: "v4.0x - current",
foundation: "NodeJS/node-minecraft-protocol",
prefixes: ["~", "fnfbfbot ", "&"],
prefixes: [ '~', 'fnfbfbot ', '', '‮', '█' ],
},
{
name: [
@@ -286,7 +294,7 @@ const bots = [
prefixes: [],
},
];
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: "bots",
description: ["shows a list of known bots"],
@@ -305,27 +313,12 @@ module.exports = {
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(
bot.tellraw("@a",
bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - ", ...list]).toMotd().replaceAll('\xa7','\xa7'),
false,
);
return;
}
}
for (const info of bots) {
const plainName = String(
context.bot.getMessageAsPrismarine(info.name),
@@ -353,7 +346,7 @@ module.exports = {
}
component.pop();
}
bot.tellraw([component]);
bot.tellraw("@a", [component]);
},
};
//it doing it just for the ones i added lol
-22
View File
@@ -1,22 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'bruhify',
description:['bruhify text'],
aliases:['bruhifytext', 'bruh'],
trustLevel: 0,
usage:["smexy text here"],
execute (context) {
const bot = context.bot
const args = context.arguments
const message = context.arguments.join(' ')
if (bot.options.isCreayun) {
throw new CommandError('isCreayun is active!')
} else {
bot.bruhifyText = args.join(' ')
bot.sendFeedback(JSON.stringify(bot.bruhifyText))
}
}
}
-164
View File
@@ -1,164 +0,0 @@
const bots = [
{//
name: { text: 'v5.0.0-Beta', color: 'blue', bold:false },
authors: ['Monochrome'],
foundation: '12/18/23',
exclaimer:'added owner validation to the bot thats about it',
},
{//
name: { text: 'v5.0.0', color: 'dark_red', bold:false },
authors: ['Monochrome'],
foundation: '12/20/23',
exclaimer:'since the old validation system was able to barely handle owner validation it was completely remove and replaced with trust levels which handle validation way better also added command aliases (shoutouts to poopbob with the command aliases). made a whole new changelog command for v5.0.0 and renamed the old one changelogv4.3.4. also fixed the issue with the console not properly refreshing lines that are sent',
},
{//
name: { text: 'v5.0.1', color: 'green', bold:false },
authors: [''],
foundation: 'added botsrun for the funni along with making the bot be able to auto refill its core now and fill the core from a command block(edit: nevermind its very buggy reverting it back to how it originally filled its core) and adding a hover event to netmsg along with having the test command tellraw the players display name in the command and added support for 3 command prefixes',
exclaimer:'12/23/23',
},
{//
name: { text: 'v5.0.2', color: 'green', bold:false },
authors: [''],
foundation: '12/26/23',
exclaimer:'fixed the issue with the cpu checking in the info command added discord hashing back into the bot to work along side the keys made it check to see if the config file is in the directory and if not it will recreate the config from default.js',
},
{//
name: { text: 'v5.0.3', color: 'green', bold:false },
authors: [''],
foundation: '12/29/23',
exclaimer:'mabe the bot last update of 2023 cuz next year will be 2024 www but anyway expanded the disconnect messages for both console and discord but thats pretty much it',
},
{//
name: { text: 'v5.0.4', color: 'green', bold:false },
authors: [''],
foundation: '1/12/24',
exclaimer:'first update of 2024 for the bot but anyway merged the test and errortest commands into cmdtest, changed the colors for the help command public is #00FFFF, trusted is dark_purple and owner remained as dark red. moved the module loader from bot.js to index.js to split the boot time in half which now allows module functions like bot.chat() to be used in bot.js and also since the command manager is a module it also loads the commands thats a w on all ends also removed some modules to improve the bots boot time and moved the functions for the sctoggle command into the command itself and not as a module which helped the boot time as well and last but not least merged the memused usage in the info command with the serverinfo usage and made the memusage command use the bossbar and not the actionbar',
},
{//
name: { text: 'v5.0.5', color: 'dark_red', bold:false },
authors: [{text:'QT ',color:'#f001db'},{text:'KB ',color:'#740000'},{text:'Termination',color:'black'}],
//#f001dbQT #740000KB 0Termination
foundation: '1/26/24',
exclaimer:'added a new feature to the bot called Coreless Mode to where the core can be toggled and most commands using tellraw will use chat instead along with the discord relay chat, fixed the bug with trust and owner commands not running in console along with removing alot of useless commands and made the 3 prefixes a array and added ratelimit for console logging and command usage and added file chat logging back',
},
{//
name: { text: 'v5.0.6A', color: 'gold', bold:false },
authors: ['Interlope'],
foundation: '2/15/24',
exclaimer:'added music finally fixed coreless mode made a seperate function for discord in the command manager and idk what all',
},
{//
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
/*{//
name: { text: '', color: 'gray', bold:false },
authors: [''],
foundation: '',
exclaimer:'',
},*/
module.exports = {
name: 'changelog',
description:['check the bots changelog'],
trustLevel: 0,
aliases:['cl', 'changes'],
usage:[""],
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
const bot = context.bot
if (query.length === 0) {
const list = []
for (const info of bots) {
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
list.push(info.name)
}
const category = {
translate: ' (%s%s%s%s%s%s%s%s%s) ',
bold: false,
color: 'white',
with: [
{ color: 'aqua', text: 'Alpha Release'},
{ color: 'white', text: ' | '},
{ color: 'blue', text: 'Beta Release'},
{ color: 'white', text: ' | '},
{ color: 'green', text: 'Minor release'},
{ color: 'white', text: ' | '},
{ color: 'gold', text: 'Revision Release'},
{ color: 'white', text: ' | '},
{ color: 'dark_red', text: 'Major Release'},
]
}
bot.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\u00a7','\u00a7'), false)
return
}
for (const info of bots) {
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
}
},
sendBotInfo (info, bot) {
const component = ['']
component.push('', info.name)
if (info.exclaimer) component.push('\n', ' ', info.exclaimer)
if (info.authors && info.authors.length !== 0) {
component.push('\n', 'Codename ')
for (const author of info.authors) {
component.push(author, { text: ', ', color: 'gray' })
}
component.pop()
}
if (info.foundation) component.push('\n', 'Date: ', info.foundation)
if (info.prefixes && info.prefixes.length !== 0) {
component.push('\n', '')
for (const prefix of info.prefixes) {
component.push(prefix, { text: ' ', color: 'gray' })
}
component.pop()
}
bot.tellraw([component])
}
}//it doing it just for the ones i added lol
// prob a replit moment, it probably thinks there are regexes in the strings
-410
View File
@@ -1,410 +0,0 @@
const bots = [
{
name: { text: 'v0.1.0 - v0.5.0-beta', color: 'blue', bold:false },
authors: ['Prototypes'],
foundation: '11/22/22 - 1/24/23',
exclaimer:'ehh nothing much just the release of the betas',
},
{
name: { text: 'v1.0.0-beta', color: 'blue', bold:false },
authors: ['in console test'],
foundation: '1/25/23',
exclaimer:'original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0 commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam ,gms ,stop,tntspam ,prefix ,annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze,crashserver,troll ,trol(more destructive),icu ,say,sudo,cloop',
},
{
name: { text: 'v1.0.0', color: 'dark_red', bold:false },
authors: ['FNFBoyfriendBot'],
foundation: '1/26/23',
exclaimer:'FNFBoyfriendBot. commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop, commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was) commands untested:prefix command Broke:icu,freeze,tntspam,entityspam,tntspam? changed name to &b &lFNFBoyfriendBot may change later idk',
},
{
name: { text: 'v1.0.1', color: 'green', bold:false },
authors: [''],
foundation: '1/26/23',
exclaimer:'reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command',
},
{
name: { text: 'v1.1.0', color: 'green', bold:false },
authors: [''],
foundation: '1/26/23 2:00pm',
exclaimer:'nothing much just added extra stuff to the troll, trol and that is about it',
},
{
name: { text: 'v1.2.0', color: 'green', bold:false },
authors: [''],
foundation: '1/28/23 1:51',
exclaimer:'for ppl me making me really mad -.- got released early',
},
{
name: { text: 'v2.0.0', color: 'dark_red', bold:false },
authors: ['Major'],
foundation: '2/07/23 8:01pm',
exclaimer:'added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead Reworked tntspam,entityspam,soundbreaker added Spim to the whitelist of the bot released too early than it was planned gonna be released due do the code almost leaked it had to be released early',
},
{
name: { text: 'v2.1.0', color: 'green', bold:false },
authors: [''],
foundation: '2/11/23 5:30pm',
exclaimer:'added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op) (had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted',
},
{
name: { text: 'v2.2.0', color: 'green', bold:false },
authors: [''],
foundation: '2/20/23',
exclaimer:'added ckill(added back after trial and error),serversuicidal changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime',
},
{
name: { text: 'v3.0.0-Beta', color: 'blue', bold:false },
authors: ['blue-balled corruption'],
foundation: '',
exclaimer:'was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks just finished the final build of the Creayun build of the bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the v3.0-beta well the beta for right now commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed commands removed:tpe and serverdeop??? reworked commands :say command for right now relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat',
},
{
name: { text: 'v3.0.0', color: 'dark_red', bold:false },
authors: ['Sky Remanifested'],
foundation: '',
exclaimer:'the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done Added: SelfCare Made during development:Relay chat prototypes for several servers',
},
{
name: { text: 'v3.0.5', color: 'green', bold:false },
authors: [''],
foundation: '',
exclaimer:'bug fixes',
},
{
name: { text: 'v3.0.9', color: 'green', bold:false },
authors: [''],
foundation: '',
exclaimer:'commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)',
},
{
name: { text: 'v3.3.0', color: 'dark_red', bold:false },
authors: [''],
foundation: '',
exclaimer:'switched it base to 4.0s base during 4.0s development',
},
{
name: { text: 'v4.0.0-beta', color: 'blue', bold:false },
authors: ['FNFBoyfriendBot Ultimate'],
foundation: '',
exclaimer:'all of the command removed and or rewriten from version 3.0.9 Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll (note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core CustomChats added:kaboom(for normal chat) (note that this is different and is not Modules)CommandModules Added:command_error,Command_source a beta release for rn',
},
{
name: { text: 'v4.0.0-Alpha ', color: 'aqua', bold:false },
authors: ['FNFBoyfriendBot Ultimate'],
foundation: '',
exclaimer:'Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr Commands Removed:Buyrealminecraft (note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console (note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat) added util with between(for urban) eval_colors(for evaljs)',
},
{
name: { text: 'v4.0.0', color: 'dark_red', bold:false },
authors: ['FNFBoyfriendBotX'],
foundation: '8/11/23',
exclaimer:'Bot is finished with the rewrite thank you ChipMC and chayapak for helping me rewrite the bot Heres the commands ban (mabe removing), blacklist (currently being worked on), botdevhistory, bots, calculator, changelog, ckill, cloop, cloopcrash(probably removing), core, crash, creators, discord, echo, errortest, evaljs, freeze, help, icu, list, meminfo, mineflayerbot, netmsg (Hello World!), ping (pong!), reconnect, say, selfdestruct, serversuicidal (probably removing because theres ckill), skin, sudo, test, tpr, trol (mabe renaming it to troll), troll (mabe removing it and replacing it with the trol command), urban (ong sus asf), validate, version',
},
{
name: { text: 'v4.0.5', color: 'green', bold:false },
authors: [''],
foundation: '8/17/23',
exclaimer:'bug fixes, did what i said i was gonna do in the last update',
},
{
name: { text: 'v4.0.6', color: 'green', bold:false },
authors: [''],
foundation: '8/22/23',
exclaimer:'added 1 console command along with updating console.js so that the bot sends a message to 1 server at a time and not a message to all the servers at a time',
},
{
name: { text: 'v4.0.7', color: 'green', bold:false },
authors: [''],
foundation: '9/4/23',
exclaimer:'merged server and botusername commands and naming the command logininfo cuz it now shows the server ip, server port, Minecraft java Version, and the Bots Username',
},
{
name: { text: 'v4.0.8', color: 'green', bold:false },
authors: [''],
foundation: '9/7/23',
exclaimer:'added the wiki command even though its semi working. bug fixes. some bugs still in the bot is netmsg showing the bots username when i used the netmsg cmd from my end and not the console i find it funny asf though',
},
{
name: { text: 'v4.0.8A', color: 'gold', bold:false },
authors: [''],
foundation: '9/7/23',
exclaimer:'added some things to the changelog cmd. still needing to fix the issue with custom chat and netmsg also added a bugs command to check what bugs are needing to be fixed',
},
{
name: { text: 'v4.0.8B', color: 'gold', bold:false },
authors: [''],
foundation: '9/8/23',
exclaimer:'made it to where it sends more messages on start up and made it to where the buildstring is in secrets',
},
{
name: { text: 'v4.0.8C', color: 'gold', bold:false },
authors: [''],
foundation: '9/14/23',
exclaimer:'added the nodejs version to the version command but thats about it still fixing the bugs with the relay chat and mabe rewriting the validation system in the bot',
},
{
name: { text: 'v4.0.8D', color: 'gold', bold:false },
authors: [''],
foundation: '9/16/23',
exclaimer:'added onto the changelog command along with adding spambot and lol commands (cuz yes) along with removing the bugs command maybe adding it back sometime later also the discord relay chat and validation system mabe getting a rewrite and also updated node from v18 to v20.6.0',
},
{
name: { text: 'v4.0.8E', color: 'gold', bold:false },
authors: [''],
foundation: '9/17/23',
exclaimer:'changed the name for meminfo to serverinfo along with adding onto it and moving the nodejs, node-minecraft-protocol, and discord.js versions from the version command to the serverinfo command',
},
{
name: { text: 'v4.0.8F', color: 'gold', bold:false },
authors: [''],
foundation: '9/24/23',
exclaimer:'added filesdirectories command but thats about it',
},
{
name: { text: 'v4.0.9', color: 'green', bold:false },
authors: [''],
foundation: '9/26/23',
exclaimer:'added a hover event to the custom chat for the bot',
},
{
name: { text: 'v4.1.0', color: 'green', bold:false },
authors: [''],
foundation: '9/27/23',
exclaimer:'Finally changed how the validation/hashing works in the bot instead of it being sent in discord there will be a key for trusted to validate',
},
{
name: { text: 'v4.1.1', color: 'green', bold:false },
authors: [''],
foundation: '9/28/23',
exclaimer:'added uppercase and lowercase function for commands and soon gonna be completely overhauling the validation system in the bot again',
},
{
name: { text: 'v4.1.2', color: 'green', bold:false },
authors: [''],
foundation: '10/02/23',
exclaimer:'added uptime as a command but thats it',
},
{
name: { text: 'v4.1.4', color: 'green', bold:false },
authors: [''],
foundation: '10/03/23',
exclaimer:'moved the custom chat text and cmd block text to config.js',
},
{
name: { text: 'v4.1.6', color: 'green', bold:false },
authors: [''],
foundation: '10/08/23',
exclaimer:'fixed the relay chat and fixed the cr issue with urban and also fixed reconnect',
},
{
name: { text: 'v4.1.7', color: 'green', bold:false },
authors: [''],
foundation: '10/08/03',
exclaimer:'added mute, tag, and skin to selfcare',
}, // am I even gonna be credited?
{
name: { text: 'v4.1.8', color: 'green', bold:false },
authors: [''],//cai cee mmm deee sus
foundation: '10/11/23',
exclaimer:'fixed the issue with memused cee mmm dee',
},
{//
name: { text: 'v4.1.9', color: 'green', bold:false },
authors: [''],
foundation: '10/12/23',
exclaimer:'rewrote evaljs its now using isolated-vm and not vm2',
},
{//
name: { text: 'v4.2.0-restore', color: 'green', bold:false },
authors: [''],
foundation: '10/19/23',
exclaimer:'fixed the disconnect message for discord and the bug with the say command',
},
{//
name: { text: 'v4.2.1', color: 'green', bold:false },
authors: [''],
foundation: '10/24/23',
exclaimer:'rewrote the help command to allow descriptions finally along with adding things to the base of the bot for the descriptions',
},
{//
name: { text: 'v4.2.2', color: 'green', bold:false },
authors: [''],
foundation: '10/25/23',
exclaimer:'merged serverinfo, memused, discord, logininfo, creators, version, uptime together',
},
{//
name: { text: 'v4.2.3', color: 'green', bold:false },
authors: [''],
foundation: '10/30/23',
exclaimer:'added a antiskid measure (thanks _yfd)',
},
{//
name: { text: 'v4.2.4', color: 'green', bold:false },
authors: ['Spooky update (note: might as well give it a codename since its halloween)'],
foundation: '10/31/23',
exclaimer:'merged fard and reconnect together making recend, added more crash methods to the crash command, and remove 12 commands',
},
{//
name: { text: 'v4.2.5', color: 'green', bold:false },
authors: [''],
foundation: '11/8/23',
exclaimer:'patched the exploit in the discordmsg command and made it to were with the netmsg command players cannot send empty messages',
},
{//
name: { text: 'v4.3.0', color: 'green', bold:false },
authors: [''],
foundation: '11/16/23',
exclaimer:`color coded the console logs are LOGS in the color gold consoleserver are in the category INFO in the color green, errors after start up are in the category WARN in the color yellow, Fatal Errors/start-up errors are in the category ERROR in the color red and hashs/validation codes sent to console are in the category HASH in the color green. added the command servereval. changed config.json to config.js and moved the username() function from the end of bot.js to the end of config.js and replacing where username() after options.username with 'Player' + Math.floor(Math.random() * 1000) and added player ping/latency to list along with fixing the bug with cloop list`,
},
{//
name: { text: 'v4.3.1', color: 'green', bold:false },
authors: [''],
foundation: '11/21/23 one day till the bots anniversary?!?!',
exclaimer:'modified the bots boot originally it would spam the bots buildstring each time it logged into a server on boot but now it will only send it once to console on boot along with it now sending the foundationbuildstring after the buildstring sent in console. ported some commands over since chomens is pretty much dead along with adding chat support for chat.type.text and chat.type.emote',
},
{//
name: { text: 'v4.3.2', color: 'green', bold:false },
authors: [''],
foundation: '11/23/23',
exclaimer:'made the bots selfcare, the selfcares interval and console toggle-able along with making default options for the selfcare and its interval, the bots prefix, the bots discord prefix, the reconnectDelay interval, the core customname, and the console, partically fixed the issue with the trusted commands no being able to be ran in discord, edited the bots boot again it now also logs the amount of files its loading on boot its discord username its logged in with(also added the discord username to the info command)',
},
{//
name: { text: 'v4.3.3', color: 'dark_red', bold:false },
authors: ["Lullaby Girlfriend's LostCause"],
foundation: '12/3/23',
exclaimer:'added hover events to the help command for command descriptions, trust console and name along with click events for them added memusage and fixed the category issue with the console and added toggles to the bot for console, selfcare, and skin',
},
{//
name: { text: 'v4.3.4', color: 'dark_red', bold:false },
authors: ['Suffering Siblings'],
foundation: '12/12/23',
exclaimer:'overhauled the console and discord relay chat fixing trusted roles and making the selfcare toggleable in game also fixing the issue with hiding console only commands (thank you poopbob for helping me with that)',
},
]//§4Lullaby §cGirlfriend's §cLost§bCause
//back
/*{//
name: { text: '', color: 'gray', bold:false },
authors: [''],
foundation: '',
exclaimer:'',
},*/
module.exports = {
name: 'changelogv4.3.4',
description:['check the bots changelog'],
trustLevel: 0,
aliases:['clv4.3.4', 'changesv4.3.4'],
usage:[""],
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
const bot = context.bot
if (query.length === 0) {
const list = []
for (const info of bots) {
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
list.push(info.name)
}
const category = {
translate: ' (%s%s%s%s%s%s%s%s%s) ',
bold: false,
color: 'white',
with: [
{ color: 'aqua', text: 'Alpha Release'},
{ color: 'white', text: ' | '},
{ color: 'blue', text: 'Beta Release'},
{ color: 'white', text: ' | '},
{ color: 'green', text: 'Minor release'},
{ color: 'white', text: ' | '},
{ color: 'gold', text: 'Revision Release'},
{ color: 'white', text: ' | '},
{ color: 'dark_red', text: 'Major Release'},
]
}
bot.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\xa7','\xa7'), false)
return
}
for (const info of bots) {
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
}
},
sendBotInfo (info, bot) {
const component = ['']
component.push('', info.name)
if (info.exclaimer) component.push('\n', ' ', info.exclaimer)
if (info.authors && info.authors.length !== 0) {
component.push('\n', 'Codename ')
for (const author of info.authors) {
component.push(author, { text: ', ', color: 'gray' })
}
component.pop()
}
if (info.foundation) component.push('\n', 'Date: ', info.foundation)
if (info.prefixes && info.prefixes.length !== 0) {
component.push('\n', '')
for (const prefix of info.prefixes) {
component.push(prefix, { text: ' ', color: 'gray' })
}
component.pop()
}
bot.tellraw([component])
}
}//it doing it just for the ones i added lol
// prob a replit moment, it probably thinks there are regexes in the strings
+28 -128
View File
@@ -1,62 +1,49 @@
const CommandError = require('../CommandModules/command_error')
const {EmbedBuilder} = require('discord.js')
module.exports = {
name: 'cloop',
trustLevel: 1,
description:['command loop commands'],
aliases:['commandloop'],
usage:[
"add <interval> <command/message>",
"clear",
"remove <id>",
"list",
aliases: [
"commandloop"
],
execute (context, selector) {
const args = context.arguments
description: 'run cloops',
usages: [
"add <interval> <command>",
"remove <index>",
"clear",
"list",
],
execute (context) {
const args = context.arguments
const bot = context.bot
const source = context.source
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (args[1]) {
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (args[1]) {
case 'add':
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
if (parseInt(args[2]) === NaN) bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid interval', color: 'red' })
const interval = parseInt(args[2])
const command = args.slice(3).join(' ')
const command = args.slice(3).join(' ');
bot.cloop.add(command, interval)
bot.sendFeedback({
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
translate: 'Added \'%s\' with interval %s to the cloops',
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 (parseInt(args[2]) === NaN) bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid index', color: 'red' })
const index = (args[2])
const index = parseInt(args[2])
bot.cloop.remove(index)
bot.sendFeedback({
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
translate: 'Removed cloop %s',
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' })
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Cleared all cloops' })
break
case 'list':
const component = []
@@ -67,90 +54,7 @@ bot.sendError({text:'Invalid Index'})
listComponent.push({
translate: '%s \u203a %s (%s)',
with: [
`id ${i}`,
cloop.command,
cloop.interval
]
})
listComponent.push('\n')
i++
}
listComponent.pop()
component.push({
translate: "Cloops (%s):",
with: [ 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
]
@@ -169,15 +73,11 @@ case 'list':
component.push('\n')
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
}
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, component)
break
default:
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'Invalid action', color: 'red' })
break
}
}
}
}
-76
View File
@@ -1,76 +0,0 @@
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",
],
execute (context) {
const bot = context.bot
const player = context?.source?.player?.profile?.name
const uuid = context?.source?.player?.uuid
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
const args = context.arguments
const source = context.source
switch (args[0]) {
case "message":
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(' ')}`)
} 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,
}
])
}
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(' ')}`)
}
}
}
/*
*/
//context.source.player.displayName ?? context.source.player.profile.name,
+28 -42
View File
@@ -1,47 +1,33 @@
const CommandError = require('../CommandModules/command_error')
const buildstring = process.env['buildstring']
const foundation = process.env['FoundationBuildString']
module.exports = {
name: 'console',
trustLevel: 3,
description:['no :)'],
// description:['make me say something in custom chat'],
trustLevel: 3,
aliases: [
],
execute (context) {
const message = context.arguments.join(' ')
const bot = context.bot
const prefix = {
translate: '[%s] %s \u203a %s',
color:'dark_gray',
with: [
{
text: 'FNFBoyfriendBot Console', color:'#00FFFF'
},
{
selector: `${bot.username}`, color:'#00FFFF',
clickEvent: { action: 'suggest_command', value: '~help' }
},
{
text: '',
extra: [`${message}`],
color:'white'
},
],
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
}
bot.tellraw([prefix])
const bot = context.bot
const args = context.arguments;
const source = context.source;
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return;
switch (args[0]) {
case "server":
case "svr":
const servers = bot.bots.map(eachBot => eachBot.options.serverName);
for (const eachBot of bot.bots) {
if (args.slice(1).join(' ').toLowerCase() === 'all') {
eachBot.console.consoleServer = 'all'
bot.console.logs("Set the console server to all");
continue
}
const server = servers.find(server => server.toLowerCase().includes(args[1]))
if (!server) {
bot.console.logs("Invalid server");
return
}
bot.console.logs(`Set the console server to ` + server);
eachBot.console.consoleServer = server;
}
break
}
}
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
-46
View File
@@ -1,46 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'consoleserver',
trustLevel: 3,
description:['consoleserver'],
aliases:['csvr'],
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
// const servers = bot.bots.map(eachBot => eachBot.options.host)
const serverName = bot.bots.map(eachBot => eachBot.options.serverName)
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
for (const eachBot of bot.bots) {
if (args.join(' ').toLowerCase() === 'all') {
eachBot.console.consoleServer = 'all'
bot.console.info(` Set the console server to all servers`)
//Set the console server to all servers
continue
}
const server = serverName.find(server => server.toLowerCase().includes(args[0]))
if (!server) {
source.sendFeedback({ text: 'Invalid server', color: 'red' })
return
}
bot.console.info(`Set the console server to ` + server)
eachBot.console.consoleServer = server
// eachBot.console.consoleServer = port
}
}
}
+20 -20
View File
@@ -1,25 +1,25 @@
const CommandError = require('../CommandModules/command_error');
const { EmbedBuilder } = require('discord.js');
const CommandError = require('../util/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>"],
aliases: [
"cb",
"corerun",
"commandcorerun",
],
description: 'run commands in core!',
usages: [
"<command>",
],
execute (context) {
const bot = context.bot
const args = context.arguments
const source = context.source
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.core.run(args.join(' ').substring(1))
return
}
bot.core.run(`${args.join(' ')}`)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
bot.core.run(`${args.join(' ')}`)
}
}
const message = context.arguments.join(' ');
bot.core.run(message)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
bot.core.run(args.join(' '));
}
}
+17
View File
@@ -0,0 +1,17 @@
module.exports = {
name: 'coresettings',
trustLevel: 0,
aliases: [
],
description: 'Make me say something',
usages: [
"<message>"
],
execute (context) {
const bot = context.bot
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
}
}
+29 -76
View File
@@ -1,85 +1,38 @@
const CommandError = require('../CommandModules/command_error')
const cowsay = require('cowsay2')
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"],
aliases: [
],
description: 'amogus',
usages: [
"just wait till the command is ready :3"
],
execute (context) {
const bot = context.bot
const args = context.arguments
const component = ['']
const source = context.source
if (args[0] === 'list') {
const listed = Object.keys(cows)
let primary = true
const message = []
for (const value of listed) {
message.push({
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (args[0] === "list") {
const list = Object.keys(cows);
let content = [];
let color = true;
for (const value of list) {
content.push([
{
text: value + ' ',
color: 'gray',
clickEvent: {
action: 'suggest_command',
value: `${bot.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]] }) })
} else {
bot.tellraw({ text: cowsay.say(args.slice(0).join(' ')) })
}
},
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(' ')) })
color: (!((color = !color)) ? 'blue' : 'dark_blue'),
}
])
}
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, content)
} else if (cows[args[0]]) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, {
text: cowsay.say(args.slice(1).join(' '),
{ cow: cows[args[0]] })
})
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: cowsay.say(args.slice(0).join(' ')) })
}
}
/*
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]})
*/
}
-31
View File
@@ -1,31 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'crash',
description:['crashes a server'],
trustLevel: 1,
aliases:['crashserver', '69'],//69 cuz yes
usage:["exe","give"],
execute (context) {
const bot = context.bot
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`:
const amogus = process.env['amogus']
bot.core.run(`${amogus}`)
break
case `give`:
const amogus2 = process.env['amogus2']
bot.core.run(`${amogus2}`)
break
default:
bot.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
}
}
}
}
-30
View File
@@ -1,30 +0,0 @@
const CommandError = require("../CommandModules/command_error")
module.exports = {
name: 'discordmsg',
description:['make me say something in discord'],
trustLevel: -1,
aliases:['discordmessage', 'ddmsg'],
usage:["message"],
execute (context) {
const bot = context.bot
const args = context.arguments
if (!args[0]) {
bot.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(' ')}`)
}
}
}
+21 -24
View File
@@ -1,34 +1,31 @@
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>",
aliases: [
"say",
"botsay",
],
description: 'Make me say something',
usages: [
"<message>"
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.chat.command(message.substring(1))
return
}
bot.chat.message(message)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
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))
if (args.join(' ').startsWith('/')) {
bot.chat.command(args.join(' ').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)
bot.chat.message(args.join(' '))
}
}
}
-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;
}
}
-50
View File
@@ -1,50 +0,0 @@
const crypto = require('crypto')
module.exports = {
name: 'botval',
trustLevel: 3,
execute (context) {
const bot = context.bot
const prefix = '~' // mabe not hardcode the prefix
const args = context.arguments
const key = bot.validation.keys.ownerKey
//al
const time = Math.floor(Date.now() / 11000)
const value = bot.uuid + args[0] + time + key
const hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
const customchat = {
translate: '[%s] %s \u203a %s',
color:'gray',
with: [
{ text: 'FNFBoyfriendBot', color:'#00FFFF'},
{ selector: `${bot.username}`, color:'#00FFFF'},
{ text: '', extra: [`${command}`], color:'white'},
],
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
clickevent: { action:"open_url", value: "https://doin-your.mom"}
}
// context.bot.tellraw(customchat)
if (bot.options.useChat ?? bot.options.isCreayun) {
bot.chat(command)
} else {
bot.tellraw(customchat)
}
}
}
//const interval = setInterval(() => {
// bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.normalKey).digest('hex').substring(0, 16)
// bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.ownerHashKey).digest('hex').substring(0, 16)
// Make a copy of this
+273 -403
View File
@@ -1,417 +1,287 @@
const { EmbedBuilder } = require('discord.js')
const CommandError = require('../util/command_error');
const sleep = require('../util/sleep.js');
const fixansi = require('../util/ansi');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'help',
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
description:['shows the command list or the usage of a command'],
trustLevel: 0,
usage:'[COMMAND]',
async execute (context) {
const bot = context.bot;
const commandList = [];
const source = context.source;
const args = context.arguments;
const CommandManager = bot.commandManager;
const config = context.config;
const cmd = {
translate: '[%s] ',
aliases: [
"heko",
"?",
"cmds",
"hell",
"hello",
"helo",
"commands",
"commandshelp",
],
description: 'a list of the bots commands',
usages: [
"",
"<command>",
],
async execute (context) {
const commandList = [];
const bot = context.bot;
const source = context.source;
const args = context.arguments;
const category = {
translate: '(%s%s%s%s%s) \u203a ',
bold: false,
color: 'white',
color: 'gray',
with: [
{ color: 'blue', text: 'help cmd'},
{ color: "blue", text: 'Public'},
{ color: "gray", text: ' | '},
{ color: "dark_aqua", text: 'Trusted'},
{ color: 'gray', text: ' | '},
{ color: "dark_blue", text: 'Owner'},
]
}
const category = {
translate: '(%s%s%s%s%s) \u203a ',
bold: false,
color: 'dark_gray',
with: [
{ color: `${config.Commands.colors.help.pub_lickColor}`, text: 'Public'},
{ color: 'white', text: ' | '},
{ color: `${config.Commands.colors.help.t_rustedColor}`, text: 'Trusted'},
{ color: 'white', text: ' | '},
{ color: `${config.Commands.colors.help.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]
if (args[0].toLowerCase() === command.name) {
//}//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:`${config.Commands.colors.help.t_rustedColor}`}])
await bot.chatDelay(100)
bot.sendFeedback({text: `${config.Commands.prefixes[0]}${command.name} `,color:`${config.Commands.colors.help.pub_lickColor}`})
await bot.chatDelay(100)
bot.sendFeedback({text:`Aliases`,color:`${config.Commands.colors.help.t_rustedColor}`})
await bot.chatDelay(100)
bot.sendFeedback({text:`${command.aliases}`,color:`${config.Commands.colors.help.t_rustedColor}`})
await bot.chatDelay(100)
bot.sendFeedback({text:`${command.description}`})
await bot.chatDelay(100)
bot.sendFeedback([{text:`Trust Level: `,color:`${config.Commands.colors.help.pub_lickColor}`},{text:`${command.trustLevel}`,color:`${config.Commands.colors.help.t_rustedColor}`}])
await bot.chatDelay(100)
if (command.trustLevel === 2) {
await bot.chatDelay(100)
bot.sendFeedback([{text:`Usage: `,color:`${config.Commands.colors.help.pub_lickColor}`},{text:`${bot.Commands.prefixes[0]}${command.name} <owner hash> `,color:`${config.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${config.Commands.colors.help.own_herColor}`}])
await bot.chatDelay(100)
} else if (command.trustLevel === 1) {
await bot.chatDelay(100)
bot.sendFeedback([{text:`Usage: `,color:`${config.Commands.colors.help.pub_lickColor}`},{text:`${config.Commands.prefixes[0]}${command.name} <trusted/owner hash> `,color:`${config.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${config.Commands.colors.help.own_herColor}`}])
await bot.chatDelay(100)
} else {
await bot.chatDelay(100)
bot.sendFeedback([{text:`Usage: `,color:`${config.Commands.colors.help.pub_lickTheme}`},{text:`${bot.Commands.prefixes[0]}${command.name} `,color:`${config.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${config.Commands.colors.help.own_herColor}`}])
await bot.chatDelay(100)
}
} 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(`ඞ${config.Commands.prefixes[0]}${command.name} <owner hash> ${command.usage}`)
await bot.chatDelay(2000)
} else if (command.trustLevel === 1) {
await bot.chatDelay(2000)
bot.chat(`ඞ${config.Commands.prefixes[0]}${command.name} <owner/trusted hash> ${command.usage}`)
await bot.chatDelay(2000)
} else {
await bot.chatDelay(2000)
bot.chat(`ඞ${config.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:`${config.Commands.colors.help.t_rustedColor}`}])
bot.sendFeedback([cmd, {text:`${config.Commands.prefixes[0]}${command.name} `,color:`${config.Commands.colors.help.pub_lickColor}`},{text:`(Aliases: ${command.aliases}) › ${command.description}`,color:`${config.Commands.colors.help.t_rustedColor}`}])
bot.sendFeedback([cmd,{text:`Trust Level: `,color:`${config.Commands.colors.help.pub_lickColor}`},{text:`${command.trustLevel}`,color:`${config.Commands.colors.help.t_rustedColor}`}])
if (command.trustLevel === 2) {
bot.sendFeedback([cmd,{text:`Usage: `,color:`${config.Commands.colors.help.pub_lickColor}`},{text:`${config.Commands.prefixes[0]}${command.name} <owner hash> `,color:`${config.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${config.Commands.colors.help.own_herColor}`}])
} else if (command.trustLevel === 1) {
bot.sendFeedback([cmd,{text:`Usage: `,color:`${config.Commands.colors.help.pub_lickColor}`},{text:`${config.Commands.prefixes[0]}${command.name} <trusted/owner hash> `,color:`${config.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${config.Commands.colors.help.own_herColor}`}])
} else {
bot.sendFeedback([cmd,{text:`Usage: `,color:`${config.Commands.colors.help.pub_lickColor}`},{text:`${config.Commands.prefixes[0]}${command.name} `,color:`${config.Commands.colors.help.t_rustedColor}`},{text:`${command.usage}`,color:`${config.Commands.colors.help.own_herColor}`}])
}
}
break
} else valid = false
}
if (valid) {
} else if (!valid) {
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 "${config.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: `${config.Commands.prefixes[0]}help` } : undefined}])
}
let public = [];
let trusted = [];
let owner = [];
for (const command of bot.commandManager.commandlist) {
if (args[0] === command.name) {
//for (const usageArray of command.usages) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `CommandName \u203a ${command.name}\n`,
color: 'gray',
},
{
text: `Aliases \u203a ${command.aliases}\n`,
color: 'gray',
},
{
text: `Description \u203a ${command.description}\n`,
color: 'gray',
},
{
text: `trustLevel \u203a ${command.trustLevel}\n`,
color: 'gray'
},
{
text: "Usages \u203a\n",
color: "dark_gray"
},
]);
// }
for (const usageArray of command.usages) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `${config.prefixes[0]}${command.name} ${usageArray}`)
}
} else {
let pub_lick = [];
let t_rust = [];
let own_her = [];
let cons_ole = [];
let disabled = [];
for (const commands in CommandManager.commandlist) {
const command = CommandManager.commandlist[commands]
if(command.trustLevel === 3) {
cons_ole.push(
{
text: command.name + ' ',
color: 'blue',
translate:"",
hoverEvent:{
action:"show_text",
value:[
{
text:`Command:${command.name}\n`,
color:'white'
},{
text:"HashOnly:",
color:'white'},
{text:`${command.hashOnly}\n`,color:'red'},
{text:'consoleOnly:',color:'white'},
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
{text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
}
}
)// copypasted from below, and removed stuff that wont work in the console
}
else if (command.trustLevel === 2) {
if (bot.options.useChat && !source.sources.console && !source.sources.discord){
own_her.push(`&4${command.name + ' '}`)
} else {
own_her.push(
{
text: command.name + ' ',
color: `${config.Commands.colors.help.own_herColor}`,
translate:"",
hoverEvent:{
action:"show_text",
value:[
{
text:`Command:${command.name}\n`,
color:'white'
}, {text:`Trust Level: `,color:'white'},
{text:`${command.trustLevel}\n`,color:'dark_red'},
{text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
},clickEvent:{
action:"run_command",value:`${config.Commands.prefixes[0]}${command.name}`
},
}
)
}
}
else if (command.trustLevel === 1){
if(bot.options.useChat && !source.sources.console && !source.sources.discord){
t_rust.push(`&5${command.name + ' '}`)
}else {
t_rust.push(
{
text: command.name + ' ',
color:`${config.Commands.colors.help.t_rustedColor}`,
translate:"",
hoverEvent:{
action:"show_text",
value:[
{
text:`Command:${command.name}\n`,
color:'white'
}, {text:`Trust Level: `,color:'white'},
{text:`${command.trustLevel}\n`,color:'red'}, {text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
},clickEvent:{
action:"run_command",value:`${config.Commands.prefixes[0]}${command.name}`
},
}
)
}
}
else if (command.trustLevel === 0){
if (bot.options.useChat && !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}`,
translate:"",
hoverEvent:{
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
value:[
{
text:`Command:${command.name}\n`,
color:'white'
},{
text:`Trust Level: `,color:'white'},
{text:`${command.trustLevel}\n`,color:'red'},
{text:`${command.description}\n`, color:'white'},
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
{text:'click on me to use me :)'},
]
},clickEvent:{
action:"suggest_command",value:`${config.Commands.prefixes[0]}${command.name}`}
})
}
} else if (command.trustLevel === -1) {
disabled.push({
text: command.name + ' ',
color:`dark_blue`,
})
}
return
}
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms))
}
const isConsole = context.source.player ? false : true
if(source.sources.console && !source.sources.discord) {
bot.console.info([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) {
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(',','')}`)
} 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 {
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,
])
}
}
},
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}`)
if (command.trustLevel === 0) {
public.push([
{
text: command.name + ' ',
color: "blue",
translate: "",
hoverEvent:{
action:"show_text",
value:[
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'red'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
}
}
])
} else if (command.trustLevel === 1) {
trusted.push([
{
text: command.name + ' ',
color: "dark_aqua",
translate: "",
hoverEvent:{
action:"show_text",
value:[
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'red'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
}
}
])
} else if (command.trustLevel === 2) {
owner.push([
{
text: command.name + ' ',
color: "dark_blue",
translate: "",
hoverEvent:{
action:"show_text",
value:[
{
text: `Command:${command.name}\n`,
color: 'gray'
},
{
text: `Trust Level: `,
color: 'gray'
},
{
text: `${command.trustLevel}\n`,
color: 'red'
},
{
text: `${command.description}\n`,
color: 'gray'
},
{
text: `Command Aliases: ${command.aliases}\n`,
color: 'gray'
},
{
text: 'click on me to use me :)',
color: 'gray',
},
],
}
}
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
if (bot.options.useChat) {
bot.chat.message(bot.getMessageAsPrismarine([
{
text: 'Commands (',
color: 'gray'
},
{
text: length,
color: 'gold'
},
{
text: ') ',
color: 'gray'
},
category,
])?.toMotd().replaceAll('§','&'))
await sleep(100)
bot.chat.message(bot.getMessageAsPrismarine(public)?.toMotd().replaceAll("§","&"))
await sleep(100)
bot.chat.message(bot.getMessageAsPrismarine(trusted)?.toMotd().replaceAll("§","&"));
await sleep(100)
bot.chat.message(bot.getMessageAsPrismarine(owner).toMotd().replaceAll("§","&"));
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ text: 'Commands (', color: 'gray' },
{ text: JSON.stringify(length), color: 'gold' },
{ text: ') ', color: 'gray' },
category,
'\n',
public,
trusted,
owner
])
}
// bot.tellraw([ public, trusted, owner ])
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const category = {
translate: '(%s%s%s%s%s) \u203a ',
bold: false,
color: 'gray',
with: [
{ color: "blue", text: 'Public'},
{ color: "gray", text: ' | '},
{ color: "dark_aqua", text: 'Trusted'},
{ color: 'gray', text: ' | '},
{ color: "dark_blue", text: 'Owner'},
]
}
let public = [];
let trusted = [];
let owner = [];
for (const command of bot.commandManager.commandlist) {
if (args[0] === command.name) {
const ansi = bot.getMessageAsPrismarine([ { text: `CommandName \u203a ${command.name}\n`, color: 'gray', }, { text: `Aliases \u203a ${command.aliases}\n`, color: 'gray', }, { text: `Description \u203a ${command.description}\n`, color: 'gray', }, { text: `trustLevel \u203a ${command.trustLevel}\n`, color: 'gray' }, { text: `Usages \u203a ${command?.usages}`, color: "dark_gray" }, ])?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```')
const fix = fixansi(ansi.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`${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 + ' ',
})
}
}
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
return
}
if (command?.trustLevel === 0) {
public.push([
{
text: command.name + ' ',
color: "blue",
}
])
} else if (command?.trustLevel === 1) {
trusted.push([
{
text: command.name + ' ',
color: "dark_aqua"
}
])
} else if (command?.trustLevel === 2) {
owner.push([
{
text: command.name + ' ',
color: "dark_blue",
}
])
}
}
const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
const ansi1 = bot.getMessageAsPrismarine([ { text: 'Commands (', color: 'gray' }, { text: JSON.stringify(length), color: 'gold' }, { text: ') ', color: 'gray' }, category, '\n', public, trusted, owner ])?.toAnsi();
const fix1 = fixansi(ansi1.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${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('♋')
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
}
}
}
+220 -326
View File
@@ -1,337 +1,231 @@
const CommandError = require("../CommandModules/command_error");
const path = require("path");
const os = require("os");
const fs = require("fs");
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) {
function pad(s) {
return (s < 10 ? "0" : "") + s;
}
var hours = Math.floor(seconds / (60 * 60));
var minutes = Math.floor((seconds % (60 * 60)) / 60);
var seconds = Math.floor(seconds % 60);
return (pad(`${hours} Hours`) + " " +
pad(`${minutes} Minutes`) + " " +
pad(`${seconds} Seconds`))
}
function pad(s) {
return (s < 10 ? "0" : "") + s;
}
var hours = Math.floor(seconds / (60 * 60));
var minutes = Math.floor((seconds % (60 * 60)) / 60);
var seconds = Math.floor(seconds % 60);
return (pad(`${hours} Hours`) + " " +
pad(`${minutes} Minutes`) + " " +
pad(`${seconds} Seconds`))
}
module.exports = {
name: "info",
description: [
"check the bots info",
],
aliases: ["information"],
name: 'info',
trustLevel: 0,
usage:[
"version",
"invites",
"server",
"loaded",
"login",
"config",
"uptime",
"contributors",
aliases: [
"information",
],
async execute(context) {
description: 'check the bots info',
usages: [
"version",
"config",
"discord",
"server",
"serverlist",
"contributors"
],
execute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
const config = context.config;
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", })}`})
}
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}`, }, });
}
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'})
}
break
case 'loaded':
// 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 (${JSON.stringify(FileCount)})`)
} else {
bot.sendFeedback([{text:'Package Count \u203a ', color:'gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
}
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", })}`}])
}
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)
}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'})
}
break
case 'config':
if (bot.options.useChat) {
bot.sendFeedback({text:`Prefixes \u203a ${config.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:`${config.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 ${config.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:`${config.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'}])
}
break
case 'uptime':
if (bot.options.isCreayun) {
bot.chat(`${format(process.uptime())}`)
} else {
bot.sendFeedback([{text:`${format(process.uptime())}`,color:'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'})
}
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!!'})
}
}
},
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(`${configCommands.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(`${config.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(`${config.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(`${config.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(`${config.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(`${config.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(`${config.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())
const discordClient = context.discordClient;
const source = context.source;
switch (args[0]) {
case 'version':
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-v6.0.0-beta-700-§bSk§4y §bRedux\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`);
break // &9 &3 &1
case 'config':
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `Minecraft username \u203a ${bot.options.username}\n`,
color: 'gray',
},
{
text: `Ip \u203a ${bot.options.host}:${bot.options.port}\n`,
color: "gray"
},
{
text: `Version \u203a ${bot.options.version}\n`,
color: "gray",
},
{
text: `Discord username \u203a ${discordClient.user.tag}\n`,
color: 'gray',
},
{
text: `Channel \u203a ${bot.discord.channel?.name}\n`,
color: "gray"
},
{
text: `Server name \u203a ${bot.options.serverName}\n`,
color: "gray",
},
{
text: `Server count \u203a ${bot.bots.length}\n`,
color: "gray"
},
{
text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`,
color: "gray"
},
{
text: `Prefix Length: ${config.prefixes.length}\n`,
color: "gray"
},
{
text: `isKaboom \u203a ${bot.options.isKaboom}\n`,
color: "gray",
},
{
text: `isCreayun \u203a ${bot.options.isCreayun}\n`,
color: "gray",
},
{
text: `isSavage \u203a ${bot.options.isSavage}\n`,
color: "gray",
},
]);
break;
case 'discord':
// bot.tellraw('@a', config.discord.invite)
bot.tellraw("@a", [
{
text: `the discord server invite is ${config.discord.invite}`,
color: "gray",
translate: "",
hoverEvent: {
action: "show_text",
value: [
{
text: "click here to join the discord server!",
color: "gray",
}
]
},
clickEvent: {
action: "open_url",
value: `${config.discord.invite}`
}
},
])
break
case "server":
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `Hostname \u203a ${os.hostname()}\n`,
color: "gray"
},
{
text: `User \u203a ${os.userInfo().username}\n`,
color: "gray",
},
{
text: `Working Directory \u203a ${process.mainModule.path}\n`,
color: "gray"
},
{
text: `Arch \u203a ${os.arch()}\n`,
color: "gray"
},
{
text: `OS \u203a ${os.platform()}\n`,
color: "gray"
},
{
text: `OS Version/distro \u203a ${os.version()}\n`,
color: "gray",
},
{
text: `Kernel Version \u203a ${os.release()}\n`,
color: "gray"
},
{
text: `Cores \u203a ${os.cpus().length}\n`,
color: "gray",
},
{
text: `CPU \u203a ${os.cpus()[0].model}\n`,
color: "gray"
},
{
text: `Server Free memory `,
color: 'gray'
},
{
text: `${Math.floor( os.freemem() / 1048576, )} `,
color: 'gray'
},
{
text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB\n`,
color: 'gray'
},
{
text: `Device uptime \u203a ${format(os.uptime())}\n`,
color: 'gray'
},
{
text: `Node version \u203a ${process.version}`,
color: 'gray'
}
])
break
case "serverlist":
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: "Servers \u203a\n",
color: "gray"
},
bot.bots.map((e) => e.options.serverName + "\n")
])
break
case "contributors":
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: "Parker",
color: "dark_red",
},
{
text: "2991",
color: "black"
},
{
text: " - Owner\n",
color: "gray"
},
{
text: "Contributors -\n",
color: "gray",
},
{
text: "_ChipMC_ - ChipmunkBot js & java\n",
color: "dark_blue"
},
{
text: "chayapak - ChomeNS js & java\n",
color: "yellow"
},
{
text: "_yfd - abot\n",
color: "light_purple"
},
{
text: "aaa - FBot, SnifferBot, Xbot\n",
color: "gold",
},
{
text: "Morgan Ankan - RecycleBot\n",
color: "dark_green"
},
{
text: "TurtleKid - TurtleBot",
color: "dark_green"
},
])
break
default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
}
}
}
+23
View File
@@ -0,0 +1,23 @@
const CommandError = require('../util/command_error');
module.exports = {
name: 'kick',
trustLevel: 1,
aliases: [
],
description: 'kick or crash players',
usages: [
"invalidstring <player>",
],
execute (context) {
const bot = context.bot
const args = context.arguments;
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
if (bot.options.useChat ?? bot.options.isSavage ?? bot.options.isCreayun) throw new CommandError('Cannot execute command due to smth in the config being enabled');
switch (args[1]) {
case 'invalidstring':
bot.core.run(`minecraft:tellraw ${args.slice(2).join(' ')} ${JSON.stringify(bot.exploits.invalidString)}`)
break
}
}
}
+9 -17
View File
@@ -1,24 +1,16 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'kill',
description:['kills the bots process'],
trustLevel: 2,
aliases:['stop','kill','suicide'],
usage:[""],
aliases: [
"suicide",
],
description: 'kill the bots process',
usages: [
""
],
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)
await bot.chat.message("killing process");
await process.exit(69420) // sure why the hell not
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
+51 -113
View File
@@ -1,139 +1,77 @@
const CommandError = require('../CommandModules/command_error')
const { EmbedBuilder } = require('discord.js')
const CommandError = require('../util/command_error');
const { EmbedBuilder } = require('discord.js');
const fixansi = require('../util/ansi');
module.exports = {
name: 'list',
description:['check the player list'],
trustLevel: 0,
aliases:['playerlist', 'plist', 'pl'],
usage:[""],
async execute (context) {
description:['check the player list'],
trustLevel: 0,
aliases:['playerlist', 'plist', 'pl'],
usage:[""],
execute (context) {
const bot = context.bot
const args = context.arguments
const args = context.arguments
const players = bot.players
const source = context.source
const source = context.source
const component = []
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
if (args.length !== 0){
throw new CommandError({translate:"Too many Arguments!", color:"red"})
}
if (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]`,
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:`, color: 'dark_green' },
{ text: `${player.latency}`, color: 'gold' },
{ text: '/', color: 'gray' },
{ text: `Gamemode:`, color: 'dark_purple' },
{ text: `${player.gamemode}`, color: 'gold' },
]
})
component.push('\n')
}
component.pop()
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
/*
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')
}
*/
if(source.sources.console){
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi())
}else
if(!bot.options.Core.enabled){
const ChatMessage = require('prismarine-chat')(bot.options.version)
for (const player of players){
bot.chat(ChatMessage.fromNotch(await sleep(500) ?? player.displayName ?? player.profile.name ).toMotd().replaceAll('§', '&') + `\u203a ${player.uuid} Ping: [&a${player.latency}&f]`)
}
}else{
//const players = bot.players
bot.tellraw([{text:`Players: `,color:'dark_gray',},{text:'(',color:'blue'},{text:`${JSON.stringify(bot.players.length)}`,color:'gold'},{text:')',color:'blue'}])
bot.tellraw(component)
}
}
},
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'},
]
})
*/
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ text: `Players: `, color:'gray' },
{ text: '(' , color: 'gray' },
{ text: `${JSON.stringify(bot.players.length)}`, color: 'gold' },
{ text: ')\n', color: 'gray' },
component
])
// bot.tellraw(component)
},
discordExecute(context) {
const bot = context.bot
const players = bot.players
const component = []
for (const player of players) {
// const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(bot.registry.language)
for (const player of players) {
component.push({
translate: '%s \u203a %s [%s %s %s]',
translate: `%s \u203a %s [%s %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'},
{ text: `Ping:`, color: 'dark_green' },
{ text: `${player.latency}`, color: 'gold' },
{ text: '/', color: 'gray' },
{ text: `Gamemode:`, color: 'dark_purple' },
{ text: `${player.gamemode}`, color: 'gold' },
]
})
component.push('\n')
}
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]})
component.pop()
const ansi = bot.getMessageAsPrismarine([{ text: `Players: `, color:'gray' }, { text: '(' , color: 'gray' }, { text: `${JSON.stringify(bot.players.length)}`, color: 'gold' }, { text: ')\n', color: 'gray' }, component])?.toAnsi()
/* bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ text: `Players: `, color:'gray' },
{ text: '(' , color: 'gray' },
{ text: `${JSON.stringify(bot.players.length)}`, color: 'gold' },
{ text: ')\n', color: 'gray' },
component
])*/
const fix = fixansi(ansi.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
} // `\`\`\`ansi\n${discordQueue.join('\n').substring(0, 1984)}\n\`\`\``
}
}
//what is wi
// IDK
+61
View File
@@ -0,0 +1,61 @@
const { request } = require('undici');
const CommandError = require('../util/command_error.js');
const mc = require('minecraft-protocol');
const util = require('util')
module.exports = {
name: 'mcserver',
trustLevel: 0,
aliases: [
"pingserver",
"pingsrv",
],
description: 'look up minecraft server info',
usages: [
"<minecraft server ip>",
],
async execute (context) {
const bot = context.bot;
const discordClient = context.discordClient;
const args = context.arguments;
const source = context.source;
try {
const [host, port] = args[0].split(':')
const server = await mc.ping({ host, port: Number(port ?? 25565) })
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `Ip \u203a ${host}:${Number(port ?? 25565)}\n`,
color: 'gray'
},
{
text: `Players \u203a ${server.players.online}/${server.players.max}\n`,
color: 'gray'
},
{
text: `Version \u203a ${server.version.name}\n`,
color: 'gray',
},
{
text: "Motd \u203a\n",
color: 'gray',
},
server.description,
])
} catch (e) {
bot.tellraw("@a", e.toString())
}
}
}
/*
try {
const server = await request(`https://eu.mc-api.net/v3/server/ping/${interaction.options.getString('ip')}`);
json = await server.body.json()
console.log((json))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.commands.embed}`)
.setTitle(`${this.data.name} Command`)
setDescription(
`IP \u203a ${interaction.options.getString('ip')}\nPlayer Count \u203a ${json.players.online}/${json.players.max}\nOnline \u203a ${json.online}\n
Version \u203a ${json.version.name}\nMotd \u203a ${JSON.stringify(json.description)}`)
.setThumbnail(`${json.favicon}`)
*/
-63
View File
@@ -1,63 +0,0 @@
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"
],
execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
switch (args[0]) {
case 'on':
bot.memusage.on()
bot.sendFeedback([{ text: 'Memusage is now ', color: 'dark_gray' },{ text: 'enabled', color: 'green' }])
break
case 'off':
bot.memusage.off()
bot.sendFeedback([{ text: 'Memusage is now ', color: 'dark_gray'},{ text: '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]})
*/
+61 -29
View File
@@ -1,39 +1,71 @@
const CommandError = require('../CommandModules/command_error.js')
const CommandError = require('../util/command_error.js')
module.exports = {
name: 'netmsg',
description:['send a message to other servers'],
trustLevel:0,
aliases:['networkmessage'],
usage:["<message>"],
trustLevel: 0,
aliases: [
],
description: 'netmsg to other servers',
usages: [
"<message>"
],
execute (context) {
const message = context.arguments.join(' ')
const args = context.arguments
const bot = context.bot
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 \u203a %s',
with: [
bot.options.serverName,
source.player.displayName ?? source.player.profile.name,
args.join(' ')
]
}
if (!message[0]) {
bot.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)
// bot.bots.filter((eachBot) => { if (eachBot.options.useChat) eachBot.chat.message('sussy');
// else if (!eachBot.options.useChat) eachBot.chat.message('baka!')})
// for (const eachBot of bot.bots) eachBot.tellraw("@a", component)
// for (const eachBot of bot.bots) {
bot.bots.filter((eachBot) => {
if (eachBot.options.serverName === "Savage Friends" && eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {
eachBot.chat.message(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${args.join(' ')}`)
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && !eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.tellraw("@a", component);
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (eachBot.options.useChat && !eachBot.options.isSavage) {
// eachBot.chat.message(bot.getMessageAsPrismarine(`[${bot.options.host}:${bot.options.port}] ${source.player.displayName ?? source.player.profile.name} \u203a ${args.join(' ')}`)?.toMotd().replaceAll('§','&'))
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (!eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.tellraw("@a", component);
}
})
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
const component = {
translate: '[%s] %s \u203a %s',
with: [
bot.options.serverName,
source.player.displayName ?? source.player.profile.name,
args.join(' ')
]
}
bot.bots.filter((eachBot) => {
if (eachBot.options.serverName === "Savage Friends" && eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {
eachBot.chat.message(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${args.join(' ')}`)
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && !eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.tellraw("@a", component);
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.chat.message(`&7[&7${bot.options.serverName}&7] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} &7\u203a ${args.join(' ')}`)
} else if (!eachBot.options.useChat && !eachBot.options.isSavage) {
eachBot.tellraw("@a", component);
}
})
}
}
}
/*
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())
}
}
}
-27
View File
@@ -1,27 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'refillcore',
description:['refill the bots core'],
trustLevel: 0,
aliases:['rc'],
usages:[""],
execute (context) {
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) {
throw new CommandError('&4Could not fill core because Coreless mode is active!')
} else {
bot.core.refill()
bot.discord.Message.reply('refilling core,......')
}
}
}
+9 -22
View File
@@ -1,30 +1,17 @@
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:[""],
aliases: [
"end",
"recon",
],
description: 'reconnect the bot',
usages: [
],
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}`)
bot._client.end("disconnect :3")
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
+22
View File
@@ -0,0 +1,22 @@
module.exports = {
name: 'refillcore',
trustLevel: 0,
aliases: [
"rc",
"refill",
],
description: 'refill the bots core',
usages: [
],
execute (context) {
const bot = context.bot
bot.core.refill()
bot.tellraw("@a", "Refilling core,...")
},
discordExecute (context) {
const bot = context.bot;
bot.core.refill();
bot.tellraw("@a", "Refilling core,...");
}
}
-44
View File
@@ -1,44 +0,0 @@
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"],
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(`${bot.Commands.colors.discord.embed}`)
.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)
}
}
}
+20
View File
@@ -0,0 +1,20 @@
const between = require('../util/between')
const CommandError = require('../util/command_error')
module.exports = {
name: 'tpr',
description:['teleport to a random place'],
trustLevel: 0,
aliases:['rtp', 'teleportrandom', 'randomteleport'],
usage:[""],
async execute (context) {
const bot = context.bot
const sender = context.source.player
const source = context.source
if (!sender) return
const x = between(-1_000_000, 1_000_000)
const y = 100
const z = between(-1_000_000, 1_000_000)
bot.tellraw("@a", `Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
}
}
-204
View File
@@ -1,204 +0,0 @@
const CommandError = require('../CommandModules/command_error.js')
module.exports = {
name: 'sctoggle',
description:['toggle the selfcare'],
aliases:['selfcaretoggle'],
trustLevel: 1,
usage:["vanish","mute","god","tptoggle","nickname","username","cspy","skin","gmc","op","prefix","on/off/true/false"],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const source = context.source
const args = context.arguments
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
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'}])
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'}])
bot.options.selfcare.vanished = true
bot.command('essentials:vanish on')
return
}else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false off on',color:'dark_red'})
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'}])
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'}])
bot.options.selfcare.unmuted = true
return
}else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.prefix = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.cspy = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.tptoggle = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.skin.enabled = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.gmc = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.op = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.nickname = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.username = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'}])
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'}])
bot.options.selfcare.god = true
return
}
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
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'})
}
}
}
-67
View File
@@ -1,67 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'selfdestruct',
//why i put it in here probably cuz so it can be rewritten or smh idk
trustLevel: 2,
aliases:['sfd'],
description:['selfdestruct server'],
usage:[""],
execute (context) {
//throw new CommandError('temp disabled')
//bot went brr
//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') {
clearInterval(this.timer)
this.timer = undefined
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) return
this.timer = setInterval(function () {
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear @a')
bot.core.run('effect give @a nausea')
bot.core.run('effect give @a slowness')
bot.core.run('give @a bedrock')
bot.core.run('give @a sand')
bot.core.run('give @a dirt')
bot.core.run('give @a diamond')
bot.core.run('give @a tnt')
bot.core.run('give @a crafting_table')
bot.core.run('give @a diamond_block')
bot.core.run('smite *')
bot.core.run('kaboom')
bot.core.run('essentials:ekill *')
bot.core.run('nuke')
bot.core.run('eco give * 1000')
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear @a')
bot.core.run('summon fireball 115 62 -5')
bot.core.run('sudo * /fast')
bot.core.run('sudo * gms')
bot.core.run('sudo * /sphere tnt 75')
bot.core.run('sudo * kaboom')
}, 500)
bot.on('end',(data) =>{
clearInterval(this.timer)
})
}
}
}
+26 -40
View File
@@ -1,50 +1,36 @@
const CommandError = require('../CommandModules/command_error')
const { stylize } = require('../util/eval_colors')
const util = require('util')
const { EmbedBuilder } = require('discord.js')
const CommandError = require('../util/command_error.js');
const { stylize } = require('../util/stylizeEval');
const util = require('util');
module.exports = {
name: 'servereval',
description:['run code unisolated'],
trustLevel: 2,
aliases:['svreval'],
usage: ['<js code>'],
aliases: [
],
description: 'run commands unisolated',
usages: [
"<code>",
],
execute (context) {
const bot = context.bot;
const source = context.source;
const source = context.source;
const config = context.config;
const discordClient = context.discordClient;
const args = context.arguments;
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('§','&'))
} 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}`)
if (source.sources.console) {
bot.console.logs(bot.getMessageAsPrismarine({ text: util.inspect(eval(args.join(' ')), { stylize })})?.toAnsi())
} else if (bot.options.useChat ?? bot.options.isSavage) {
bot.chat.message(bot.getMessageAsPrismarine({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })?.toMotd().replaceAll('§','&'))
} else {
bot.sendFeedback({ text: err.message, color: 'red' })
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
{
text: util.inspect(eval(script), { stylize }).substring(0, 32700)
}
]);
}
}
},
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(bot.getMessageAsPrismarine('```js\n' + util.inspect(eval(args.join(' '))) + '```')?.toMotd())
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] })
}
}
}
} catch (e) {
throw new CommandError(e.toString())
}
}
}
-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())
}
}
}
-24
View File
@@ -1,24 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'soundbreaker',
description:["make peoples ears bleed"],
aliases:["earpierce","earhell"],
usage:[""],
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.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')
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')
}
}
}
-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
}
}
}
+20
View File
@@ -0,0 +1,20 @@
const CommandError = require('../util/command_error');
module.exports = {
name: 'test',
trustLevel: 0,
aliases: [
],
description: 'Make me say something',
usages: [
"<message>"
],
execute (context) {
const bot = context.bot
const args = context.arguments;
switch (args[0]) {
case 'error':
throw new Error(args.slice(1).join(' '));
break
}
}
}
-32
View File
@@ -1,32 +0,0 @@
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>"],
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 = '#2b7589'
bot.Commands.colors.help.t_rustedColor = '#219696'
bot.Commands.colors.help.own_herColor = '#2081c3'
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}`})
}
}
}
/*
helpTheme:{
pub_lickColor:"#00FFFF",
t_rustedColor:"dark_purple",
own_herColor:"dark_red",
},
*/
-29
View File
@@ -1,29 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'time',
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 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)
}
}
}
-27
View File
@@ -1,27 +0,0 @@
const between = require('../util/between')
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'tpr',
description:['teleport to a random place'],
trustLevel: 1,
aliases:['rtp', 'teleportrandom', 'randomteleport'],
usage:[""],
async execute (context) {
const bot = context.bot
const sender = context.source.player
const source = context.source
if (!sender) return
const x = between(-1_000_000, 1_000_000)
const y = 100
const z = between(-1_000_000, 1_000_000)
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} `)
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
}
}
}
-67
View File
@@ -1,67 +0,0 @@
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"],
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' }])
break
case 'off':
bot.tps.off()
bot.sendFeedback([{ text: 'TPSBar is now ', color: 'dark_gray' },{ text: '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
-50
View File
@@ -1,50 +0,0 @@
const CommandError = require('../CommandModules/command_error');
const { translate } = require('@vitalets/google-translate-api');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'translate',
usage:['<from language> <to language> <message>'],
aliases:['translation'],
trustLevel: 0,
description:["translate languages"],
async 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
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] })
}
}
}
-62
View File
@@ -1,62 +0,0 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'troll',
trustLevel:1,
usage:[""],
execute (context) {
const bot = context.bot
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 (args[1] === 'clear' || args[1] === 'stop') {
clearInterval(this.timer)
this.timer = undefined
bot.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')
bot.core.run('night')
bot.core.run('clear @a')
bot.core.run('effect give @a nausea')
bot.core.run('effect give @a slowness')
bot.core.run('give @a bedrock')
bot.core.run('give @a sand')
bot.core.run('give @a dirt')
bot.core.run('give @a diamond')
bot.core.run('give @a tnt')
bot.core.run('give @a crafting_table')
bot.core.run('give @a diamond_block')
bot.core.run('smite *')
//bot.core.run('kaboom')
// bot.core.run('essentials:ekill *')
// bot.core.run('sudo * nuke')
bot.core.run('eco give * 999999999')
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear @a')
// bot.core.run('sudo * kaboom')
}, 300)
bot.on('end', (data)=>{
clearInterval(this.timer)
})
}
}
}
+12 -21
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, SlashCommandBuilder } = require('discord.js');
const { request } = require('undici');
module.exports = {
@@ -10,6 +10,9 @@ module.exports = {
"all <definition>",
"single <definition>",
],
usages: [
"<definition",
],
async execute (context) {
const source = context.source
const args = context.arguments
@@ -25,9 +28,9 @@ module.exports = {
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');
bot.tellraw('@a', { text: 'No results found', color: 'dark_red' });
}
for (const definitions of list) {
for (definitions of list) {
component.push(prefix, [
{
text: `${definitions.definition.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
@@ -36,7 +39,7 @@ module.exports = {
italic: false,
translate:"",
hoverEvent: {
action:"show_text",
action:"show_text",
value: [
{
text: `Example \u203a \n ${definitions.example.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}`,
@@ -66,19 +69,14 @@ module.exports = {
}
},
])
// console.log(Object.entries(list).map((key, value) => key).join(' ').replaceAll('[object Object]', '\n').replaceAll(',',''))
}
if (bot.options.isSavage) {
if (bot.options.useChat) {
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`,
bot.chat.message(bot.getMessageAsPrismarine({ text: `${definitions.example.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`})?.toMotd().replaceAll("§","&"));
// bot.chat.message(definitions.example.replaceAll("\r", ""));
}
} else {
bot.tellraw(component)
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, component)
}
},
async discordExecute (context) {
@@ -87,11 +85,4 @@ module.exports = {
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]})
*/
+24 -29
View File
@@ -1,41 +1,36 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'validate',
description: ['validate in the bot'],
trustLevel: 1,
aliases: ['val'],
usage: ['<hash>'],
aliases: [
"val"
],
description: 'validate through the bot',
usages: [
""
],
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'}])
}
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (args[0] === bot.validation.trusted) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: "Valid Trusted hash", color: "dark_green" });
} if (args[0] === bot.validation.owner) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: "Valid Owner hash", color: "dark_green" });
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const event = bot?.discord?.Message
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')
const source = context.source;
console.log(Object.keys(bot.discord.message.member.user.username));
if (roles?.some(role => role.name === `${config.discord.roles.trusted}`)) {
bot.discord.message.reply('Valid trusted user')
bot.chat.message(`Valid trusted user [${bot.discord.message.member.user.username}]`)
} else if (roles?.some(role => role.name === `${config.discord.roles.owner}`)) {
bot.discord.message.reply('Valid Owner user')
bot.chat.message(`Valid Owner User [${bot.discord.message.member.user.username}]`);
}
}
}
}
-81
View File
@@ -1,81 +0,0 @@
const CommandError = require('../CommandModules/command_error');
const https = require('https');
const http = require('http');
const util = require('util');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'website',
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 {
if (args.join(' ').startsWith('http://') && !args.join(' ').startsWith('https://')) {
const options = {
hostname: `${args.join(' ')}`
}
http.request(`${args.join(' ')}`, (res) => {
res.setEncoding('utf8');
res.on('data', (chunk) => {
//console.log(`BODY: ${chunk}`);
bot.tellraw(chunk)
});
res.on('end', () => {
console.log('No more data in response.');
});
});
} else if (args.join(' ').startsWith('https://') && !args.join(' ').startsWith('http://')) {
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]})
}
}
}
/*
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]})
*/
+12 -50
View File
@@ -1,5 +1,5 @@
const wiki = require('wikipedia')
const CommandError = require('../CommandModules/command_error')
const wiki = require('wikipedia')
const CommandError = require('../util/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'wiki',
@@ -11,54 +11,16 @@ module.exports = {
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()}`)
}
try {
const page = await wiki.page(args.join(' '))
const summary = await page.intro();
bot.tellraw(`@a`, { text: `${summary}`, color: 'gray' });
} catch (error) {
if (error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')") {
bot.tellraw(`@a`, { text: 'Definition not found!', color: 'dark_red' })
} else {
bot.tellraw(`@a`, `${error.toString()}`)
}
},
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] })
} 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())
}
}
}
}
}
/*
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]})
*/
+33
View File
@@ -0,0 +1,33 @@
const { parseString } = require('xml2js');
const CommandError = require('../util/command_error')
const util = require('util');
const fs = require('fs');
const path = require('path');
module.exports = {
name: 'xml',
trustLevel: 2,
aliases: [
],
description: 'eval xml shit',
usages: [
"<xml code>"
],
execute (context) {
const bot = context.bot;
const args = context.arguments
// fs.writeFileSync(path.join(__dirname, '../data/xmlEval.xml'), args.slice(1).join(' '))
fs.appendFileSync(path.join(__dirname, '../data/xmlEval.xml'), args.slice(1).join(' '))
parseString(args.slice(1).join(' '), function (err, result) {
if (err) throw new CommandError(err.toString())
bot.tellraw("@a", [
{
text: "Result \u203a \n",
color: "gray"
},
{
text: `${util.inspect(result)}`
}
])
});
}
}
-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
}
}
+55
View File
@@ -0,0 +1,55 @@
# FNFBoyfriendBot v6.0.0-alpha config
prefixes:
- "!"
- "fnfbfbot!"
discord:
token: "discord token here"
prefix: "!"
invite: "discord invite here"
matrix:
token: "matrix token here"
invite: "matrix invite here"
prefix: "!"
hostUrl: "matrix instance url here"
userId: "@fnfboyfriendbot:localhost"
enabled: false
core:
name: {"translate":"outOfMemory.message"}
area:
start:
x: 0
y: 0
z: 0
end:
x: 15
y: 0
z: 15
keys:
trusted: "trusted key here"
owner: "owner key here"
colors:
discord:
embed: "#000000"
error: "#FF0000"
bots:
- host: "localhost"
username: "FNFBoyfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "localhost"
reconnectDelay: 6000
channelId: "discord channel id here"
roomId: "matrix room id here"
logging: false
useChat: false
isKaboom: true
isSavage: false
isCreayun: false
+2
View File
@@ -0,0 +1,2 @@
<root> </root>
<sause></sauce><root> sex </root><root> sex </root><root> sex </root><root>sus</root><root<root> </root><root>sex</root><root> </root><root>sex</root><root><></root><root><></></root><root><amogus></amogus></root><root><amogus></amogus><sus></sus></root>
-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
+33 -39
View File
@@ -1,47 +1,41 @@
const CommandError = require('./CommandModules/command_error.js');
const util = require("util");
const path = require('path');
const createBot = require('./bot.js');
const readline = require('readline');
const loadModules = require('./util/loadModules');
const js_yaml = require('js-yaml');
const fs = require('fs');
const 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');
const path = require('path');
const { Client, GatewayIntentBits } = require('discord.js');
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits;
const discordClient = new Client({ intents: [Guilds, GuildMessages, MessageContent] });
console.log('Starting FNFBoyfriendBot');
if (!fs.existsSync(path.join(__dirname, "../config.yml"))) {
console.log("Config not found creating config from the default config");
fs.copyFileSync(
path.join(__dirname, 'default.yml'),
path.join(__dirname, '../config.yml'),
);
};
const createBot = require('./bot.js');
const readline = require("readline");
path.join(__dirname, "./data/default_config.yml"),
path.join(__dirname, "../config.yml")
)
}
try {
config = parseYaml.load(fs.readFileSync('config.yml', 'utf8'));
config = js_yaml.load(fs.readFileSync(path.join(__dirname, '../', 'config.yml')))
} catch (e) {
console.log(e.toString())
console.log(e.stack);
}
require("dotenv").config();
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
// prompt: `Boot success! type ${config.console.prefix}help for a list of commands`
})
if (config.discord.enabled) discordClient.login(config.discord.token);
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 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;
loadModules(bot, options, config);
const bot = createBot(options);
bots.push(bot);
bot.bots = bots;
/* if (!config.discord.enabled) {
return
} else {
discordClient.login(config.discord.token);
}*/
loadModules(bot, options, config, discordClient);
bot.console.useReadlineInterface(rl);
}
//bot.console.useReadlineInterface(rl);
process.on("uncaughtException", (e) => {
console?.warn(e.stack)
});
+17 -40
View File
@@ -1,44 +1,21 @@
async function boot (bot, options, config) {
bot.on('packet.login', async function (data) {
if (bot.options.isSavage) {
bot.console.warn(`isSavage is enabled for ${bot.options.host}:${bot.options.port} the bot will not be able to run with core`);
await bot.chatDelay(5000);
bot.chat('&5FNF&bBoyfriend&4Bot &f- &4Parker&02991');
} else if (bot.options.isCreayun) {
bot.console.warn(`isCreayun is enabled for ${bot.options.host}:${bot.options.port} the bot will not be able to run with core`);
} else if (bot.options.isKaboom) {
bot.chat('&5FNF&bBoyfriend&4Bot &f- &4Parker&02991');
}
if (bot.options.useChat) {
bot.console.warn(`useChat is enabled for ${bot.options.host}:${bot.options.port} the bot will run commands in chat and not core`);
}
})
const readline = require('readline');
function boot (bot, options, discordClient, config) {
bot.on("packet.login", (data) => {
bot.chat.message('&9FNF&3Boyfriend&1Bot &fcreated by &4Parker&02991');
}) // &9 &3 &1
}
module.exports = boot;
/*
const timer = setInterval(() => {
if (!config.bots.endcredits) {
return
} else {
bot.chat(`Join the FNFBoyfriendBot discord ${bot.discord.invite}`)
}
}, 280000)
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`)
}
clearInterval(timer)
const readline = require('readline');
readline.emitKeypressEvents(process.stdin);
process.stdin.on('keypress', (str, key) => {
// console.log(str)
// console.log(key)
if (key && key.ctrl && key.name === 'c') {
console.log('mrrow >:3');
process.exit(69420);
}
})
*/
-34
View File
@@ -1,34 +0,0 @@
const convert = require('color-convert')
function bruhify (bot) {
bot.bruhifyText = ''
let startHue = 0
const ChatMessage = require('prismarine-chat')(bot.options.version)
const timer = setInterval(() => {
if (bot.bruhifyText === '') return
let tag = 'bruhify'
let hue = startHue
const displayName = bot.bruhifyText
const increment = (360 / Math.max(displayName.length, 20))
const component = []
for (const character of displayName) {
const color = convert.hsv.hex(hue, 100, 100)
component.push({ text: character, color: `#${color}` })
hue = (hue + increment) % 360
}
if (bot.options.e) {
bot.chat(ChatMessage.fromNotch(component).toMotd().replaceAll('§', '&'))
startHue = (startHue + increment) % 360
} else {
bot.core.run(`/minecraft:title @a actionbar ${JSON.stringify(component)}`)
startHue = (startHue + increment) % 360
}
}, 100)
bot.on('end', () => {
// clearInterval(timer)
})
}
module.exports = bruhify
+74 -130
View File
@@ -1,15 +1,9 @@
const loadPrismarineChat = require('prismarine-chat')
const kaboomChatParser = require('../chat/kaboom')
const creayunChatParser = require('../chat/creayun')
const fs = require('fs')
const chipmunkmodChatParser = require('../chat/chipmunkmod')
const chipmunkmodblackilykatverChatParser = require('../chat/chipmunkmodBlackilyKatVer')
const typetextChatParser = require('../chat/chatTypeText')
const typeemotetextChatParser = require('../chat/chatTypeEmote')
const sayChatParser = require('../chat/say');
const savageChatParser = require('../chat/savage')
const { parseMessage } = require('../util/NbtChatParser');
const nbt = require('prismarine-nbt');
const loadPrismarineChat = require('prismarine-chat');
const KaboomChatParser = require('../util/ChatParsers/Kaboom');
const ChipmunkModChatParser = require('../util/ChatParsers/ChipmunkMod');
const CreayunChatParser = require('../util/ChatParsers/Creayun');
const sayConsoleChatParser = require('../util/ChatParsers/sayConsole');
const VanillaChatParser = require("../util/ChatParsers/VanillaChat")
function tryParse (json) {
try {
return JSON.parse(json)
@@ -17,47 +11,21 @@ function tryParse (json) {
return { text: '' }
}
}
function inject (bot) {
//what was changed??
function chat (bot, options, config) {
let ChatMessage
bot.on('registry_ready', registry => {
ChatMessage = loadPrismarineChat(registry)
})
if (bot.options.isCreayun && !bot.options.isKaboom) {
bot.chatParsers = [creayunChatParser];
} else if (bot.options.isSavage) {
bot.chatParsers = [savageChatParser, sayChatParser, creayunChatParser, chipmunkmodChatParser];
} else if (bot.options.isKaboom && !bot.options.isCreayun) {
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser, typetextChatParser, typeemotetextChatParser]
if (options.isSavage) {
bot.chatParsers = [CreayunChatParser, sayConsoleChatParser]
} else {
bot.chatParsers = [KaboomChatParser, ChipmunkModChatParser, VanillaChatParser, sayConsoleChatParser]
}
bot.on('packet.profileless_chat', packet => {
const message = tryParse(packet.message)
const sender = tryParse(packet.name)
bot.on('packet.profileless_chat', packet => {//loadPrismarineChat.processNbtMessage(nbt.comp(json))
if (bot.options.version === '1.20.4' || bot.options.version === '1.20.3') {
// message = tryParse(loadPrismarineChat.processNbtMessage(packet.message))
message = tryParse(nbt.simplify(packet.message));
sender = tryParse(nbt.simplify(packet.name));
// sender = tryParse(loadPrismarineChat.processNbtMessage(packet.name))
// console.log(sender)
// console.log(message)
} else if (bot.options.version === '1.20.2' || bot.options.version === '1.20.1' || bot.options.version === '1.20' || bot.options.version === '1.19.4' || bot.options.version === '1.19.3') {// unsigned = JSON.parse(loadPrismarineChat.processNbtMessage(nbt.comp(nbt.string(packet.unsignedChatContent))))
message = tryParse(packet.message)
sender = tryParse(packet.name)
}
if (bot.options.debug.enabled) {
if (bot.options.debug.enabled) {
if (bot.options.debug.chat.profileless.name.json && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'profilelessChat',color:'dark_purple'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Sender Packet',color:'green'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'JSON',color:'yellow'},{text:'] ',color:'dark_gray'}])?.toAnsi() + JSON.stringify(sender))
if (bot.options.debug.chat.profileless.name.ansi && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'profilelessChat',color:'dark_purple'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Sender Packet',color:'green'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Ansi/Normal',color:'gold'},{text:'] ',color:'dark_gray'}])?.toAnsi() + bot.getMessageAsPrismarine(sender)?.toAnsi())
if (bot.options.debug.chat.profileless.name.motd && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'profilelessChat',color:'dark_purple'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Sender Packet',color:'green'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Motd',color:'dark_red'},{text:'] ',color:'dark_gray'}])?.toAnsi() + bot.getMessageAsPrismarine(sender)?.toMotd())
}
if (bot.options.debug.enabled) {
if (bot.options.debug.chat.profileless.message.json && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'profilelessChat',color:'dark_purple'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Message Packet',color:'red'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'JSON',color:'yellow'},{text:'] ',color:'dark_gray'}])?.toAnsi() + JSON.stringify(message))
if (bot.options.debug.chat.profileless.message.ansi && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'profilelessChat',color:'dark_purple'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Message Packet',color:'red'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Ansi/normal',color:'gold'},{text:'] ',color:'dark_gray'}])?.toAnsi() + bot.getMessageAsPrismarine(message)?.toAnsi())
if (bot.options.debug.chat.profileless.message.motd && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'profilelessChat',color:'dark_purple'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Message Packet',color:'red'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Motd',color:'dark_red'},{text:'] ',color:'dark_gray'}])?.toAnsi() + bot.getMessageAsPrismarine(message)?.toMotd())
}
}
if (bot.options.debug.enabled) {
if (bot.options.debug.chat.profileless.type && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'profilelessChat',color:'dark_purple'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'type Packet',color:'light_purple'},{text:'] ',color:'dark_gray'},{text:`${packet.type}`}])?.toAnsi())
}
bot.emit('profileless_chat', {
message,
type: packet.type,
@@ -66,92 +34,46 @@ function inject (bot) {
const translateMessage = bot.getMessageAsPrismarine(message)?.toMotd()
const translateUsername = bot.getMessageAsPrismarine(sender)?.toMotd()
if (packet.type === 1) bot.emit('message', bot.getMessageAsPrismarine({translate:"chat.type.emote", with:[`${translateUsername}`,`${translateMessage}`]})?.toMotd())
// if (packet.type === 1) bot.emit('message', `[${translateUsername}§r] translateMessage`)
if (packet.type === 2) bot.emit('message', bot.getMessageAsPrismarine({"translate":"commands.message.display.incoming","with":[`${translateUsername}`,`${translateMessage}`],"color":"gray","italic":true})?.toMotd())
if (packet.type === 3) bot.emit('message', bot.getMessageAsPrismarine({"translate":"commands.message.display.outgoing","with":[`${translateUsername}`,`${translateMessage}`],"color":"gray","italic":true})?.toMotd())
if (packet.type === 4) bot.emit('message', message);
if (packet.type === 5) bot.emit('message', bot.getMessageAsPrismarine({translate:"chat.type.announcement",color:'white', with:[`${translateUsername}`,`${translateMessage}`]})?.toMotd())
tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
// Ignores command set messages
bot.on('packet.player_chat', packet => {
if (bot.options.version === '1.20.2' || bot.options.version === '1.20.1' || bot.options.version === '1.20' || bot.options.version === '1.19.4' || bot.options.version === '1.19.3') {
unsigned = tryParse(packet.unsignedChatContent)
} else if (bot.options.version === '1.20.4' || bot.options.version === '1.20.3') {
// unsigned = tryParse(tryParse(loadPrismarineChat.processNbtMessage(packet.unsignedChatContent)))
// unsigned = parseMessage(tryParse(loadPrismarineChat.processNbtMessage(packet.unsignedChatContent)))
// unsigned = loadPrismarineChat.processNbtMessage(nbt.comp(packet.unsignedChatContent).value)
unsigned = nbt.simplify(packet.unsignedChatContent)
// console.log(packet.signature)
// tryParse(nbt.comp(packet.message));
// console.log(bot.getMessageAsPrismarine(nbt.comp(unsigned))?.toAnsi())
// console.log(fromNotch(nbt.comp(msg).value).toAnsi())
// console.log(bot.getMessageAsPrismarine(unsigned)?.toAnsi())
}
if (bot.options.debug.enabled) {
if (bot.options.debug.chat.player.json && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'playerChat',color:'dark_green'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'JSON',color:'yellow'},{text:'] ',color:'dark_gray'}])?.toAnsi() + JSON.stringify(packet.unsignedChatContent))
if (bot.options.debug.chat.player.ansi && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'playerChat',color:'dark_green'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Ansi/normal',color:'gold'},{text:'] ',color:'dark_gray'}])?.toAnsi() + bot.getMessageAsPrismarine(tryParse(packet.unsigned))?.toAnsi())
if (bot.options.debug.chat.player.motd && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'playerChat',color:'dark_green'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Motd',color:'dark_red'},{text:'] ',color:'dark_gray'}])?.toAnsi() + bot.getMessageAsPrismarine(unsigned)?.toMotd())
}
const message = parseMessage(tryParse(packet.content))
const translateMessage = bot.getMessageAsPrismarine(unsigned)?.toMotd()
const translateUsername = bot.getMessageAsPrismarine(packet.sender)?.toMotd()
if (packet.type === 5) bot.emit('message', bot.getMessageAsPrismarine({translate:"chat.type.announcement",color:'white', with:[`${translateUsername}`,`${translateMessage}`]})?.toMotd())
bot.emit('player_chat', { plain: nbt.simplify(packet.plainMessage), unsigned, senderUuid: packet.senderUuid })
bot.emit('message', unsigned)
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine})
})
bot.getMessageAsPrismarine = message => {
try {
if (ChatMessage !== undefined) {
return new ChatMessage(nbt.simplify(message))
}
} catch (error) {
console.error(error); // Log any errors that occur during object creation
}
return undefined;
}
bot.on('packet.player_chat', (packet, data) => {
const unsigned = tryParse(packet.unsignedChatContent)
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid })
if (packet.type === 5) bot.emit('message', bot.getMessageAsPrismarine({ translate: "chat.type.announcement", with: [`${bot.players.find(player => player.uuid === packet.senderUuid).profile.name}`, `${packet.plainMessage}`]})?.toMotd())
if (packet.type !== 5) bot.emit("message", unsigned)
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
bot.on('packet.system_chat', packet => {
if (bot.options.version === '1.20.4') {
message = tryParse(loadPrismarineChat.processNbtMessage(packet.content))
} else if (bot.options.version === '1.20.2' || bot.options.version === '1.20.1' || bot.options.version === '1.20' || bot.options.version === '1.19.4' || bot.options.version === '1.19.3') {
message = tryParse(packet.content)
}
if (message.translate === 'advMode.setCommand.success') return // Ignores command set messages
const message = tryParse(packet.content)
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
bot.emit('system_chat', { message, actionbar: packet.isActionBar })
if (packet.isActionBar) {
return
}
bot.emit('message', message)
// console.log(message)
if (bot.options.debug.enabled) {
if (bot.options.debug.chat.system.json && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'systemChat',color:'dark_blue'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'JSON',color:'yellow'},{text:'] ',color:'dark_gray'}])?.toAnsi() + JSON.stringify(message))
if (bot.options.debug.chat.system.ansi && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'systemChat',color:'dark_blue'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Ansi/Normal',color:'gold'},{text:'] ',color:'dark_gray'}])?.toAnsi() + bot.getMessageAsPrismarine(message)?.toAnsi())
if (bot.options.debug.chat.system.motd && bot.options.debug.enabled) bot.console.debug(bot.getMessageAsPrismarine([{text:'[',color:'dark_gray'},{text:'systemChat',color:'dark_blue'},{text:'] ',color:'dark_gray'},{text:'[',color:'dark_gray'},{text:'Motd',color:'dark_red'},{text:'] ',color:'dark_gray'}])?.toAnsi() + bot.getMessageAsPrismarine(message)?.toMotd())
}
tryParsingMessage(message, { players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
function tryParsingMessage (message, data) {
let parsed
for (const parser of bot.chatParsers) {
parsed = parser(message, data)
// console.log(parsed)
if (parsed) break
}
if (!parsed) return
// console.log(data)
bot.emit('parsed_message', parsed)
}
@@ -160,36 +82,60 @@ function inject (bot) {
if (ChatMessage !== undefined) {
return new ChatMessage(message)
}
} catch (e) {
// console.log(e)
}
} catch {}
return undefined
}
/*
bot.chat = message => {
const acc = 0
const bitset = Buffer.allocUnsafe(3)
bitset[0] = acc & 0xFF
bitset[1] = (acc >> 8) & 0xFF
bitset[2] = (acc >> 16) & 0xFF
bot._client.write('chat_message', {
message: message.substring(0, 256),
timestamp: BigInt(Date.now()),
message,
timestamp: BigInt(Date.now()),
salt: 0n,
offset: 0,
acknowledged: bitset
})
}
*/
bot.chat = {
message: message => {
const acc = 0;
const bitset = Buffer.allocUnsafe(3);
bitset[0] = acc & 0xFF;
bitset[1] = (acc >> 8) & 0xFF;
bitset[2] = (acc >> 16) & 0xFF;
bot._client.write('chat_message', {
message: message?.substring(0, 256),
timestamp: BigInt(Date.now()),
salt: 0n,
offset: 0,
acknowledged: bitset
})
},
command: command => {
bot._client.write('chat_command', {
command: command?.substring(0, 256),
timestamp: BigInt(Date.now()),
salt: 0n,
argumentSignatures: [],
signedPreview: false,
messageCount: 0,
acknowledged: Buffer.alloc(3),
previousMessages: []
})
}
}
// console.log(bot.chat.sendMessage)
/*
bot.command = command => {
bot._client.write('chat_command', {
command: command.substring(0, 256),
command,
timestamp: BigInt(Date.now()),
salt: 0n,
argumentSignatures: [],
@@ -199,10 +145,8 @@ function inject (bot) {
previousMessages: []
})
}
bot.tellraw = (message, selector = '@a') => bot.core.run('/minecraft:tellraw @a ' + JSON.stringify(message)) // ? Should this be here?
bot.chatDelay = function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
*/
// bot.tellraw = (message, selector = '@a') => bot.core.run('minecraft:tellraw @a ' + JSON.stringify(message)) // ? Should this be here?
}
module.exports = inject
module.exports = chat;
-56
View File
@@ -1,56 +0,0 @@
const CommandSource = require("../CommandModules/command_source");
const CommandError = require("../CommandModules/command_error");
const { execSync } = require('child_process');
function chat_command_handler(bot, options, config) {
let ratelimit = 0
bot.on("parsed_message", (data) => {
if (data.type !== "minecraft:chat") return;
const prefixes = config.Commands.prefixes;
prefixes.map((prefix) => {
const plainMessage = bot
.getMessageAsPrismarine(data.contents)
?.toString();
if (!plainMessage.startsWith(prefix)) return;
const command = plainMessage.substring(prefix.length);
const source = new CommandSource(data.sender, {
discord: false,
console: false
});
bot.sendFeedback = (message) => {
if (bot.options.useChat) {
bot.tellraw([message]);
} else {
bot.tellraw(["", message]);
}
};
bot.sendError = (message) => {
bot.sendFeedback([{
text: '',
color: `red`
}, message], false)
}
try {
ratelimit++
setTimeout(() => {
ratelimit--
}, 1000)
if (ratelimit > config.Commands.ratelimit) {
bot.sendFeedback({
text: 'You are using commands too fast!',
color: 'dark_red'
})
} else {
bot.commandManager.executeString(source, command);
}
} catch (e) {
console.log(e.stack)
};
});
})
}
module.exports = chat_command_handler;
/*
for (const player of blacklist.players) {
console.log('whos blacklisted?',[player]);
}
*/
+20 -39
View File
@@ -1,23 +1,20 @@
async function command_core (bot, options) {
bot.core = {
// what you think im doing? look at line 17
function core (bot, options, config) {
bot.core = {
area: {
start: /*bot.Core.area.start, ??*/ { x: 0, y: 0, z: 0 },
end: /*bot.Core.area.end, ??*/ { x: 15, y: 0, z: 15 }
start: config.core?.area.start ?? { x: 0, y: 0, z: 0 },
end: config.core?.area.end ?? { x: 15, y: 0, z: 15 }
},
position: null,
currentBlockRelative: { x: 0, y: 0, z: 0 },
refill () {
const pos = bot.core.position
const { start, end } = bot.core.area
if (!pos) return
bot.command(`fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName:'${bot.Core.JSON}'} replace`)
if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return
bot.chat.command(`minecraft:fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName:'${JSON.stringify(config.core.name)}'}`)
},
move (pos = bot.position) {
bot.core.position = {
x: Math.floor(pos.x / 16) * 16,
@@ -30,7 +27,7 @@ async function command_core (bot, options) {
currentBlock () {
const relativePosition = bot.core.currentBlockRelative
const corePosition = bot.core.position
if (!corePosition) return -1
if (!corePosition) return null
return { x: relativePosition.x + corePosition.x, y: relativePosition.y + corePosition.y, z: relativePosition.z + corePosition.z }
},
@@ -60,37 +57,21 @@ async function command_core (bot, options) {
run (command) {
const location = bot.core.currentBlock()
if (!location) return
if (bot.options.useChat ?? bot.options.isCreayun) {
if (command.startsWith('/')) {
bot.command(command.substring(1))
return
}
bot.chat(command)
if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) {
bot.chat.command(command?.substring(0, 256))
} else {
bot._client.write('update_command_block', { command: command.substring(0, 32767), location, mode: 1, flags: 0b100 })
bot.core.incrementCurrentBlock()
// added .substring(0, 32767) so it won't kick the bot if the command is too long.
bot._client.write('update_command_block', { command: command.substring(0, 32767), location, mode: 1, flags: 0b100 })
bot.core.incrementCurrentBlock()
}
},
}
if (bot.options.useChat ?? bot.options.isCreayun) return
bot.on('move', () => {
bot.core.move(bot.position)
if (bot.options.debug.core) {
bot.tellraw(`Bots cords are x: ${bot.position.x} y: ${bot.position.y} z: ${bot.position.z}. this is for debugging! because bot.options.debug.enabled is set to true!`)
}
//setTimeout(() => bot.core.run('say hi'), 100)
}
// if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return
if (bot.options.isSavage) return
bot.on('move', () => {
// if (bot.options.isSavage) return
bot.core.move(bot.position)
// setTimeout(() => bot.core.run('say Hello, world!'), 1000)
})
bot.on('packet.login', (data) => {
const timer = setInterval(() => {
bot.core.refill()
}, bot.options.Core.interval)
bot.on('end', (bot) => {
clearInterval(timer)
})
})
}
module.exports = command_core
module.exports = core;
+18
View File
@@ -0,0 +1,18 @@
function command_loop (bot, options, config) {
bot.cloop = {
list: [],
add (command, interval) {
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
},
remove (index) {
clearInterval(this.list[index].timer)
bot.cloop.list.splice(index, 1)
},
clear () {
for (const cloop of this.list) clearInterval(cloop.timer)
this.list = []
}
}
}
module.exports = command_loop;

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