Compare commits

..
1 Commits
Author SHA1 Message Date
Parker2991 199d49203c v5.1.1 2024-07-07 14:17:43 -04:00
64 changed files with 693 additions and 511 deletions
+20
View File
@@ -0,0 +1,20 @@
Chess is a game played on an 8x8 checkered board, called a chessboard. To play chess, you move your pieces on the board. The goal is to checkmate the other player's king. You need to do it with your pieces.
Rooks: horizontal and vertical
Knights (horses): L shape (one square horizontal, two vertical) or (two squares horizontal, one vertical). Only piece that can jump over others.
Bishops: diagonal
Queens: Rook or bishop only
King: one square anywhere (not into check)
Pawns: one square, first move two squares, captures diagonally
Promotion: When pawns reach the last rank, they can promote to any piece other than pawn and kings.
Castling: Move your king 2 squares towards the rook and move the rook next to the king on the other side. Neither should have moved in the game and the king can't be in check or go through it.
En Passant: When your pawn is on the 5th rank away from your back rank and a pawn moves 2 forward and lands next to yours, you may capture the pawn like it only moved 1 square. It can only be done on the very next move.
Check: The king is under attack from one of the opponents pieces, and he must move out of check on the next move. The king never gets captured.
Checkmate: The king is in check and can't escape. It results in a win for the checkmating player.
Stalemate: The king can't move except into check. It results in a draw.
Board Setup: The board is oriented so that there is a light square in the bottom right corner of both players. The rooks go on the corners, then the knights go next to them, then the bishops, then the queen and king. The queen always goes on her own color. On the next row up the pawns go on every square.
White always makes the first move.
+184
View File
@@ -0,0 +1,184 @@
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) {
// if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on('message', message => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
if (
stringmessage.startsWith(`${players.username} joined the game`)
) {
setTimeout(() => {
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)}`)
}, 1000)
}
})
}
}
/* function login () {
for (const players of filterList.players) {
if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
// } else {
/* 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 message () {
for (const players of filterList.players) {
// if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on("parsed_message", (data) => {
if (data.type !== "minecraft:chat") return;
// console.log(Object.keys(data))
if (data.sender.profile.name === players.username) {
// bot.core.run(`/essentials:mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.uuid} 10y`);
setTimeout(() => {
bot.core.run(`/essentials:mute ${players.username}`)
}, 1000)
}
})
}
/*
console.log((data.sender))
{
uuid: '85f5b68d-a567-3877-9701-3cd7404bc9d9',
profile: { name: 'Parker2991', properties: [ [Object] ] },
chatSession: undefined,
gamemode: 1,
listed: true,
latency: 60,
displayName: { extra: [ [Object], [Object] ], text: '' }
}
*/
}
function mute () {
for (const players of filterList.players) {
// if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on('message', (message) => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
if (
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}`)
||
stringmessage === `${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}`
||
stringmessage === `${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /emute `
||
stringmessage === `${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /mute ${bot?.players?.find((player) => player?.profile?.name === players?.username)?.uuid}`
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /emute ${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}`)
/* ||
stringmessage.includes(`${players.username}: `)*/
) {
setTimeout(() => {
bot.core.run(`/essentials:mute ${bot.players.find((player) => player?.profile?.name === players?.username)?.uuid} 10y`);
bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}, 1000)
}
})
// }
}
}
function gamemode () {
for (const players of filterList.players) {
// if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
bot.on('message', (message) => {
const stringmessage = bot.getMessageAsPrismarine(message)?.toString();
if (
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /gamemode creative`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /minecraft:gamemode creative`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /gmc`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /egmc`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:gamemode creative`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /essentials:gm creative`)
||
stringmessage.startsWith(`${bot.players.find((player) => player?.profile?.name === players?.username)?.profile?.name}: /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
) {
setTimeout(() => {
// 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}`);
}, 1000)
}
})
}
}
function deop () {
for (const players of filterList.players) {
//if (bot.players?.find((player) => player.profile.name === players.username) === undefined) return undefined
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}: `)
) {
setTimeout(() => {
bot.core.run(`execute at @e run deop ${players.username}`)
bot.core.run(`tellraw ${players.username} ${JSON.stringify(bot.exploits.invalidstring)}`)
}, 1000)
}
})
}
}
if (bot.options.isSavage) return
join();
gamemode();
mute();
// login();
deop();
message();
}
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
@@ -0,0 +1 @@
{"players":[{"username":"Bu11D0g1337","ignorecase":false},{"username":"lluiiis__pb__","ignorecase":false}]}
+1
View File
@@ -0,0 +1 @@
[{"text":"e"},{"text":"sus"},{"text":"amongus"}]
-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}]}
+20
View File
@@ -0,0 +1,20 @@
const fs = require("fs");
var data = fs.readFileSync("data.json");
var myObject = JSON.parse(data);
let newData = {
text: "sus"
}
myObject.push(newData);
var newData2 = JSON.stringify(myObject);
fs.rmSync("./data.json");
fs.writeFile("data2.json", newData2, (err) => {
if (err) throw err;
console.log("New data added");
});
fs.rename('data2.json', 'data.json', (err) => {
if (err) throw err;
// console.log('Rename complete!');
});
+44
View File
@@ -0,0 +1,44 @@
/*const playlists = [
{
"id" : "1",
"owner_id" : "2",
"song_ids" : [ "8", "32"]
},
{
"id" : "2",
"owner_id" : "3",
"song_ids" : ["6", "8","11" ]
}
];*/
const fs = require('fs');
var data = require("./data.json");
const e = data.splice('e', 1)
const removePlayerById = (plists, text) =>
plists.filter(player => player.text !== text);
const result = removePlayerById(data, 2);
console.log(result)
// console.log(playerId)
//}
//remove()
/*
const fs = require("fs");
var data = fs.readFileSync("data.json");
var myObject = JSON.parse(data);
let newData = {
text: "sus"
}
myObject.push(newData);
var newData2 = JSON.stringify(myObject);
fs.rmSync("./data.json");
fs.writeFile("data2.json", newData2, (err) => {
if (err) throw err;
console.log("New data added");
});
fs.rename('data2.json', 'data.json', (err) => {
if (err) throw err;
// console.log('Rename complete!');
});
*/
+7
View File
@@ -0,0 +1,7 @@
const mc = require('minecraft-protocol');
async function ping() {
const server = await mc.ping({host:"kaboom.pw",port:"25565"})
// console.log(await mc.ping({host:"kaboom.pw",port:"25565"}))
console.log(server)
}
ping()
+6
View File
@@ -0,0 +1,6 @@
const crypto = require('crypto');
const sus = 'meow';
//const amogus = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + bot.validation.keys.trustedKey).digest('hex').substring(0, 16)
const amogus = crypto.createHash('sha256').update(sus).digest('hex')
console.log(amogus)
+18 -10
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: ["^"],
},
@@ -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"],
@@ -357,4 +365,4 @@ module.exports = {
},
};
//it doing it just for the ones i added lol
// prob a replit moment, it probably thinks there are regexes in the strings
// prob a replit moment, it probably thinks there are regexes in the strings
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'bruhify',
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const {EmbedBuilder} = require('discord.js')
module.exports = {
name: 'cloop',
@@ -180,4 +180,4 @@ throw new CommandError('Invalid argument')
break
}
}
}
}
+3 -3
View File
@@ -1,5 +1,5 @@
const CommandError = require('../CommandModules/command_error')
const CommandSource = require('../CommandModules/command_source')
const CommandError = require('../util/command_error')
const CommandSource = require('../util/command_source')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'cmdtest',
@@ -73,4 +73,4 @@ module.exports = {
/*
*/
//context.source.player.displayName ?? context.source.player.profile.name,
//context.source.player.displayName ?? context.source.player.profile.name,
+39 -42
View File
@@ -1,47 +1,44 @@
const CommandError = require('../CommandModules/command_error')
const buildstring = process.env['buildstring']
const foundation = process.env['FoundationBuildString']
const CommandError = require('../util/command_error')
module.exports = {
name: 'console',
trustLevel: 3,
description:['no :)'],
// description:['make me say something in custom chat'],
name: 'console', // command name here
description: [''], // command desc here
aliases: [], // command aliases here if there is any
trustLevel: 3, // 0 = public, 1 = trusted, 2 = owner, 3 = console
usages: [], // command usage here
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,
const bot = context.bot;
const args = context.arguments;
const source = context.source;
const config = context.config;
let enabled = false;
customChat = {
on() {
enabled = true
},
off() {
enabled = false
}
bot.tellraw([prefix])
}
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (args[0].toLowerCase()) {
case 'customchat':
console.log(customChat);
if (args[1].toLowerCase() === 'off' || args[1].toLowerCase() === 'false' || args[1].toLowerCase() === 'disable') {
customChat.off();
bot.console.info('Custom Chat disabled');
} else if (args[1].toLowerCase() === 'on' || args[1].toLowerCase() === 'true' || args[1].toLowerCase() === 'enable') {
customChat.on();
bot.console.info('Custom Chat enabled');
}
break
case 'say':
console.log(enabled)
if (!enabled) {
bot.chat(`${args.slice(1).join(' ')}`);
} else if (enabled) {
bot.console.log('test :3');
}
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
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'consoleserver',
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error');
const CommandError = require('../util/command_error');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'core',
@@ -22,4 +22,4 @@ module.exports = {
const args = context.arguments;
bot.core.run(`${args.join(' ')}`)
}
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const cowsay = require('cowsay2')
const cows = require('cowsay2/cows')
const { EmbedBuilder } = require('discord.js')
@@ -82,4 +82,4 @@ const Embed = new EmbedBuilder()
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
*/
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'crash',
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require("../CommandModules/command_error")
const CommandError = require("../util/command_error")
module.exports = {
name: 'discordmsg',
@@ -27,4 +27,4 @@ module.exports = {
bot.discord.Message.reply(`${args.join(' ')}`)
}
}
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error');
const CommandError = require('../util/command_error');
module.exports = {
name: 'echo',
description:['make me say something in chat'],
@@ -31,4 +31,4 @@ module.exports = {
bot.chat(message)
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const ivm = require('isolated-vm');
const { stylize } = require('../util/eval_colors');
const options = {
+40
View File
@@ -0,0 +1,40 @@
const CommandError = require('../util/command_error');
const filterJSON = require('../../filter.json');
module.exports = {
name: 'filter', // command name here
description: ['filter players (work in progress)'], // command desc here
aliases: ['blacklist'], // command aliases here if there is any
trustLevel: 1, // 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 config = context.config;
switch (args[1]) {
case 'list':
bot.sendFeedback(
[
{
text: 'Players ',
color: 'gray'
},
{
text: '(',
color: 'gray'
},
{
text: JSON.stringify(Object.keys(filterJSON.players).length),
color: 'gold'
},
{
text: ')',
color: 'gray'
}
]
)
bot.sendFeedback(Object.values(filterJSON)[0].map((player) => player.username + '\n'))
break
}
}
}
+12 -2
View File
@@ -305,7 +305,7 @@ category,
t_rust
,own_her],
false)*/
bot.sendFeedback([
/*bot.tellraw([
{ 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'},
@@ -314,7 +314,17 @@ bot.sendFeedback([
...pub_lick,
t_rust,
own_her,
])
])*/
bot.tellraw([
{ 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,
])
}
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require("../CommandModules/command_error");
const CommandError = require("../util/command_error");
const path = require("path");
const fs = require("fs");
const packageJSON = require("../../package.json");
+2 -2
View File
@@ -1,8 +1,8 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'kill',
description:['kills the bots process'],
trustLevel: 2,
trustLevel: 3,
aliases:['stop','kill','suicide'],
usage:[""],
async execute (context) {
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'list',
@@ -136,4 +136,4 @@ const Embed = new EmbedBuilder()
}
}
//what is wi
// IDK
// IDK
+13
View File
@@ -0,0 +1,13 @@
const CommandError = require('../util/command_error')
module.exports = {
name: 'mcserver', // command name here
description: ['look up minecraft server info'], // 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
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'memusage',
@@ -60,4 +60,4 @@ const Embed = new EmbedBuilder()
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
*/
+2 -2
View File
@@ -1,4 +1,4 @@
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'],
@@ -36,4 +36,4 @@ module.exports = {
context.source.player.displayName ?? context.source.player.profile.name,
message
[%s%s%s] [%s] %s \u203a %s
*/
*/
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error');
const CommandError = require('../util/command_error');
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'ping', // command name here
@@ -31,4 +31,4 @@ module.exports = {
bot.discord.Message.reply({embeds: [Embed]})
}
}
}
}
+3 -3
View File
@@ -1,7 +1,7 @@
const CommandError = require('../CommandModules/command_error');
const CommandError = require('../util/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'],
@@ -55,4 +55,4 @@ module.exports = {
bot.discord.Message.reply(e.toString())
}
}
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'refillcore',
description:['refill the bots core'],
@@ -24,4 +24,4 @@ module.exports = {
bot.discord.Message.reply('refilling core,......')
}
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'reconnect',
+2 -2
View File
@@ -1,5 +1,5 @@
const { EmbedBuilder } = require('discord.js')
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'reload',
description:['Reload the bots files'],
@@ -41,4 +41,4 @@ discordExecute(context) {
throw new CommandError(e.stack)
}
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error.js')
const CommandError = require('../util/command_error.js')
module.exports = {
name: 'sctoggle',
description:['toggle the selfcare'],
+4 -5
View File
@@ -1,14 +1,13 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/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'],
trustLevel: 2,
aliases:['sfd'],
description:['selfdestruct server'],
usage:[""],
usage:[""],
execute (context) {
//throw new CommandError('temp disabled')
+3 -3
View File
@@ -1,11 +1,11 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const { stylize } = require('../util/eval_colors')
const util = require('util')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'servereval',
description:['run code unisolated'],
trustLevel: 2,
trustLevel: 3,
aliases:['svreval'],
usage: ['<js code>'],
execute (context) {
@@ -47,4 +47,4 @@ module.exports = {
bot.discord.Message.reply({ embeds: [Embed] })
}
}
}
}
+3 -3
View File
@@ -1,10 +1,10 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/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
trustLevel: 3, // 0 = public, 1 = trusted, 2 = owner, 3 = console
usage: [], // command usage here
execute (context) {
const bot = context.bot
@@ -30,4 +30,4 @@ module.exports = {
bot.sendError(e.toString())
}
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'soundbreaker',
description:["make peoples ears bleed"],
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const Docker = require('dockerode')
const stream = require('stream')
const { exec } = require('child_process')
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error');
const CommandError = require('../util/command_error');
module.exports = {
name: 'theme',
description:['change the bots theme'],
@@ -29,4 +29,4 @@ pub_lickColor:"#00FFFF",
t_rustedColor:"dark_purple",
own_herColor:"dark_red",
},
*/
*/
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'time',
+1 -1
View File
@@ -1,5 +1,5 @@
const between = require('../util/between')
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
module.exports = {
name: 'tpr',
description:['teleport to a random place'],
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'tpsbar',
@@ -64,4 +64,4 @@ module.exports = {
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym
//wdym
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error');
const CommandError = require('../util/command_error');
const { translate } = require('@vitalets/google-translate-api');
const { EmbedBuilder } = require('discord.js');
module.exports = {
@@ -47,4 +47,4 @@ module.exports = {
bot.discord.Message.reply({ embeds: [Embed] })
}
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
let timer = null
+2 -2
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 = {
@@ -94,4 +94,4 @@ const Embed = new EmbedBuilder()
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
*/
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('../CommandModules/command_error');
const CommandError = require('../util/command_error');
const https = require('https');
const http = require('http');
const util = require('util');
@@ -78,4 +78,4 @@ const Embed = new EmbedBuilder()
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
bot.discord.Message.reply({embeds: [Embed]})
*/
*/
+3 -3
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',
@@ -61,4 +61,4 @@ const Embed = new EmbedBuilder()
.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]})
*/
*/
+45
View File
@@ -0,0 +1,45 @@
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'],
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])
}
}
//[%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
+2 -2
View File
@@ -1,4 +1,4 @@
const CommandError = require('./CommandModules/command_error.js');
const CommandError = require('./util/command_error.js');
const util = require("util");
const path = require('path');
const fs = require('fs');
@@ -14,7 +14,7 @@ if (!fs.existsSync(path.join(__dirname, '../config.yml'))) {
const createBot = require('./bot.js');
const readline = require("readline");
try {
config = parseYaml.load(fs.readFileSync('config.yml', 'utf8'));
config = parseYaml.load(fs.readFileSync(path.join(__dirname, '../config.yml'), 'utf8'));
} catch (e) {
console.log(e.toString())
}
+3 -2
View File
@@ -1,5 +1,5 @@
const CommandSource = require("../CommandModules/command_source");
const CommandError = require("../CommandModules/command_error");
const CommandSource = require("../util/command_source");
const CommandError = require("../util/command_error");
const { execSync } = require('child_process');
function chat_command_handler(bot, options, config) {
let ratelimit = 0
@@ -41,6 +41,7 @@ function chat_command_handler(bot, options, config) {
})
} else {
bot.commandManager.executeString(source, command);
// bot.tellraw("Please note that other bots will start using namespaced prefixes but FNFBoyfriendBot will continue using the ~ prefix with the addition of namespace prefixes");
}
} catch (e) {
console.log(e.stack)
+125 -215
View File
@@ -1,249 +1,159 @@
const fs = require("fs");
const path = require("path");
const CommandError = require("../CommandModules/command_error.js");
const {
EmbedBuilder
} = require('discord.js')
const CommandError = require("../util/command_error.js");
const { EmbedBuilder } = require('discord.js')
function command_manager(bot, options, config) {
bot.commandManager = {
commands: {},
commandlist: [],
execute(source, commandName, args, message, options) {
const command = this.getCommand(commandName.toLowerCase());
const player = source?.player?.profile?.name;
const uuid = source?.player?.uuid;
const command = this.getCommand(commandName.toLowerCase());
const player = source?.player?.profile?.name;
const uuid = source?.player?.uuid;
try {
if (source.sources.console && !source?.sources?.discord) {
if (source.sources.console && !source?.sources?.discord) {
if (!command || !command.execute) {
bot.console.warn({text:`Unknown Command ${commandName}. type "${bot.Console.prefix}help" for help`,color:'dark_red'})
}
} else if (source?.sources?.discord && !source.sources.console) {
if (!command || !command.execute) {
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle('Unknown Command')
.setDescription(bot.getMessageAsPrismarine([{ // sus
translate: `command.unknown.command`},{text:'\n'},{text:`${commandName} `},{translate:"command.context.here"}])?.toMotd(bot.registry.language))
bot.discord.Message.reply({ embeds: [Embed] })
}
} else if (!source?.sources?.discord && !source.sources.console) {
if (bot.options.isCreayun) {
if (!command || !command.execute) {
bot.console.warn({
text: `Unknown Command ${commandName}. type "${bot.Console.prefix}help" for help`,
color: 'dark_red'
})
}
} else if (source?.sources?.discord && !source.sources.console) {
if (!command || !command.execute) {
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle('Unknown Command')
.setDescription(bot.getMessageAsPrismarine([{ // sus
translate: `command.unknown.command`
}, {
text: '\n'
}, {
text: `${commandName} `
}, {
translate: "command.context.here"
}])?.toMotd(bot.registry.language))
bot.discord.Message.reply({
embeds: [Embed]
})
}
} else if (!source?.sources?.discord && !source.sources.console) {
if (bot.options.isCreayun) {
if (!command || !command.execute) {
throw new CommandError(`Unknown command ${commandName} type "${bot.Commands.prefixes[0]}help" for help`)
}
} else {
if (!command || !command.execute) { // bot.options.command.prefixes[0]
throw new CommandError(bot.getMessageAsPrismarine([{ // sus
translate: `command.unknown.command`
}, {
text: '\n'
}, {
text: `${commandName} `
}, {
translate: "command.context.here"
}])?.toMotd(bot.registry.language));
}
}
} else if (bot.options.isCreayun) {
if (!command || !command.execute) {
bot.chat(`Unknown command ${commandName} type "${bot.Commands.prefixes[0]}help" for help`)
}
}
const event = bot?.discord?.Message
const roles = event?.member?.roles?.cache
if (command?.trustLevel === -1) {
throw new CommandError('this command has been disabled!')
}
if (command?.trustLevel > 0) {
if (command?.trustLevel === 1 && !source?.sources?.discord && !source?.sources?.console) {
const hash = `${args[0]}`
if (args.length === 0 && bot.hash && bot.owner && bot.hashing.hash) throw new CommandError([{
text: 'Please provide an ',
color: 'gray'
}, {
text: 'Trusted ',
color: '#219696'
}, {
text: 'hash or an ',
color: 'gray'
}, {
text: 'Owner ',
color: '#2081c3'
}, {
text: 'hash',
color: 'gray'
}])
if (hash !== bot.hash && hash !== bot.owner && hash !== bot.hashing.hash) throw new CommandError([{
text: 'Invalid ',
color: 'gray'
}, {
text: 'Trusted ',
color: '#219696'
}, {
text: 'hash or Invalid ',
color: 'gray'
}, {
text: 'Owner ',
color: '#2081c3'
}, {
text: 'hash',
color: 'gray'
}])
} else if (command.trustLevel === 1 && source?.sources?.discord && !source.sources.console) {
const hasRole = roles?.some(role => role.name === `${bot.validation.discord.roles.trusted}` || role.name === `${bot.validation.discord.roles.owner}`)
if (!hasRole) throw new CommandError({
translate: 'You are not trusted!'
})
}
bot?.hashing?.updateHash();
if (args[0] === bot.hash) {
bot.console.info({
text: `Player ${player} UUID: ${uuid} Hash:${bot.hash}`,
color: 'white'
})
} else if (args[0] === bot.owner) {
bot.console.info({
text: `Player ${player} UUID: ${uuid} Hash:${bot.owner}`,
color: 'white'
})
}
if (command?.trustLevel === 2 && !source?.sources?.discord && !source?.sources?.console) {
const owner = `${args[0]}`
if (args.length === 0 && bot.owner) throw new CommandError([{
text: 'Please provide a ',
color: 'red',
color: 'gray'
}, {
text: 'Owner ',
color: '#2081c3'
}, {
text: 'hash',
color: 'gray'
}])
if (owner === bot.hash || owner === bot.hashing.hash) throw new CommandError([{
text: "THATS A ",
color: 'gray'
}, {
text: 'TRUSTED ',
color: '#219696'
}, {
text: 'HASH AFAIK',
color: 'gray'
}])
if (owner !== bot.owner) throw new CommandError([{
text: "Invalid ",
color: 'gray'
}, {
text: 'Owner ',
color: '#2081c3'
}, {
text: 'Hash',
color: 'gray'
}])
} else if (command?.trustLevel === 2 && source?.sources?.discord && !source?.sources?.console) {
const hasRole = roles?.some(role => role.name === `${bot.validation.discord.roles.owner}`)
if (!hasRole) throw new CommandError({
translate: 'You are not the Owner!'
})
}
if (command.trustLevel === 3 && !source?.sources?.console)
throw new CommandError({
translate: "This command can only be executed via console",
color: "blue",
});
}
if (source?.sources?.discord && !source?.sources?.matrix && !source.sources.console) {
if (!command?.discordExecute && command) {
bot.discord.Message.reply('This command is not supported in discord!')
} else {
return command?.discordExecute({
bot,
source,
arguments: args,
config,
options,
})
}
throw new CommandError(`Unknown command ${commandName} type "${bot.Commands.prefixes[0]}help" for help`)
}
} else {
return command?.execute({
bot,
source,
arguments: args,
options,
config,
});
if (!command || !command.execute) { // bot.options.command.prefixes[0]
throw new CommandError(bot.getMessageAsPrismarine([{ // sus
translate: `command.unknown.command`},{text:'\n'},{text:`${commandName} `},{translate:"command.context.here"}])?.toMotd(bot.registry.language));
}
}
} else if (bot.options.isCreayun) {
if (!command || !command.execute) {
bot.chat(`Unknown command ${commandName} type "${bot.Commands.prefixes[0]}help" for help`)
}
}
const event = bot?.discord?.Message
const roles = event?.member?.roles?.cache
if (command?.trustLevel === -1) {
throw new CommandError('this command has been disabled!')
}
if (command?.trustLevel > 0) {
if (command?.trustLevel === 1 && !source?.sources?.discord && !source?.sources?.console) {
const hash = `${args[0]}`
if (args.length === 0 && bot.hash && bot.owner && bot.hashing.hash) throw new CommandError([{text:'Please provide an ',color:'gray'},{text:'Trusted ',color:'#219696'},{text:'hash or an ',color:'gray'},{text:'Owner ',color:'#2081c3'},{text:'hash',color:'gray'}])
if (hash !== bot.hash && hash !== bot.owner && hash !== bot.hashing.hash) throw new CommandError([{text:'Invalid ',color:'gray'},{text:'Trusted ',color:'#219696'},{text:'hash or Invalid ',color:'gray'},{text:'Owner ',color:'#2081c3'},{text:'hash',color:'gray'}])
} else if (command.trustLevel === 1 && source?.sources?.discord && !source.sources.console) {
const hasRole = roles?.some(role => role.name === `${bot.validation.discord.roles.trusted}` || role.name === `${bot.validation.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not trusted!' })
}
} catch (error) {
if (!source.sources.discord && !source.sources.console) {
if (bot.options.isCreayun || bot.options.isSavage) {
if (error instanceof CommandError)
bot.chat(bot.getMessageAsPrismarine(error._message)?.toMotd().replaceAll('§', '&'))
else bot.chat(bot.getMessageAsPrismarine({
translate: 'command.failed',
color: 'dark_red'
})?.toMotd(bot.registry.language).replaceAll('§', '&'))
} else {
if (error instanceof CommandError)
bot.sendError(error._message)
else bot.sendError(bot.getMessageAsPrismarine({
translate: "command.failed",
color: `${config.Commands.colors.error}`,
hoverEvent: {
action: "show_text",
contents: String(error.stack)
},
})?.toMotd(bot.registry.language));
bot?.hashing?.updateHash();
if (args[0] === bot.hash) {
bot.console.info({ text: `Player ${player} UUID: ${uuid} Hash:${bot.hash}`, color: 'white' })
} else if (args[0] === bot.owner) {
bot.console.info({ text: `Player ${player} UUID: ${uuid} Hash:${bot.owner}`, color: 'white' })
}
bot.console.warn(error.stack)
} else if (source.sources.discord && !source.sources.console) {
const Embed = new EmbedBuilder()
.setColor(`${config.Commands.colors.discord.error}`)
.setTitle(`${command?.name} Command`)
.setDescription(`\`\`\`${error}\`\`\``)
bot.discord.Message.reply({
embeds: [Embed]
})
if (command?.trustLevel === 2 && !source?.sources?.discord && !source?.sources?.console) {
const owner = `${args[0]}`
if (args.length === 0 && bot.owner) throw new CommandError([{text:'Please provide a ',color:'red',color:'gray'},{text:'Owner ',color:'#2081c3'},{text:'hash',color:'gray'}])
if (owner === bot.hash || owner === bot.hashing.hash) throw new CommandError([{text:"THATS A ",color:'gray'},{text:'TRUSTED ',color:'#219696'},{text:'HASH AFAIK',color:'gray'}])
if (owner !== bot.owner) throw new CommandError([{text:"Invalid ",color:'gray'},{text:'Owner ',color:'#2081c3'},{text:'Hash',color:'gray'}])
} else if (command?.trustLevel === 2 && source?.sources?.discord && !source?.sources?.console) {
// const events = source.discordMessageEvent
// const roless = events?.member?.roles?.cache
const hasRole = roles?.some(role => role.name === `${bot.validation.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not the Owner!' })
}
if (command.trustLevel === 3 && !source?.sources?.console)
throw new CommandError({translate: "This command can only be executed via console",color: "blue",});
}
if(source?.sources?.discord && !source?.sources?.matrix && !source.sources.console){
if (!command?.discordExecute && command) {
bot.discord.Message.reply('This command is not supported in discord!')
}else{
return command?.discordExecute({bot, source, arguments: args, args})
}
}else{
return command?.execute({ bot, source, arguments: args, options, config });
}
},
} catch (error) {
if (!source.sources.discord && !source.sources.console) {
if (bot.options.isCreayun) {
if (error instanceof CommandError)
bot.chat(bot.getMessageAsPrismarine(error._message)?.toMotd().replaceAll('§','&'))
else bot.chat(bot.getMessageAsPrismarine({ translate: 'command.failed', color: 'dark_red' })?.toMotd(bot.registry.language).replaceAll('§','&'))
} else {
if (error instanceof CommandError)
bot.sendError(error._message)
else bot.sendError(bot.getMessageAsPrismarine({
translate: "command.failed",
color: `${bot.Commands.colors.error}`,
hoverEvent: { action: "show_text", contents: String(error.stack) },
})?.toMotd(bot.registry.language));
}
bot.console.warn(error.stack)
} else if (source.sources.discord && !source.sources.console) {
const Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.error}`)
.setTitle(`${command?.name} Command`)
.setDescription(`\`\`\`${error}\`\`\``)
bot.discord.Message.reply({ embeds: [Embed] })
}
}
},
executeString(source, command) {
const [commandName, ...args] = command.split(" ");
return this.execute(source, commandName, args)
},
discordExecute(source, command) {
const [commandName, ...args] = command.split(" ");
if (source?.sources?.discord && !source?.sources?.matrix && !source?.sources?.console) {
return this.discordExecute(source, commandName, args)
}
},
discordExecute(source, command) {
const [commandName, ...args] = command.split(" ");
if (source?.sources?.discord && !source?.sources?.matrix && !source?.sources?.console) {
return this.discordExecute(source, commandName, args)
}
},
register(command) {
this.commands[command.name] = command;
if (command.aliases) {
command.aliases.map((a) => (this.commands[a] = command));
}
},
getCommand(name) {
return this.commands[name];
},
getCommands() {
return Object.values(this.commands);
},
};
},
};
//
commandlist = [];
for (const filename of fs.readdirSync(path.join(__dirname, "../commands"))) {
try {
const command = require(path.join(__dirname, "../commands", filename));
+7 -15
View File
@@ -1,8 +1,8 @@
const CommandSource = require("../CommandModules/command_source");
const CommandSource = require("../util/command_source");
function Console (bot, options, config) {
const chat = require('prismarine-chat')(bot.options.version)
let ratelimit = 0
// let ratelimit = 0
bot.console = {
readline: null,
username: bot.username,
@@ -87,7 +87,7 @@ function Console (bot, options, config) {
bot.console.info(ansi);
};
bot.on("parsed_message", (data) => {
/* bot.on("parsed_message", (data) => {
if (data.type !== "minecraft:chat") return;
const plainMessage = bot
@@ -99,7 +99,7 @@ function Console (bot, options, config) {
bot.chat("FNF Sky? i simp for her :3")
}
return;
});
});*/
bot.on("message", (message) => {
/*function log(...args) {
@@ -109,22 +109,14 @@ function Console (bot, options, config) {
}*/
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi();
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi().replaceAll('CynicalDev','Emirex the Cotten Picker').replaceAll('denisapain','kill yourself denis >:3');
const string = bot.getMessageAsPrismarine(message)?.toString();
if (!options.Console.enabled) return;
ratelimit++
setTimeout(() => {
ratelimit--
}, 1000)
if (ratelimit > options.Console.ratelimit) { // ,.
bot._client.end("Anti spam :3")
} else {
bot?.console?.log(`${ansi}`);
if (config.console.filelogging) {
bot?.console?.filelogger(`${chat.fromNotch([{text:'<',color:'dark_gray'},{text:`${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} `,color:'dark_purple'},{text:`${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO"})}`,color:'#00FFFF'},{text:' LOGS',color:'gold'},{text:'>',color:'dark_gray'},{text:' [',color:'dark_gray'},{text:`${bot.options.serverName}`,color:'dark_gray'},{text:'] ',color:'dark_gray'}])?.toString()} ${string}`)
}
bot?.console?.filelogger(`${chat.fromNotch([{text:'<',color:'dark_gray'},{text:`${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} `,color:'dark_purple'},{text:`${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO"})}`,color:'#00FFFF'},{text:' LOGS',color:'gold'},{text:'>',color:'dark_gray'},{text:' [',color:'dark_gray'},{text:`${bot.options.serverName}`,color:'dark_gray'},{text:'] ',color:'dark_gray'}])?.toString()} ${string}`)
};
})
}
+14
View File
@@ -0,0 +1,14 @@
function death (bot, options, config) {
bot.isAlive = true
bot._client.on('respawn', (packet) => {
bot.isAlive = false
bot.emit('respawn')
})
const respawn = () => {
if (bot.isAlive) return
bot._client.write('client_command', bot.supportFeature('respawnIsPayload') ? { payload: 0 } : { actionId: 0 })
}
bot.respawn = respawn
}
module.exports = death;
+3 -4
View File
@@ -2,7 +2,7 @@
const { Client, GatewayIntentBits, interaction } = require('discord.js')
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
const CommandSource = require('../CommandModules/command_source')
const CommandSource = require('../util/command_source')
const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
const util = require('util')
@@ -55,8 +55,7 @@ function discord(bot, options) {
}
function sendComponent(message) {
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```')
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```').replaceAll('https://discord','https:\\//discord')?.replaceAll('CynicalDev','Emirex the Cotten Picker')?.replaceAll('denisapain','kill yourself denis >:3').replaceAll('discord.gg', 'discord.\rgg');
try {
sendDiscordMessage(fixansi(ansi.replaceAll('`', '`\u200b')))
} catch (e) {
@@ -192,4 +191,4 @@ function discord(bot, options) {
return i;
}
}
module.exports = discord;
module.exports = discord;
+18 -8
View File
@@ -11,18 +11,24 @@ function hashgen (bot) {
let owner
let interval = setInterval(() => {
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + bot.validation.keys.trustedKey).digest('hex').substring(0, 16)
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + bot.validation.keys.ownerKey).digest('hex').substring(0, 16)
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 1000) + bot.validation.keys.ownerKey).digest('hex').substring(0, 16)
bot.hash = hash
bot.owner = owner
}, 2000)
}, 100)
/*
generateHash () {
return crypto.randomBytes(4).toString('hex').substring(0, 16)
},
*/
function update() {
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + bot.validation.keys.trusted).digest('hex').substring(0, 16)
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + bot.validation.keys.owner).digest('hex').substring(0, 16)
setInterval(() => {
hash = crypto?.createHash('sha256')?.update(Math?.floor(Date?.now() / 10000) + bot.validation.keys.trusted).digest('hex').substring(0, 16)
owner = crypto?.createHash('sha256')?.update(Math?.floor(Date?.now() / 100) + bot.validation.keys.owner).digest('hex').substring(0, 16)
// owner = crypto.createHash('sha256').update(bot.validation.keys.owner).digest('hex').substring(0, 16)
bot.hash = hash
bot.owner = owner
}, 100)
//this should work right?
/*
bot.discord.channel = client.channels.cache.get(options.discord.channelId)
@@ -33,7 +39,11 @@ function hashgen (bot) {
if (interval) clearInterval(interval)
})
*/
}
}
//update()
//bot.Valdation = {
// updateHash: update()
//}
let _hash = generateHash()
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
@@ -108,4 +118,4 @@ function inject (bot) {
function generateHash () {
return crypto.randomBytes(4).toString('hex')
}
*/
*/
+1 -1
View File
@@ -6,7 +6,7 @@ function position (bot) {
x: packet.flags & 1 ? (this.x + packet.x) : packet.x,
y: packet.flags & 2 ? (this.y + packet.y) : packet.y,
z: packet.flags & 4 ? (this.z + packet.z) : packet.z
}//this looks right?
}
bot._client.write('teleport_confirm', { teleportId: packet.teleportId })
+3 -2
View File
@@ -1,6 +1,6 @@
const path = require('path');
const fs = require('fs');
const CommandError = require('../CommandModules/command_error')
const CommandError = require('../util/command_error')
const { EmbedBuilder } = require('discord.js')
function reload (bot,options,context) {
bot.commandReload = function () {
@@ -16,7 +16,8 @@ function reload (bot,options,context) {
bot.commandManager.commandlist.push(command)
} catch (error) {
bot.console.error(["Failed to load File ", filename, ":", error.stack])
bot.tellraw({text:`${error.stack}`,color:'dark_red'});
bot.tellraw({text: `Failed to reload file ${filename}`})
//bot.tellraw({text:`${error.stack}`,color:'dark_red'});
}
}
}
+2 -2
View File
@@ -115,9 +115,9 @@ function selfcare (bot) {
else if (stringmessage?.startsWith('You have been unmuted')) unmuted = false
// kaboom CommandSpy selfcare
else if (JSON.stringify(message) === '{"text":"Successfully enabled CommandSpy"}') commandSpyEnabled = true
else if (stringmessage?.startsWith('Successfully enabled CommandSpy')) commandSpyEnabled = true
else if (JSON.stringify(message) === '{"text":"Successfully disabled CommandSpy"}') commandSpyEnabled = false
else if (stringmessage?.startsWith("Successfully disabled CommandSpy")) commandSpyEnabled = false
// kaboom prefix selfcare
else if (JSON.stringify(message) === `{"extra":[{"text":"&8[&bPrefix: &4${bot.Commands?.prefixes[0]}&8]"}],"text":"You now have the tag: "}` || stringmessage === 'Something went wrong while saving the prefix. Please check console.') {