Compare commits

...

4 commits
main ... main

4 changed files with 208 additions and 122 deletions

View file

@ -1,27 +1,26 @@
const CommandError = require('../../util/command_error'); const CommandError = require('../util/command_error');
const sleep = require('../../util/sleep.js'); const sleep = require('../util/sleep.js');
const fixansi = require('../../util/ansi'); const fixansi = require('../util/ansi');
const { EmbedBuilder } = require('discord.js'); const { EmbedBuilder } = require('discord.js');
module.exports = { module.exports = {
data: { name: 'help',
name: 'help', trustLevel: 0,
trustLevel: 0, aliases: [
aliases: [ "heko",
"heko", "?",
"?", "cmds",
"cmds", "hell",
"hell", "hello",
"hello", "helo",
"helo", "commands",
"commands", "commandshelp",
"commandshelp",
], ],
description: 'a list of the bots commands', description: 'a list of the bots commands',
usages: [ usages: [
"", "",
"<command>", "<command>",
], ],
},
execute (context) { execute (context) {
const commandList = []; const commandList = [];
const bot = context.bot; const bot = context.bot;
@ -32,13 +31,13 @@ module.exports = {
bold: false, bold: false,
color: 'gray', color: 'gray',
with: [ with: [
{ color: "aqua", text: 'Public'}, { color: "#f5c9ce", text: 'Public'},
{ color: "gray", text: ' | '}, { color: "gray", text: ' | '},
{ color: "dark_aqua", text: 'Trusted'}, { color: "#e25c6c", text: 'Trusted'},
{ color: 'gray', text: ' | '}, { color: 'gray', text: ' | '},
{ color: "blue", text: "Admin" }, { color: "#a31d2c", text: "Admin" },
{ color: "gray", text: " | " }, { color: "gray", text: " | " },
{ color: "dark_blue", text: 'Owner'}, { color: "#360a0f", text: 'Owner'},
] ]
} }
let public = []; let public = [];
@ -48,41 +47,41 @@ module.exports = {
for (const command of bot.commandManager.commandlist) { for (const command of bot.commandManager.commandlist) {
let usagesComponent = []; let usagesComponent = [];
let commandComponent = []; let commandComponent = [];
for (const usages of command.data.usages) { for (const usages of command.usages) {
if (command?.data?.trustLevel === 1) { if (command?.trustLevel === 1) {
usagesComponent.push({ usagesComponent.push({
translate: "%s%s %s", translate: "%s%s %s",
with: [ with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" }, { text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.data.name} <trusted/admin/owner hashes>`, color: "blue" }, { text: `${command.name} <trusted/admin/owner hashes>`, color: "blue" },
{ text: `${usages}`, color: "aqua" }, { text: `${usages}`, color: "aqua" },
] ]
}) })
} else if (command?.data.trustLevel === 2) { } else if (command?.trustLevel === 2) {
usagesComponent.push({ usagesComponent.push({
translate: "%s%s %s", translate: "%s%s %s",
with: [ with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" }, { text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.data.name} <admin/owner hashes>`, color: "blue" }, { text: `${command.name} <admin/owner hashes>`, color: "blue" },
{ text: `${usages}`, color: "aqua" }, { text: `${usages}`, color: "aqua" },
] ]
}) })
} else if (command?.data.trustLevel === 3) { } else if (command?.trustLevel === 3) {
usagesComponent.push({ usagesComponent.push({
translate: "%s%s %s", translate: "%s%s %s",
with: [ with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" }, { text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.data.name} <owner hash>`, color: "blue" }, { text: `${command.name} <owner hash>`, color: "blue" },
{ text: `${usages}`, color: "aqua" }, { text: `${usages}`, color: "aqua" },
] ]
}) })
} else if (command?.data.trustLevel === 0 || command.data.trustLevel === 4) { } else if (command?.trustLevel === 0 || command.trustLevel === 4) {
usagesComponent.push({ usagesComponent.push({
translate: "%s%s %s", translate: "%s%s %s",
with: [ with: [
{ text: `${config.prefixes[0]}`, color: "dark_blue" }, { text: `${config.prefixes[0]}`, color: "dark_blue" },
{ text: `${command.data.name}`, color: "blue" }, { text: `${command.name}`, color: "blue" },
{ text: `${usages}`, color: "aqua" }, { text: `${usages.toString().replaceAll(',','')}`, color: "aqua" },
] ]
}) })
} }
@ -95,16 +94,16 @@ module.exports = {
with: [ with: [
{ text: "Command Name", color: "dark_blue" }, { text: "Command Name", color: "dark_blue" },
{ text: "\u203a" }, { text: "\u203a" },
{ text: `${command.data.name}`, color: "blue" }, { text: `${command.name}`, color: "blue" },
{ text: "Aliases", color: "dark_blue" }, { text: "Aliases", color: "dark_blue" },
{ text: "\u203a" }, { text: "\u203a" },
{ text: `${command.data.aliases.toString().replaceAll(',',' ')}`, color: "blue" }, { text: `${command.aliases.toString().replaceAll(',',' ')}`, color: "blue" },
{ text: "Description", color: "dark_blue" }, { text: "Description", color: "dark_blue" },
{ text: "\u203a" }, { text: "\u203a" },
{ text: `${command.data.description}`, color: "blue" }, { text: `${command.description}`, color: "blue" },
{ text: "Trust Level", color: "dark_blue" }, { text: "Trust Level", color: "dark_blue" },
{ text: "\u203a" }, { text: "\u203a" },
{ text: `${command.data.trustLevel}`, color: "gold" }, { text: `${command.trustLevel}`, color: "gold" },
{ text: "Usages", color: "dark_blue" }, { text: "Usages", color: "dark_blue" },
{ text: "\u203a" } { text: "\u203a" }
] ]
@ -112,7 +111,7 @@ module.exports = {
commandComponent.push("\n"); commandComponent.push("\n");
commandComponent.push(usagesComponent); commandComponent.push(usagesComponent);
// for (const aliases of command.aliases) { // for (const aliases of command.aliases) {
if (args[0]?.toLowerCase() === command.data.name) { if (args[0]?.toLowerCase() === command.name) {
if (bot.options.isSavage) { if (bot.options.isSavage) {
bot.chat.message(`${bot.getMessageAsPrismarine(commandComponent)?.toMotd().replaceAll('§','&')}`); bot.chat.message(`${bot.getMessageAsPrismarine(commandComponent)?.toMotd().replaceAll('§','&')}`);
} else { } else {
@ -130,174 +129,173 @@ module.exports = {
} }
console.log(aliases)*/ console.log(aliases)*/
// } // }
// tellraw @p {"text":"this","clickEvent":{"action":"suggest_command","value":"this"}} if (command.trustLevel === 0) {
if (command.data.trustLevel === 0) {
public.push([ public.push([
{ {
text: command.data.name + ' ', text: command.name + ' ',
color: "aqua", color: "#f5c9ce",
translate: "", translate: "",
hoverEvent: { hoverEvent: {
action: "show_text", action: "show_text",
value: [ value: [
{ {
text: `Command: ${command.data.name}\n`, text: `Command:${command.name}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: `Trust Level: `, text: `Trust Level: `,
color: 'blue' color: 'gray'
}, },
{ {
text: `${command.data.trustLevel}\n`, text: `${command.trustLevel}\n`,
color: 'gold' color: 'gold'
}, },
{ {
text: `${command.data.description}\n`, text: `${command.description}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: `Command Aliases: ${command.data.aliases}\n`, text: `Command Aliases: ${command.aliases}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: 'click on me to use me :)', text: 'click on me to use me :)',
color: 'dark_blue', color: 'gray',
}, },
], ],
}, },
clickEvent: { clickEvent: {
action: 'suggest_command', action: 'run_command',
value: `${config.prefixes[0]}${command?.data.name}` value: `${config.prefixes[0]}${command?.name}`
} }
} }
]) ])
} else if (command.data.trustLevel === 1) { } else if (command.trustLevel === 1) {
trusted.push([ trusted.push([
{ {
text: command.data.name + ' ', text: command.name + ' ',
color: "dark_aqua", color: "#e25c6c",
translate: "", translate: "",
hoverEvent: { hoverEvent: {
action: "show_text", action: "show_text",
value: [ value: [
{ {
text: `Command: ${command.data.name}\n`, text: `Command:${command.name}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: `Trust Level: `, text: `Trust Level: `,
color: 'blue' color: 'gray'
}, },
{ {
text: `${command.data.trustLevel}\n`, text: `${command.trustLevel}\n`,
color: 'gold' color: 'gold'
}, },
{ {
text: `${command.data.description}\n`, text: `${command.description}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: `Command Aliases: ${command.data.aliases}\n`, text: `Command Aliases: ${command.aliases}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: 'click on me to use me :)', text: 'click on me to use me :)',
color: 'dark_blue', color: 'gray',
}, },
], ],
}, },
clickEvent: { clickEvent: {
action: 'suggest_command', action: 'run_command',
value: `${config.prefixes[0]}${command?.data.name}` value: `${config.prefixes[0]}${command?.name}`
} }
} }
]) ])
} else if (command.data.trustLevel === 2) { } else if (command.trustLevel === 2) {
admin.push([ admin.push([
{ {
text: command.data.name + ' ', text: command.name + ' ',
color: "blue", color: "#a31d2c",
translate: "", translate: "",
hoverEvent: { hoverEvent: {
action:"show_text", action:"show_text",
value: [ value: [
{ {
text: `Command: ${command.data.name}\n`, text: `Command:${command.name}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: `Trust Level: `, text: `Trust Level: `,
color: 'blue' color: 'gray'
}, },
{ {
text: `${command.data.trustLevel}\n`, text: `${command.trustLevel}\n`,
color: 'gold' color: 'gold'
}, },
{ {
text: `${command.data.description}\n`, text: `${command.description}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: `Command Aliases: ${command.data.aliases}\n`, text: `Command Aliases: ${command.aliases}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: 'click on me to use me :)', text: 'click on me to use me :)',
color: 'dark_blue', color: 'gray',
}, },
], ],
}, },
clickEvent: { clickEvent: {
action: 'suggest_command', action: 'run_command',
value: `${config.prefixes[0]}${command?.data.name}` value: `${config.prefixes[0]}${command?.name}`
} }
} }
]) ])
} else if (command.data.trustLevel === 3) { } else if (command.trustLevel === 3) {
owner.push([ owner.push([
{ {
text: command.data.name + ' ', text: command.name + ' ',
color: "dark_blue", color: "#360a0f",
translate: "", translate: "",
hoverEvent: { hoverEvent: {
action: "show_text", action: "show_text",
value: [ value: [
{ {
text: `Command: ${command.data.name}\n`, text: `Command:${command.name}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: `Trust Level: `, text: `Trust Level: `,
color: 'blue' color: 'gray'
}, },
{ {
text: `${command.data.trustLevel}\n`, text: `${command.trustLevel}\n`,
color: 'gold' color: 'gold'
}, },
{ {
text: `${command.data.description}\n`, text: `${command.description}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: `Command Aliases: ${command.data.aliases}\n`, text: `Command Aliases: ${command.aliases}\n`,
color: 'blue' color: 'gray'
}, },
{ {
text: 'click on me to use me :)', text: 'click on me to use me :)',
color: 'dark_blue', color: 'gray',
}, },
], ],
}, },
clickEvent: { clickEvent: {
action: 'suggest_command', action: 'run_command',
value: `${config.prefixes[0]}${command?.data.name}` value: `${config.prefixes[0]}${command?.name}`
} }
} }
]) ])
} }
} }
const length = bot.commandManager.commandlist.filter(c => c.data.trustLevel != 4).length const length = bot.commandManager.commandlist.filter(c => c.trustLevel != 4).length
if (bot.options.useChat) { if (bot.options.useChat) {
bot.chat.message(bot.getMessageAsPrismarine([ bot.chat.message(bot.getMessageAsPrismarine([
{ {
@ -401,52 +399,52 @@ module.exports = {
let admin = []; let admin = [];
let owner = []; let owner = [];
for (const command of bot.commandManager.commandlist) { for (const command of bot.commandManager.commandlist) {
if (args[0] === command.data.name) { if (args[0] === command.name) {
const ansi = bot.getMessageAsPrismarine([ { text: `CommandName \u203a ${command.data.name}\n`, color: 'gray', }, { text: `Aliases \u203a ${command.data.aliases}\n`, color: 'gray', }, { text: `Description \u203a ${command.data.description}\n`, color: 'gray', }, { text: `trustLevel \u203a ${command.data.trustLevel}\n`, color: 'gray' }, { text: `Usages \u203a ${command?.data.usages}`, color: "dark_gray" }, ])?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```') const ansi = bot.getMessageAsPrismarine([ { text: `CommandName \u203a ${command.name}\n`, color: 'gray', }, { text: `Aliases \u203a ${command.aliases}\n`, color: 'gray', }, { text: `Description \u203a ${command.description}\n`, color: 'gray', }, { text: `trustLevel \u203a ${command.trustLevel}\n`, color: 'gray' }, { text: `Usages \u203a ${command?.usages}`, color: "dark_gray" }, ])?.toAnsi().replaceAll('```\u001b[9```' + '```\u001b[3```')
const fix = fixansi(ansi.replaceAll('`', '`\u200b')) const fix = fixansi(ansi.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`) .setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.data.name} Command`) .setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``) .setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] }) bot.discord.message.reply({ embeds: [Embed] })
return return
} }
if (command?.data.trustLevel === 0 && command.discordExecute) { if (command?.trustLevel === 0 && command.discordExecute) {
public.push([ public.push([
{ {
text: command.data.name + ' ', text: command.name + ' ',
color: "aqua", color: "aqua",
} }
]) ])
} else if (command?.data.trustLevel === 1 && command.discordExecute) { } else if (command?.trustLevel === 1 && command.discordExecute) {
trusted.push([ trusted.push([
{ {
text: command.data.name + ' ', text: command.name + ' ',
color: "dark_aqua" color: "dark_aqua"
} }
]) ])
} else if (command?.data.trustLevel === 2 && command.discordExecute) { } else if (command?.trustLevel === 2 && command.discordExecute) {
admin.push([ admin.push([
{ {
text: command.data.name + ' ', text: command.name + ' ',
color: 'blue' color: 'blue'
} }
]) ])
} else if (command?.data.trustLevel === 3 && command.discordExecute) { } else if (command?.trustLevel === 3 && command.discordExecute) {
owner.push([ owner.push([
{ {
text: command.data.name + ' ', text: command.name + ' ',
color: "dark_blue", color: "dark_blue",
} }
]) ])
} }
} }
const length = bot.commandManager.commandlist.filter(c => c.data.trustLevel !== 4 && c.discordExecute).length const length = bot.commandManager.commandlist.filter(c => c.trustLevel !== 3 && c.discordExecute).length
const ansi1 = bot.getMessageAsPrismarine([ { text: 'Commands (', color: 'gray' }, { text: JSON.stringify(length), color: 'gold' }, { text: ') ', color: 'gray' }, category, '\n', public, trusted, owner ])?.toAnsi(); const ansi1 = bot.getMessageAsPrismarine([ { text: 'Commands (', color: 'gray' }, { text: JSON.stringify(length), color: 'gold' }, { text: ') ', color: 'gray' }, category, '\n', public, trusted, owner ])?.toAnsi();
const fix1 = fixansi(ansi1.replaceAll('`', '`\u200b')) const fix1 = fixansi(ansi1.replaceAll('`', '`\u200b'))
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`) .setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.data.name} Command`) .setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``) .setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] }) bot.discord.message.reply({ embeds: [Embed] })
bot?.discord?.message.react('♋') bot?.discord?.message.react('♋')

View file

@ -1,5 +1,6 @@
prefixes: prefixes:
- "!" - "m~"
- "m|"
discord: discord:
token: "discord token here" token: "discord token here"
@ -8,10 +9,10 @@ discord:
roles: roles:
trusted: "trusted" trusted: "trusted"
admin: "admin" admin: "admin"
owner: "FNFBoyfriendBot Owner" owner: "FNFGirlfriendBot Owner"
core: core:
name: {"translate":"outOfMemory.message"} name: {"text": "FNFGirlfriendBot Core", "color": "red"}
area: area:
start: start:
x: 0 x: 0
@ -46,17 +47,103 @@ console:
filelogger: false filelogger: false
bots: bots:
- host: "localhost" - host: "play.kaboom.pw"
username: "FNFBoyfriendBot" username: "FNFGirlfriendBot"
usernameGen: true usernameGen: true
version: "1.20.2" version: "1.20.2"
serverName: "localhost" serverName: "kaboom"
private: false private: false
reconnectDelay: 6000 reconnectDelay: 6000
channelId: "discord channel id here" channelId: "discord channel id here"
logging: false logging: true
useChat: false useChat: false
isKaboom: true isKaboom: true
isSavage: false isSavage: false
isCreayun: false isCreayun: false
- host: "chipmunk.land"
username: "FNFGirlfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "chipmunk"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: true
useChat: false
isKaboom: true
isSavage: false
isCreayun: false
- host: "168.100.225.224"
username: "FNFGirlfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "neko"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: true
useChat: false
isKaboom: true
isSavage: false
isCreayun: false
- host: "fatihboom.fr.to"
port: 20015
username: "FNFGirlfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "fatih"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: true
useChat: false
isKaboom: true
isSavage: false
isCreayun: false
- host: "chayapak.chipmunk.land"
username: "FNFGirlfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "chayapakboom"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: true
useChat: false
isKaboom: true
isSavage: false
isCreayun: false
- host: "qilk.de"
port: 25569
username: "FNFGirlfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "denisthekiddytoucherboom"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: true
useChat: false
isKaboom: true
isSavage: false
isCreayun: false
- host: "70.129.58.17"
port: 25565
username: "FNFGirlfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "minecraftplayerboom,"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: true
useChat: false
isKaboom: true
isSavage: false
isCreayun: false

View file

@ -8,7 +8,7 @@ const checks = require('./util/checks');
const { Client, GatewayIntentBits } = require('discord.js'); const { Client, GatewayIntentBits } = require('discord.js');
const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits; const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits;
const discordClient = new Client({ intents: [Guilds, GuildMessages, MessageContent] }); const discordClient = new Client({ intents: [Guilds, GuildMessages, MessageContent] });
console.log('Starting FNFBoyfriendBot'); console.log('Starting FNFGirlfriendBot');
checks(); checks();
try { try {

View file

@ -1,10 +1,11 @@
const readline = require('readline');
function boot (bot, options, discordClient, config) { function boot (bot, options, discordClient, config) {
bot.on("packet.login", (data) => { bot.on("packet.login", (data) => {
if (bot.options.isCreayun) return if (bot.options.isCreayun) return
if (new Date().getDay() === 5) { if (new Date().getDay() === 5) {
bot.chat.message('Gettin\' freaky on a friday night!'); bot.tellraw('@a', 'Left right left right beep bop beep bop thats how you do it up down up down aaa doo aaa doo thats how you do it left down up right beep baa doo uuu down down up down down right doo doo aaa doo doo uuu down up right up right doo aaa uuu aaa uuu uuu uuu ooo ooo aaa aaa aaa aaa aaaaaaaaaa');
} else { } else {
bot.chat.message('&9FNF&3Boyfriend&1Bot &fcreated by &4Parker&02991'); bot.chat.message('&4FNF&cGirlfriend&4Bot &fstarted');
} }
}) // &9 &3 &1 }) // &9 &3 &1
} }