mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-29 13:45:38 -05:00
v8.0.0-beta Build: 3350
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
node_modules
|
||||
config.js
|
||||
.git
|
||||
src/modules/exploits.js
|
||||
src/modules/exploits.js
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
||||
"vcs": {
|
||||
"enabled": false,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": false
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": false,
|
||||
"ignore": []
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "space"
|
||||
},
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "double"
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-167
@@ -12,9 +12,6 @@
|
||||
"prismarine-registry": "^1.11.0",
|
||||
"undici": "^7.16.0",
|
||||
"wikipedia": "^2.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/msal-common": {
|
||||
@@ -40,170 +37,6 @@
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/biome": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz",
|
||||
"integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"bin": {
|
||||
"biome": "bin/biome"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/biome"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@biomejs/cli-darwin-arm64": "1.9.4",
|
||||
"@biomejs/cli-darwin-x64": "1.9.4",
|
||||
"@biomejs/cli-linux-arm64": "1.9.4",
|
||||
"@biomejs/cli-linux-arm64-musl": "1.9.4",
|
||||
"@biomejs/cli-linux-x64": "1.9.4",
|
||||
"@biomejs/cli-linux-x64-musl": "1.9.4",
|
||||
"@biomejs/cli-win32-arm64": "1.9.4",
|
||||
"@biomejs/cli-win32-x64": "1.9.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-arm64": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz",
|
||||
"integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-x64": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz",
|
||||
"integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz",
|
||||
"integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz",
|
||||
"integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz",
|
||||
"integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64-musl": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz",
|
||||
"integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-arm64": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz",
|
||||
"integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-x64": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz",
|
||||
"integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders": {
|
||||
"version": "1.11.3",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.11.3.tgz",
|
||||
|
||||
@@ -7,8 +7,5 @@
|
||||
"prismarine-registry": "^1.11.0",
|
||||
"undici": "^7.16.0",
|
||||
"wikipedia": "^2.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
class command {
|
||||
constructor () {
|
||||
|
||||
}
|
||||
}
|
||||
module.exports = command;
|
||||
@@ -1,22 +0,0 @@
|
||||
const crypto = require('crypto');
|
||||
|
||||
class decryption {
|
||||
static decrypt (context) {
|
||||
const { skibot } = context.config
|
||||
const encrypted = context.encrypted
|
||||
|
||||
const algorithm = "aes-192-cbc";
|
||||
const password = skibot.password;
|
||||
const key = crypto.scryptSync(password, "salt", 24);
|
||||
const iv = Buffer.alloc(16, 0);
|
||||
const decipher = crypto.createDecipheriv(algorithm, key, iv)
|
||||
|
||||
const input = encrypted
|
||||
let decrypted = decipher.update(`${encrypted}`, 'hex', 'utf8')
|
||||
decrypted += decipher.final('utf8')
|
||||
return decrypted
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = decryption;
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
const crypto = require('crypto');
|
||||
|
||||
class encrytion {
|
||||
static encrypt (args) {
|
||||
const algorithm = 'aes-192-cbc';
|
||||
const password = 'meow';
|
||||
|
||||
const key = crypto.scryptSync(password, 'salt', 24);
|
||||
const iv = Buffer.alloc(16, 0);
|
||||
const cipher = crypto.createCipheriv(algorithm, key, iv);
|
||||
const hash = crypto.createHash("sha512")
|
||||
.update(Math.floor(Date.now() / 2000) + "meow")
|
||||
.digest("hex")
|
||||
.substring(0, 16)
|
||||
|
||||
const json = {
|
||||
player: "meow",
|
||||
uuid: ":3",
|
||||
hash: hash,
|
||||
args: args
|
||||
}
|
||||
|
||||
let encrypted = cipher.update(`${JSON.stringify(json)}`, "uft8", "hex")
|
||||
encrypted += cipher.final('hex')
|
||||
|
||||
return encrypted
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = encrytion
|
||||
+4
-4
@@ -69,7 +69,7 @@ class Bot {
|
||||
});
|
||||
|
||||
client.on("error", (error) => {
|
||||
//try {
|
||||
try {
|
||||
if (disconnectCount === 10) {
|
||||
bot.console.info("stopped logging disconnect messages for now...");
|
||||
bot?.discord?.channel?.send(
|
||||
@@ -86,9 +86,9 @@ class Bot {
|
||||
);
|
||||
bot?.discord?.channel?.send(error.toString());
|
||||
}
|
||||
// } catch (e) {
|
||||
// console.log(e.stack);
|
||||
// }
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
}
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (data) => {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
class CommandContext {
|
||||
constructor(name, aliases, description, trustLevel, usages, chatTypes) {
|
||||
constructor(name, aliases, description, trustLevel, usages, playerChatOnly) {
|
||||
this.data = {};
|
||||
this.data.name = name;
|
||||
this.data.aliases = aliases;
|
||||
this.data.description = description;
|
||||
this.data.trustLevel = trustLevel;
|
||||
this.data.usages = usages;
|
||||
this.data.chatTypes = chatTypes;
|
||||
this.data.playerChatOnly = playerChatOnly
|
||||
}
|
||||
}
|
||||
module.exports = CommandContext;
|
||||
|
||||
@@ -10,7 +10,7 @@ class kick extends CommandContext {
|
||||
"kick a player from the server",
|
||||
trustLevel.admin,
|
||||
["invalidstring", "item", "te"],
|
||||
true,
|
||||
false,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
@@ -19,7 +19,7 @@ class kick extends CommandContext {
|
||||
const config = context.config;
|
||||
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return;
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "invalidstring":
|
||||
bot.exploits.crashes.invalidString(args[2]);
|
||||
bot.tellraw("@a", `crashing ${args[2]}`);
|
||||
|
||||
@@ -16,6 +16,7 @@ class console extends CommandContext {
|
||||
"validate/validation/val <owner/o/admin/a/trusted/t>",
|
||||
"logging/togglelogging/logtoconsole <on/true/enable/off/false/disable>",
|
||||
],
|
||||
false,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
|
||||
@@ -12,6 +12,7 @@ class kill extends CommandContext {
|
||||
"kill the bots process",
|
||||
trustLevel.owner,
|
||||
[""],
|
||||
false
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
|
||||
@@ -17,6 +17,7 @@ class core extends CommandContext {
|
||||
"$uuid <message>",
|
||||
"<message>"
|
||||
],
|
||||
false,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
|
||||
@@ -12,10 +12,11 @@ class echo extends CommandContext {
|
||||
"make me say something!",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
async execute(context) {
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
bot.chat.send(`${args.join(" ")}`);
|
||||
|
||||
@@ -14,6 +14,7 @@ class extras extends CommandContext {
|
||||
"unregister",
|
||||
"unregisterall"
|
||||
],
|
||||
true,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
|
||||
@@ -15,6 +15,7 @@ class help extends CommandContext {
|
||||
"see a list of commands",
|
||||
trustLevel.public,
|
||||
["<command>"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ class info extends CommandContext {
|
||||
"server",
|
||||
"version",
|
||||
],
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
@@ -57,22 +58,6 @@ class info extends CommandContext {
|
||||
translate: "fnfboyfriendbot.command.info.about",
|
||||
fallback: translations["fnfboyfriendbot.command.info.about"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${botInfo.buildstring.url}`, color: config.colors.commands.secondary }
|
||||
],
|
||||
hover_event: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "click here to view bots source code",
|
||||
color: `${config.colors.commands.primary}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
click_event: {
|
||||
action: "open_url",
|
||||
url: `${botInfo.buildstring.url}`,
|
||||
}
|
||||
})
|
||||
break;
|
||||
case "config":
|
||||
@@ -169,7 +154,7 @@ class info extends CommandContext {
|
||||
case "contributors":
|
||||
case "credits":
|
||||
component.push({
|
||||
translate: "%s%s - %s\n%s:\n%s\n%s\n%s\n%s\n%s %s\n%s\n%s",
|
||||
translate: "%s%s - %s\n%s:\n%s\n%s\n%s\n%s\n%s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Parker", color: "dark_red" },
|
||||
@@ -179,11 +164,9 @@ class info extends CommandContext {
|
||||
{ text: "_ChipMC_", color: "dark_blue" },
|
||||
{ text: "chayapak", color: "yellow" },
|
||||
{ text: "_yfd", color: "light_purple" },
|
||||
{ text: "aaa", color: "gold" },
|
||||
{ text: "Morgan", color: "green" },
|
||||
{ text: "Ankan", color: "dark_green" },
|
||||
{ text: "TurtleKid", color: "green" },
|
||||
{ text: "aaa/ImFloriz", color: "gold" },
|
||||
{ text: "Ploat/ImGloriz", color: "#cd8ccb" },
|
||||
{ text: "TurtleKid", color: "green" }
|
||||
],
|
||||
});
|
||||
break;
|
||||
|
||||
@@ -12,6 +12,7 @@ class list extends CommandContext {
|
||||
"check whos online on the server",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
false
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
|
||||
@@ -9,6 +9,7 @@ class mcserver extends CommandContext {
|
||||
"pings minecraft servers",
|
||||
trustLevel.public,
|
||||
["<ip>"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,7 +34,8 @@ class mcserver extends CommandContext {
|
||||
return
|
||||
}
|
||||
|
||||
process.once('uncaughtException', (error) => {
|
||||
process.on('uncaughtException', (error) => {
|
||||
console.log(error)
|
||||
source.sendFeedback({
|
||||
translate: "fnfboyfriendbot.command.mcserver.server.unknown",
|
||||
fallback: translations["fnfboyfriendbot.command.mcserver.server.unknown"],
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class netmsg extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"netmsg",
|
||||
[
|
||||
"networkmessage",
|
||||
],
|
||||
"send a message to other servers that the bot is connected to",
|
||||
trustLevel.public,
|
||||
["<message>"],
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
let component = [];
|
||||
|
||||
if (bot.options.private === true) {
|
||||
component.push({
|
||||
translate: "[%s] %s \u203a %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: `${bot.options.serverName}`, color: config.colors.commands.primary },
|
||||
source?.player?.displayName ?? source?.player?.profile?.name,
|
||||
{ text: `${args.join(' ')}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
})
|
||||
} else {
|
||||
component.push({
|
||||
translate: "[%s:%s] %s \u203a %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: `${bot.options.host}`, color: config.colors.commands.primary },
|
||||
{ text: `${bot.options.port}`, color: config.colors.commands.primary },
|
||||
source.player.displayName ?? source.player.profile.name,
|
||||
{ text: `${args.join(' ')}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
eachBot.tellraw("@a", component)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = netmsg;
|
||||
@@ -12,6 +12,7 @@ class refillcore extends CommandContext {
|
||||
"refill the bots core",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
const between = require('../../util/between');
|
||||
|
||||
class rtp extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"rtp",
|
||||
[
|
||||
"randomtp",
|
||||
"tpr",
|
||||
"tprandom"
|
||||
],
|
||||
"teleport to a random place. This was ported from FNFBoyfriendBot v4.x",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
const config = context.config;
|
||||
const translations = bot.translations;
|
||||
const x = between(-1_000_000, 1_000_000);
|
||||
const y = 100;
|
||||
const z = between(-1_000_000, 1_000_000);
|
||||
let component = [];
|
||||
|
||||
bot.core.run(`essentials:tp ${source.player.uuid} ${x} ${y} ${z}`)
|
||||
|
||||
component.push({
|
||||
translate: "fnfboyfriendbot.command.rtp",
|
||||
fallback: translations["fnfboyfriendbot.command.rtp"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${source.player.profile.name}`, color: config.colors.commands.secondary },
|
||||
{ text: `${x}`, color: config.colors.integer },
|
||||
{ text: `${y}`, color: config.colors.integer },
|
||||
{ text: `${z}`, color: config.colors.integer }
|
||||
]
|
||||
})
|
||||
|
||||
bot.tellraw('@a', component)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = rtp
|
||||
@@ -9,9 +9,7 @@ class test extends CommandContext {
|
||||
"testing stuff",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
[
|
||||
|
||||
]
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@@ -20,7 +18,7 @@ class test extends CommandContext {
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
|
||||
|
||||
bot.chat.message('meow')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
const { request } = require('undici');
|
||||
|
||||
class urban extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"urban",
|
||||
[
|
||||
"urbandictionary"
|
||||
],
|
||||
"look up definitions on urban dictionary",
|
||||
trustLevel.public,
|
||||
["<definition>"],
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const translations = bot.translations;
|
||||
let term = args.join(' ');
|
||||
|
||||
try {
|
||||
const prefix = {
|
||||
translate: "[%s] ",
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.urban.text",
|
||||
fallback: translations["fnfboyfriendbot.command.urban.text"],
|
||||
color: "#B72A00"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const query = new URLSearchParams({ term });
|
||||
const dictResult = await request(`https://api.urbandictionary.com/v0/define?${query}`);
|
||||
const { list } = await dictResult.body.json();
|
||||
let component = [];
|
||||
|
||||
for (const definitions of list) {
|
||||
component.push(prefix, [
|
||||
{
|
||||
text: `${definitions.definition.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray',
|
||||
underlined: false,
|
||||
italic: false,
|
||||
translate: ""
|
||||
}
|
||||
])
|
||||
}
|
||||
source.sendFeedback(component)
|
||||
} catch (e) {
|
||||
bot.console.error(e.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = urban;
|
||||
|
||||
/*
|
||||
const prefix = [
|
||||
{ text: '[', color: 'dark_gray' },
|
||||
{ text: 'Urban', color: '#B72A00' },
|
||||
{ text: '] ', color: 'dark_gray'}
|
||||
]
|
||||
let component = [];
|
||||
let term = `${args.join(' ')}`
|
||||
const query = new URLSearchParams({ term });
|
||||
const dictResult = await request(`https://api.urbandictionary.com/v0/define?${query}`);
|
||||
const { list } = await dictResult.body.json();
|
||||
|
||||
if (bot.options.mode === "savageFriends") {
|
||||
bot.chat.message('this command is disabled for this server for right now sorry!');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!list.length) {
|
||||
bot.tellraw("@a", { text: "No results found", color: "dark_red" });
|
||||
}
|
||||
|
||||
|
||||
for (definitions of list) {
|
||||
component.push(prefix, [
|
||||
{
|
||||
text: `${definitions.definition.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray',
|
||||
underlined: false,
|
||||
italic: false,
|
||||
translate: "",
|
||||
hover_event: {
|
||||
action:"show_text",
|
||||
value: [
|
||||
{
|
||||
text: `Example \u203a \n ${definitions.example.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray'
|
||||
},
|
||||
{
|
||||
text: `Word \u203a ${definitions.word.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray',
|
||||
},
|
||||
{
|
||||
text: `Author \u203a ${definitions.author.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray'
|
||||
},
|
||||
{
|
||||
text: `written on \u203a ${definitions.written_on.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray'
|
||||
},
|
||||
{
|
||||
text: `Rating \u203a Thumbs-Up ${definitions.thumbs_up} / Thumbs-Down ${definitions.thumbs_down}`,
|
||||
color: 'gray'
|
||||
}
|
||||
]
|
||||
},
|
||||
click_event: {
|
||||
action: 'open_url',
|
||||
value: `${definitions.permalink}`
|
||||
}
|
||||
},
|
||||
])
|
||||
*/
|
||||
@@ -10,6 +10,7 @@ class weather extends CommandContext {
|
||||
"check the weather in locations",
|
||||
trustLevel.public,
|
||||
["<weather/zip code>"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
async execute(context) {
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
const wikipedia = require('wikipedia');
|
||||
|
||||
class wiki extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"wiki",
|
||||
[
|
||||
"wikipedia"
|
||||
],
|
||||
"look up articles on wikipedia",
|
||||
trustLevel.public,
|
||||
["<article>"],
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
async execute(context) {
|
||||
const source = context.source;
|
||||
const args = context.arguments;
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const translations = bot.translations;
|
||||
let component = [];
|
||||
try {
|
||||
const page = await wikipedia.page(args.join(' '));
|
||||
const summary = await page.intro();
|
||||
component.push({ text: summary, color: config.colors.commands.primary })
|
||||
|
||||
source.sendFeedback(component)
|
||||
} catch (e) {
|
||||
if (e.toString().startsWith('pageError: pageError: No page with given title exists :')) {
|
||||
source.sendFeedback({
|
||||
translate: "fnfboyfriendbot.command.wiki.article_not_found",
|
||||
fallback: translations["fnfboyfriendbot.command.wiki.article_not_found"],
|
||||
color: "red"
|
||||
})
|
||||
} else {
|
||||
source.sendFeedback(e.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = wiki;
|
||||
@@ -18,6 +18,7 @@ class cloop extends CommandContext {
|
||||
"list",
|
||||
"clear"
|
||||
],
|
||||
false
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
|
||||
@@ -9,6 +9,7 @@ class reconnect extends CommandContext {
|
||||
"reconnect the bot",
|
||||
trustLevel.trusted,
|
||||
[""],
|
||||
false
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
|
||||
@@ -9,6 +9,7 @@ class validate extends CommandContext {
|
||||
"validate through the bot",
|
||||
trustLevel.trusted,
|
||||
[""],
|
||||
false,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
|
||||
+2
-4
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"buildstring": {
|
||||
"build": "3000",
|
||||
"build": "3350",
|
||||
"codename": "§4Reignite",
|
||||
"version": "v8.0.0-alpha",
|
||||
"url": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot.git",
|
||||
"branch": "dev"
|
||||
"version": "v8.0.0-beta"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"fnfboyfriendbot.command.help.trust_level.admin": "Admin",
|
||||
"fnfboyfriendbot.command.help.trust_level.owner": "Owner",
|
||||
|
||||
"fnfboyfriendbot.command.info.about": "FNFBoyfriendBot is a kaboom bot created by Parker2991\nThe source code and changelog can be found here %s",
|
||||
"fnfboyfriendbot.command.info.about": "FNFBoyfriendBot is a kaboom bot created by Parker2991",
|
||||
|
||||
"fnfboyfriendbot.command.info.config.discord.channel": "Discord Channel%s %s",
|
||||
"fnfboyfriendbot.command.info.config.discord.username": "Discord Username%s %s",
|
||||
@@ -85,9 +85,14 @@
|
||||
"fnfboyfriendbot.command.mcserver.server.unknown": "could not ping %s:%s",
|
||||
"fnfboyfriendbot.command.mcserver.server.version": "Server Version: %s",
|
||||
|
||||
"fnfboyfriendbot.command.rtp": "Telported %s to X%s %s Y%s %s Z%s%s",
|
||||
"fnfboyfriendbot.command.rps.draw": "You chose %s and the bot chose %s so its a draw",
|
||||
"fnfboyfriendbot.command.rps.lose": "You lose! You chose %s and the bot chose %s",
|
||||
"fnfboyfriendbot.command.rps.win": "You win! You chose %s and the bot chose %s",
|
||||
"fnfboyfriendbot.command.rps.invalid_choice": "%s is not a valid option please pick rock paper or scissors",
|
||||
|
||||
"fnfboyfriendbot.command.urban.definition_not_found": "Urban Definition not found!",
|
||||
"fnfboyfriendbot.command.rtp": "Telporting Player %s to X: %s, Y: %s, Z: %s",
|
||||
"fnfboyfriendbot.command.urban.definition_not_found": "%s Definition not found!",
|
||||
"fnfboyfriendbot.command.urban.text": "Urban",
|
||||
|
||||
"fnfboyfriendbot.command.validate.owner": "Validated as Owner",
|
||||
"fnfboyfriendbot.command.validate.admin": "Validated as Admin",
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
const crypto = require('crypto');
|
||||
|
||||
class directMessages {
|
||||
constructor (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const discordClient = context.discordClient;
|
||||
|
||||
discordClient.on("messageCreate", async (message) => {
|
||||
if (message.guildId !== null) return;
|
||||
else {
|
||||
const server = discordClient.guilds.cache.get(`${config.discord.serverID}`)
|
||||
const member = await server.members.fetch(message.author.id);
|
||||
const roles = member.roles.cache;
|
||||
let trustLevel = 0;
|
||||
let hash;
|
||||
const hasRole = roles.some((role) => {
|
||||
if (role.name === `${config.discord.roles.trusted}`) trustLevel = 1;
|
||||
else if (role.name === `${config.discord.roles.admin}`) trustLevel = 2;
|
||||
else if (role.name === `${config.discord.roles.owner}`) trustLevel = 3;
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = directMessages;
|
||||
+2
-51
@@ -4,9 +4,9 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
const loadModules = require("./util/loadModules");
|
||||
const { Client, GatewayIntentBits, Partials } = require("discord.js");
|
||||
const fixansi = require("./util/ansi");
|
||||
const { MessageContent, GuildMessages, Guilds, DirectMessages } =
|
||||
GatewayIntentBits;
|
||||
|
||||
const discordClient = new Client({
|
||||
intents: [
|
||||
Guilds,
|
||||
@@ -16,7 +16,6 @@ const discordClient = new Client({
|
||||
],
|
||||
partials: [Partials.Channel],
|
||||
});
|
||||
const CommandSource = require("./commandUtil/CommandSource");
|
||||
|
||||
console.log("Starting FNFBoyfriendBot");
|
||||
|
||||
@@ -45,56 +44,8 @@ for (const botOptions of config.bots) {
|
||||
options = botOptions;
|
||||
bot = new createBot(options, config);
|
||||
bot.translations = require('./data/translations.json')
|
||||
|
||||
bots.push(bot);
|
||||
bot.bots = bots;
|
||||
loadModules(bot, options, config, discordClient);
|
||||
bot.console.readlineInterface(rl);
|
||||
}
|
||||
|
||||
const discord = [
|
||||
require('./discord/directMessages.js'),
|
||||
]
|
||||
|
||||
for (const file of discord) new file({ bot, config, discordClient })
|
||||
|
||||
/*discordClient.on("messageCreate", (message) => {
|
||||
try {
|
||||
if (message.author.id === bot.discord.client.user.id) return;
|
||||
|
||||
const ChatMessage = require("prismarine-chat")("1.20.2");
|
||||
bot.getMessageAsPrismarine = (message) => {
|
||||
return new ChatMessage(message);
|
||||
};
|
||||
|
||||
config.prefixes.map((prefix) => {
|
||||
if (message.content.startsWith(prefix)) {
|
||||
const source = new CommandSource(
|
||||
{
|
||||
profile: {
|
||||
name: `${message?.member.nickname || message?.author.displayName}`,
|
||||
},
|
||||
},
|
||||
{
|
||||
discord: true,
|
||||
console: false,
|
||||
},
|
||||
false,
|
||||
message,
|
||||
);
|
||||
|
||||
source.sendFeedback = input => {
|
||||
message?.reply(`\`\`\`ansi\n${fixansi(bot.getMessageAsPrismarine(input)?.toAnsi()?.replaceAll('`', '`\u200b').substring(0, 1780))}\`\`\``);
|
||||
}
|
||||
bot.commandManager.executeString(
|
||||
source,
|
||||
message.content.substring(prefix.length),
|
||||
);
|
||||
return;
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
+7
-9
@@ -92,17 +92,15 @@ class chat {
|
||||
bot.on("packet.system_chat", (packet) => {
|
||||
const message = convertNbtComponentToJson(null, packet.content);
|
||||
if (
|
||||
message.translate === "advMode.setCommand.success" &&
|
||||
config?.debug?.commandSetMessage === false
|
||||
message.translate === "advMode.setCommand.success"
|
||||
||
|
||||
message.translate === "multiplayer.message_not_delivered"
|
||||
||
|
||||
packet.isActionBar
|
||||
||
|
||||
message.translate === "advMode.notAllowed"
|
||||
)
|
||||
return;
|
||||
if (message.translate === "multiplayer.message_not_delivered") return;
|
||||
|
||||
if (packet.isActionBar) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.translate === "advMode.notAllowed") return;
|
||||
|
||||
bot.emit("message", {
|
||||
type: "minecraft:system_chat",
|
||||
|
||||
@@ -44,7 +44,7 @@ class commandHandler {
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
bot.console.error(e.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class commandManager {
|
||||
color: "red"
|
||||
})
|
||||
if (
|
||||
command?.data.playerChat
|
||||
command?.data.playerChatOnly
|
||||
&&
|
||||
source.ChatType !== "minecraft:player_chat"
|
||||
&&
|
||||
@@ -152,7 +152,7 @@ class commandManager {
|
||||
bot.commandManager.commandlist.push(commands);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to load command ", filename, ":", error);
|
||||
console.error("Failed to load command", filename, ":", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ class Console {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const options = context.options;
|
||||
|
||||
let ratelimit = 0;
|
||||
|
||||
let serverName;
|
||||
@@ -94,7 +95,7 @@ class Console {
|
||||
);
|
||||
},
|
||||
command(message) {
|
||||
console.log(
|
||||
this.refreshLine(
|
||||
prismarineChat
|
||||
.fromNotch(
|
||||
`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO" })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })} §6command§8] §8[${serverName}§8] `,
|
||||
|
||||
+1
-12
@@ -180,18 +180,7 @@ class discord {
|
||||
} else if (message?.reference?.type === 1) {
|
||||
// this is for messages that are forwarded
|
||||
} else {
|
||||
if (options.mode === "creayun") {
|
||||
bot.chat.message(
|
||||
bot
|
||||
.getMessageAsPrismarine(
|
||||
`&7[&9FNF&3Boyfriend&1Bot Discord&7] ${message?.member?.displayName} \u203a ${message?.content}`,
|
||||
)
|
||||
?.toMotd()
|
||||
.replaceAll("§", "&"),
|
||||
);
|
||||
} else {
|
||||
bot.tellraw("@a", [tag, message.content]);
|
||||
}
|
||||
bot.tellraw("@a", [tag, message.content]);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
const sleep = require('../util/sleep');
|
||||
const decryption = require('../SkiBot/decryption')
|
||||
const CommandSource = require('../commandUtil/CommandSource')
|
||||
|
||||
class ownerAuth {
|
||||
constructor (context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const options = context.options;
|
||||
const prefixes = config.prefixes;
|
||||
|
||||
if (bot.options.mode !== "kaboom") return
|
||||
bot.SkiBotAuthed = false
|
||||
let timer
|
||||
bot.on('packet.login', async () => {
|
||||
const buf = Buffer.from(config.skibot.channel, "utf8")
|
||||
buf[buf.length - 1] |= 0x80;
|
||||
bot._client.write("custom_payload", {
|
||||
channel: "extras:register",
|
||||
data: buf,
|
||||
})
|
||||
|
||||
if (!config.skibot.enabled) return;
|
||||
timer = setInterval(() => {
|
||||
if (
|
||||
bot.players.find((player) => player.profile.name === config.skibot.player)?.profile?.name === config.skibot.player
|
||||
&&
|
||||
!bot.SkiBotAuthed
|
||||
) {
|
||||
kick(config.skibot.player)
|
||||
}
|
||||
}, 3000)
|
||||
})
|
||||
|
||||
bot.on('player_left', (data) => {
|
||||
if (data.profile.name === config.skibot.player) bot.SkiBotAuthed = false
|
||||
})
|
||||
|
||||
bot.on('end', () => {
|
||||
if (config.skibot.enabled) clearInterval(timer)
|
||||
})
|
||||
bot.on('packet.custom_payload', (data) => {
|
||||
try {
|
||||
if (data.channel === "extras:message") {
|
||||
const decoded = data.data.toString('ascii')
|
||||
if (decoded.startsWith(config.skibot.channel)) {
|
||||
const string = decoded.substring(36)
|
||||
const decrypted = decryption.decrypt({ config, encrypted: string })
|
||||
const parsed = JSON.parse(decrypted)
|
||||
const player = parsed.player;
|
||||
const uuid = parsed.uuid;
|
||||
const hash = parsed.hash;
|
||||
const args = parsed.args;
|
||||
if (
|
||||
bot.players.find((player) => player.profile.name === config.skibot.player).profile.name === config.skibot.player
|
||||
&&
|
||||
hash === bot.validation.owner
|
||||
&&
|
||||
!bot.SkiBotAuthed
|
||||
) bot.SkiBotAuthed = true
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
bot.console.error(e.stack)
|
||||
}
|
||||
})
|
||||
|
||||
function kick (player) {
|
||||
bot.core.run(`minecraft:deop @a[name="${player}"]`)
|
||||
bot.core.run(`minecraft:gamemode adventure @a[name="${player}"]`)
|
||||
bot.core.run(`essentials:mute ${player} 10y not authed`)
|
||||
bot.exploits.kicks.burger(`@a[name="${player}"]`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ownerAuth
|
||||
@@ -38,8 +38,6 @@ class playerList {
|
||||
player.vanished = true;
|
||||
} else {
|
||||
bot.players = bot.players.filter((_) => _.uuid != player.uuid);
|
||||
if (player.vanished === true)
|
||||
bot.emit("player_left", player);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -74,12 +74,13 @@ class selfcare {
|
||||
if (bot.options.mode === "savageFriends") {
|
||||
if (bot.selfcare.register) bot.chat.command('register amogusissus amogusissus')
|
||||
else if (bot.selfcare.login) bot.chat.command('login amogusissus')
|
||||
if (!bot.selfcare.login) return
|
||||
else if (bot.selfcare.permissionLevel < 2)
|
||||
bot.chat.command(`minecraft:op ${bot._client.username}`);
|
||||
else if (bot.selfcare.gameMode !== 1)
|
||||
bot._client.write('change_gamemode', { mode: 1 })
|
||||
} else if (bot.options.mode === "kaboom") {
|
||||
if (!bot.selfcare.prefix)
|
||||
if (!bot.selfcare.prefix)
|
||||
bot.chat.command(
|
||||
`extras:prefix &8[&bPrefix&8: &3${config.prefixes[0]}&8]`,
|
||||
);
|
||||
|
||||
@@ -6,6 +6,7 @@ class username {
|
||||
|
||||
bot.on('player_info', (data) => {
|
||||
if (data.uuid === bot.uuid) {
|
||||
console.log(data)
|
||||
if (data.player.name !== bot.username) bot.selfcare.username = true;
|
||||
else bot.selfcare.username = false
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
function between(min, max) {
|
||||
return Math.floor(Math.random() * (max - min) + min);
|
||||
}
|
||||
module.exports = Between;
|
||||
module.exports = between;
|
||||
// ported from FNFBoyfriendBot v3
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
const { request, statusCode, Headers, trailers, body } = require('undici');
|
||||
|
||||
async function websiteRequesting (url) {
|
||||
const url = await request(String(url))
|
||||
console.log(url)
|
||||
}
|
||||
|
||||
module.exports = websiteRequesting;
|
||||
/*
|
||||
import { request } from 'undici'
|
||||
|
||||
const {
|
||||
statusCode,
|
||||
headers,
|
||||
trailers,
|
||||
body
|
||||
} = await request('http://localhost:3000/foo')
|
||||
|
||||
console.log('response received', statusCode)
|
||||
console.log('headers', headers)
|
||||
|
||||
for await (const data of body) { console.log('data', data) }
|
||||
|
||||
console.log('trailers', trailers)
|
||||
|
||||
*/
|
||||
|
||||
/*const https = require('https');
|
||||
const http = require('http');
|
||||
|
||||
function websiteRequesting (url) {
|
||||
if (url.startsWith('http://')) {
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
https.request(url, '', (res) => {
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = websiteRequesting;*/
|
||||
Reference in New Issue
Block a user