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

View file

@ -1,5 +1,6 @@
prefixes:
- "!"
- "m~"
- "m|"
discord:
token: "discord token here"
@ -8,10 +9,10 @@ discord:
roles:
trusted: "trusted"
admin: "admin"
owner: "FNFBoyfriendBot Owner"
owner: "FNFGirlfriendBot Owner"
core:
name: {"translate":"outOfMemory.message"}
name: {"text": "FNFGirlfriendBot Core", "color": "red"}
area:
start:
x: 0
@ -46,17 +47,103 @@ console:
filelogger: false
bots:
- host: "localhost"
username: "FNFBoyfriendBot"
- host: "play.kaboom.pw"
username: "FNFGirlfriendBot"
usernameGen: true
version: "1.20.2"
serverName: "localhost"
serverName: "kaboom"
private: false
reconnectDelay: 6000
channelId: "discord channel id here"
logging: false
logging: true
useChat: false
isKaboom: true
isSavage: 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 { MessageContent, GuildMessages, Guilds } = GatewayIntentBits;
const discordClient = new Client({ intents: [Guilds, GuildMessages, MessageContent] });
console.log('Starting FNFBoyfriendBot');
console.log('Starting FNFGirlfriendBot');
checks();
try {

View file

@ -1,10 +1,11 @@
const readline = require('readline');
function boot (bot, options, discordClient, config) {
bot.on("packet.login", (data) => {
if (bot.options.isCreayun) return
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 {
bot.chat.message('&9FNF&3Boyfriend&1Bot &fcreated by &4Parker&02991');
bot.chat.message('&4FNF&cGirlfriend&4Bot &fstarted');
}
}) // &9 &3 &1
}