v6.0.0 build: 950

This commit is contained in:
Parker2991 2024-09-07 21:13:24 -04:00
parent 5e08befb6b
commit 6eeb079ced
22 changed files with 1244 additions and 257 deletions

View file

@ -0,0 +1,65 @@
const bots = require('../data/changelog.json');
module.exports = {
name: 'changelog',
description: ['check the bots changelog'],
trustLevel: 0,
aliases: ['clv', 'changes'],
usage:[""],
execute (context) {
const query = context.arguments.join(' ').toLowerCase()
const bot = context.bot
if (query.length === 0) {
const list = []
for (const info of bots) {
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
list.push(info.name)
}
const category = {
translate: ' (%s%s%s%s%s%s%s%s%s) ',
bold: false,
color: 'gray',
with: [
{ color: 'aqua', text: 'Alpha Release' },
{ color: 'gray', text: ' | ' },
{ color: 'blue', text: 'Beta Release' },
{ color: 'gray', text: ' | ' },
{ color: 'green', text: 'Minor release' },
{ color: 'gray', text: ' | ' },
{ color: 'gold', text: 'Revision Release' },
{ color: 'gray', text: ' | ' },
{ color: 'dark_red', text: 'Major Release' }
]
}
bot.tellraw("@a", [{ text: 'Changelogs (', color: 'gray' }, { text: JSON.stringify(bots.length), color: 'gold' }, { text: ')', color: 'gray' }, category, ' - ', ...list])
return
}
for (const info of bots) {
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
}
},
sendBotInfo (info, bot) {
const component = ['']
component.push('', info.name)
if (info.exclaimer) component.push('\n', ' ', info.exclaimer)
if (info.authors && info.authors.length !== 0) {
component.push('\n', 'Codename ')
for (const author of info.authors) {
component.push(author, { text: ', ', color: 'gray' })
}
component.pop()
}
if (info.foundation) component.push('\n', 'Date: ', info.foundation)
if (info.prefixes && info.prefixes.length !== 0) {
component.push('\n', '')
for (const prefix of info.prefixes) {
component.push(prefix, { text: ' ', color: 'gray' })
}
component.pop()
}
bot.tellraw('@a', [component])
}
}

View file

@ -19,7 +19,7 @@ module.exports = {
} }
bot.tellraw("@a", bot.tellraw("@a",
["Known bots (", JSON.stringify(bots.length), ") - ", ...list], ["Known bots (", { text: JSON.stringify(bots.length), color: 'gold' }, { text: ") - ", color: 'gray' }, ...list],
false, false,
); );
return; return;

View file

@ -46,7 +46,6 @@ module.exports = {
let owner = []; let owner = [];
for (const command of bot.commandManager.commandlist) { for (const command of bot.commandManager.commandlist) {
if (args[0] === command.name) { if (args[0] === command.name) {
//for (const usageArray of command.usages) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [ bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ {
text: `CommandName \u203a ${command.name}\n`, text: `CommandName \u203a ${command.name}\n`,
@ -61,167 +60,187 @@ module.exports = {
color: 'gray', color: 'gray',
}, },
{ {
text: `trustLevel \u203a ${command.trustLevel}\n`, text: `trustLevel \u203a `,
//${command.trustLevel}\n`,
color: 'gray' color: 'gray'
}, },
{
text: `${command.trustLevel}\n`,
color: 'gold'
},
{ {
text: "Usages \u203a\n", text: "Usages \u203a\n",
color: "gray" color: "gray"
}, },
]); ]);
// }
for (const usageArray of command.usages) { for (const usageArray of command.usages) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `${config.prefixes[0]}${command.name} ${usageArray}`) bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: `${config.prefixes[0]}${command.name} ${usageArray}`, color: 'gray' })
} }
return return
} }
if (command.trustLevel === 0) { if (command.trustLevel === 0) {
public.push([ public.push([
{ {
text: command.name + ' ', text: command.name + ' ',
color: "aqua", color: "aqua",
translate: "", translate: "",
hoverEvent:{ hoverEvent: {
action:"show_text", action: "show_text",
value:[ value: [
{ {
text: `Command:${command.name}\n`, text: `Command:${command.name}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: `Trust Level: `, text: `Trust Level: `,
color: 'gray' color: 'gray'
}, },
{ {
text: `${command.trustLevel}\n`, text: `${command.trustLevel}\n`,
color: 'red' color: 'gold'
}, },
{ {
text: `${command.description}\n`, text: `${command.description}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: `Command Aliases: ${command.aliases}\n`, text: `Command Aliases: ${command.aliases}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: 'click on me to use me :)', text: 'click on me to use me :)',
color: 'gray', color: 'gray',
}, },
], ],
} },
} clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
]) ])
} else if (command.trustLevel === 1) { } else if (command.trustLevel === 1) {
trusted.push([ trusted.push([
{ {
text: command.name + ' ', text: command.name + ' ',
color: "dark_aqua", color: "dark_aqua",
translate: "", translate: "",
hoverEvent:{ hoverEvent: {
action:"show_text", action: "show_text",
value:[ value: [
{ {
text: `Command:${command.name}\n`, text: `Command:${command.name}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: `Trust Level: `, text: `Trust Level: `,
color: 'gray' color: 'gray'
}, },
{ {
text: `${command.trustLevel}\n`, text: `${command.trustLevel}\n`,
color: 'red' color: 'gold'
}, },
{ {
text: `${command.description}\n`, text: `${command.description}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: `Command Aliases: ${command.aliases}\n`, text: `Command Aliases: ${command.aliases}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: 'click on me to use me :)', text: 'click on me to use me :)',
color: 'gray', color: 'gray',
}, },
], ],
} },
} clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
]) ])
} else if (command.trustLevel === 2) { } else if (command.trustLevel === 2) {
admin.push([ admin.push([
{ {
text: command.name + ' ', text: command.name + ' ',
color: "blue", color: "blue",
translate: "", translate: "",
hoverEvent:{ hoverEvent: {
action:"show_text", action:"show_text",
value:[ value: [
{ {
text: `Command:${command.name}\n`, text: `Command:${command.name}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: `Trust Level: `, text: `Trust Level: `,
color: 'gray' color: 'gray'
}, },
{ {
text: `${command.trustLevel}\n`, text: `${command.trustLevel}\n`,
color: 'red' color: 'gold'
}, },
{ {
text: `${command.description}\n`, text: `${command.description}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: `Command Aliases: ${command.aliases}\n`, text: `Command Aliases: ${command.aliases}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: 'click on me to use me :)', text: 'click on me to use me :)',
color: 'gray', color: 'gray',
}, },
], ],
} },
} clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
]) ])
} else if (command.trustLevel === 3) { } else if (command.trustLevel === 3) {
owner.push([ owner.push([
{ {
text: command.name + ' ', text: command.name + ' ',
color: "dark_blue", color: "dark_blue",
translate: "", translate: "",
hoverEvent:{ hoverEvent: {
action:"show_text", action: "show_text",
value:[ value: [
{ {
text: `Command:${command.name}\n`, text: `Command:${command.name}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: `Trust Level: `, text: `Trust Level: `,
color: 'gray' color: 'gray'
}, },
{ {
text: `${command.trustLevel}\n`, text: `${command.trustLevel}\n`,
color: 'red' color: 'gold'
}, },
{ {
text: `${command.description}\n`, text: `${command.description}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: `Command Aliases: ${command.aliases}\n`, text: `Command Aliases: ${command.aliases}\n`,
color: 'gray' color: 'gray'
}, },
{ {
text: 'click on me to use me :)', text: 'click on me to use me :)',
color: 'gray', color: 'gray',
}, },
], ],
} },
} clickEvent: {
action: 'run_command',
value: `${config.prefixes[0]}${command?.name}`
}
}
]) ])
} }
} }
@ -263,7 +282,6 @@ module.exports = {
'\n', '\n',
public, public,
trusted, trusted,
// admin,
owner owner
]) ])
} else { } else {
@ -284,19 +302,22 @@ module.exports = {
const bot = context.bot; const bot = context.bot;
const args = context.arguments; const args = context.arguments;
const category = { const category = {
translate: '(%s%s%s%s%s) \u203a ', translate: '(%s%s%s%s%s%s%s) \u203a ',
bold: false, bold: false,
color: 'gray', color: 'gray',
with: [ with: [
{ color: "blue", text: 'Public'}, { color: "aqua", text: 'Public'},
{ color: "gray", text: ' | '}, { color: "gray", text: ' | '},
{ color: "dark_aqua", text: 'Trusted'}, { color: "dark_aqua", text: 'Trusted'},
{ color: 'gray', text: ' | '}, { color: 'gray', text: ' | '},
{ color: 'blue', text: 'Admin' },
{ color: 'gray', text: ' | ' },
{ color: "dark_blue", text: 'Owner'}, { color: "dark_blue", text: 'Owner'},
] ]
} }
let public = []; let public = [];
let trusted = []; let trusted = [];
let admin = [];
let owner = []; let owner = [];
for (const command of bot.commandManager.commandlist) { for (const command of bot.commandManager.commandlist) {
if (args[0] === command.name) { if (args[0] === command.name) {
@ -311,25 +332,31 @@ module.exports = {
} }
if (command?.trustLevel === 0) { if (command?.trustLevel === 0) {
public.push([ public.push([
{ {
text: command.name + ' ', text: command.name + ' ',
color: "blue", color: "aqua",
} }
]) ])
} else if (command?.trustLevel === 1) { } else if (command?.trustLevel === 1) {
trusted.push([ trusted.push([
{ {
text: command.name + ' ', text: command.name + ' ',
color: "dark_aqua" color: "dark_aqua"
} }
])
} else if (command?.trustLevel === 2) {
admin.push([
{
text: command.name + ' ',
color: 'blue'
}
]) ])
} else if (command?.trustLevel === 3) { } else if (command?.trustLevel === 3) {
owner.push([ owner.push([
{ {
text: command.name + ' ', text: command.name + ' ',
color: "dark_blue", color: "dark_blue",
} }
]) ])
} }
} }
@ -341,5 +368,6 @@ module.exports = {
.setTitle(`${this.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('♋')
} }
} }

View file

@ -49,9 +49,13 @@ module.exports = {
color: 'gray', color: 'gray',
}, },
{ {
text: `Ip \u203a ${bot.options.host}:${bot.options.port}\n`, text: `Ip \u203a ${bot.options.host}:`,
color: "gray" color: "gray"
}, },
{
text: `${bot.options.port}\n`,
color: 'gold'
},
{ {
text: `Version \u203a ${bot.options.version}\n`, text: `Version \u203a ${bot.options.version}\n`,
color: "gray", color: "gray",
@ -69,17 +73,25 @@ module.exports = {
color: "gray", color: "gray",
}, },
{ {
text: `Server count \u203a ${bot.bots.length}\n`, text: `Server count \u203a `,
color: "gray" color: "gray"
}, },
{
text: `${bot.bots.length}\n`,
color: 'gold'
},
{ {
text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`, text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`,
color: "gray" color: "gray"
}, },
{ {
text: `Prefix Length: ${config.prefixes.length}\n`, text: `Prefix Length: `,
color: "gray" color: "gray"
}, },
{
text: `${config.prefixes.length}\n`,
color: 'gold'
},
{ {
text: `isKaboom \u203a ${bot.options.isKaboom}\n`, text: `isKaboom \u203a ${bot.options.isKaboom}\n`,
color: "gray", color: "gray",
@ -151,9 +163,13 @@ module.exports = {
color: "gray" color: "gray"
}, },
{ {
text: `Cores \u203a ${os.cpus().length}\n`, text: `Core Count \u203a `,
color: "gray", color: "gray",
}, },
{
text: `${os.cpus().length}\n`,
color: 'gold'
},
{ {
text: `CPU \u203a ${os.cpus()[0].model}\n`, text: `CPU \u203a ${os.cpus()[0].model}\n`,
color: "gray" color: "gray"
@ -201,7 +217,6 @@ module.exports = {
text: `Device uptime \u203a ${format(os.uptime())}\n`, text: `Device uptime \u203a ${format(os.uptime())}\n`,
color: 'gray' color: 'gray'
}, },
// {text:`${format(process.uptime())}`,color:'gray'}
{ {
text: `Bot uptime \u203a ${format(process.uptime())}\n`, text: `Bot uptime \u203a ${format(process.uptime())}\n`,
color: "gray" color: "gray"
@ -303,7 +318,19 @@ module.exports = {
bot.discord.message.reply({ embeds: [Embed] }); bot.discord.message.reply({ embeds: [Embed] });
break break
case "config": case "config":
message = bot.getMessageAsPrismarine([ { text: `Minecraft username \u203a ${bot.options.username}\n`, color: 'gray', }, { text: `Ip \u203a ${bot.options.host}:${bot.options.port}\n`, color: "gray" }, { text: `Version \u203a ${bot.options.version}\n`, color: "gray", }, { text: `Discord username \u203a ${discordClient.user.tag}\n`, color: 'gray', }, { text: `Channel \u203a ${bot.discord.channel?.name}\n`, color: "gray" }, { text: `Server name \u203a ${bot.options.serverName}\n`, color: "gray", }, { text: `Server count \u203a ${bot.bots.length}\n`, color: "gray" }, { text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`, color: "gray" }, { text: `Prefix Length: ${config.prefixes.length}\n`, color: "gray" }, { text: `isKaboom \u203a ${bot.options.isKaboom}\n`, color: "gray", }, { text: `isCreayun \u203a ${bot.options.isCreayun}\n`, color: "gray", }, { text: `isSavage \u203a ${bot.options.isSavage}\n`, color: "gray", }, ])?.toAnsi(); message = bot.getMessageAsPrismarine([
{ text: `Minecraft username \u203a ${bot.options.username}\n`, color: 'gray', },
{ text: `Ip \u203a ${bot.options.host}:${bot.options.port}\n`, color: "gray" },
{ text: `Version \u203a ${bot.options.version}\n`, color: "gray" },
{ text: `Discord username \u203a ${discordClient.user.tag}\n`, color: 'gray' },
{ text: `Channel \u203a ${bot.discord.channel?.name}\n`, color: "gray" },
{ text: `Server name \u203a ${bot.options.serverName}\n`, color: "gray" },
{ text: `Server count \u203a ${bot.bots.length}\n`, color: "gray" },
{ text: `Prefixes \u203a ${config.prefixes.map((e) => e + " ").join(' ')}\n`, color: "gray" },
{ text: `Prefix Length: ${config.prefixes.length}\n`, color: "gray" },
{ text: `isKaboom \u203a ${bot.options.isKaboom}\n`, color: "gray" },
{ text: `isCreayun \u203a ${bot.options.isCreayun}\n`, color: "gray" },
{ text: `isSavage \u203a ${bot.options.isSavage}\n`, color: "gray", } ])?.toAnsi();
fix = fixansi(message.replaceAll('`', '`\u200b')) fix = fixansi(message.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder() Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`) .setColor(`${config.colors.discord.embed}`)
@ -312,7 +339,28 @@ module.exports = {
bot.discord.message.reply({ embeds: [Embed] }) bot.discord.message.reply({ embeds: [Embed] })
break break
case "server": case "server":
message = bot.getMessageAsPrismarine([ { text: `Hostname \u203a ${os.hostname()}\n`, color: "gray" }, { text: `User \u203a ${os.userInfo().username}\n`, color: "gray", }, { text: `Working Directory \u203a ${process.mainModule.path}\n`, color: "gray" }, { text: `Arch \u203a ${os.arch()}\n`, color: "gray" }, { text: `OS \u203a ${os.platform()}\n`, color: "gray" }, { text: `OS Version/distro \u203a ${os.version()}\n`, color: "gray", }, { text: `Kernel Version \u203a ${os.release()}\n`, color: "gray" }, { text: `Cores \u203a ${os.cpus().length}\n`, color: "gray", }, { text: `CPU \u203a ${os.cpus()[0].model}\n`, color: "gray" }, { text: `Server Free memory `, color: 'gray' }, { text: `${Math.floor( os.freemem() / 1048576, )} `, color: 'gray' }, { text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB\n`, color: 'gray' }, { text: `Device uptime \u203a ${format(os.uptime())}\n`, color: 'gray' }, { text: `Node version \u203a ${process.version}`, color: 'gray' } ])?.toString(); message = bot.getMessageAsPrismarine([
{ text: `Hostname \u203a ${os.hostname()}\n`, color: "gray" },
{ text: `User \u203a ${os.userInfo().username}\n`, color: "gray" },
{ text: `Working Directory \u203a ${process.mainModule.path}\n`, color: "gray" },
{ text: `Arch \u203a ${os.arch()}\n`, color: "gray" }, { text: `OS \u203a ${os.platform()}\n`, color: "gray" },
{ text: `OS Version/distro \u203a ${os.version()}\n`, color: "gray" },
{ text: `Kernel Version \u203a ${os.release()}\n`, color: "gray" },
{ text: `Cores \u203a ${os.cpus().length}\n`, color: "gray" },
{ text: `CPU \u203a ${os.cpus()[0].model}\n`, color: "gray" },
{ text: `Server Free memory `, color: 'gray' },
{ text: `${Math.floor( os.freemem() / 1048576, )} `, color: 'gold' },
{ text: 'MiB / ', color: 'gray' },
{ text: `${Math.floor(os.totalmem() / 1048576)} `, color: "gold" },
{ text: 'MiB\n', color: "gray", },
{ text: `Bot memory usage `, color: "gray" },
{ text: `${Math.floor( process.memoryUsage().heapUsed / 1048576, )} `, color: "gold", },
{ text: "MiB / ", color: "gray", },
{ text: `${Math.floor( process.memoryUsage().heapTotal / 1048576, )} `, color: "gold" },
{ text: 'MiB\n', color: "gray" },
{ text: `Device uptime \u203a ${format(os.uptime())}\n`, color: 'gray' },
{ text: `Bot uptime \u203a ${format(process.uptime())}\n`, color: "gray" },
{ text: `Node version \u203a ${process.version}`, color: 'gray' } ])?.toAnsi();
fix = fixansi(message.replace('`', '`\u200b')) fix = fixansi(message.replace('`', '`\u200b'))
Embed = new EmbedBuilder() Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`) .setColor(`${config.colors.discord.embed}`)

View file

@ -19,6 +19,9 @@ module.exports = {
case 'invalidstring': case 'invalidstring':
bot.core.run(`minecraft:tellraw ${args.slice(2).join(' ')} ${JSON.stringify(bot.exploits.invalidString)}`) bot.core.run(`minecraft:tellraw ${args.slice(2).join(' ')} ${JSON.stringify(bot.exploits.invalidString)}`)
break break
case 'item':
bot.exploits.item(`${args.slice(2).join(' ')}`)
break
default: default:
bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&")) bot.chat.message(bot.getMessageAsPrismarine({ translate: "command.unknown.argument", color: "dark_red" })?.toMotd().replaceAll("§","&"))
} }
@ -31,6 +34,11 @@ module.exports = {
case "invalidstring": case "invalidstring":
bot.core.run(`minecraft:tellraw ${args.slice(1).join(' ')} ${JSON.stringify(bot.exploits.invalidString)}`) bot.core.run(`minecraft:tellraw ${args.slice(1).join(' ')} ${JSON.stringify(bot.exploits.invalidString)}`)
break break
case 'item':
bot.exploits.item(`${args.slice(1).join(' ')}`)
break
default:
throw new CommandError('Invalid argument');
} }
} }
} }

View file

@ -16,9 +16,24 @@ module.exports = {
for (const player of players) { for (const player of players) {
component.push({ component.push({
translate: `%s \u203a %s [%s %s %s %s %s]`, translate: `%s \u203a %s [%s %s %s %s %s]`,
color: 'gray',
with: [ with: [
player.displayName ?? player.profile.name, player.displayName ?? player.profile.name,
player.uuid, {
text: `${player.uuid}`,
color: 'gray',
clickEvent: {
action: 'copy_to_clipboard',
value: `${player.uuid}`
},
hoverEvent: {
action: 'show_text',
contents: [{
text: 'click here to copy the player\'s uuid',
color: 'aqua'
}]
}
},
{ text: `Ping:`, color: 'dark_green' }, { text: `Ping:`, color: 'dark_green' },
{ text: `${player.latency}`, color: 'gold' }, { text: `${player.latency}`, color: 'gold' },
{ text: '/', color: 'gray' }, { text: '/', color: 'gray' },
@ -29,7 +44,7 @@ module.exports = {
component.push('\n') component.push('\n')
} }
component.pop() component.pop()
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [ bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
{ text: `Players: `, color:'gray' }, { text: `Players: `, color:'gray' },
{ text: '(' , color: 'gray' }, { text: '(' , color: 'gray' },
{ text: `${JSON.stringify(bot.players.length)}`, color: 'gold' }, { text: `${JSON.stringify(bot.players.length)}`, color: 'gold' },

View file

@ -24,12 +24,35 @@ module.exports = {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [ bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{ {
text: `Ip \u203a ${host}:${Number(port ?? 25565)}\n`, text: `Ip \u203a ${host}:${Number(port ?? 25565)}\n`,
color: 'gray',
hoverEvent: {
action: 'show_text',
contents: [{
text: 'click here for the servers ip',
color: 'gray'
}]
},
clickEvent: {
action: 'copy_to_clipboard',
value: `${host}:${Number(port ?? 25565)}`
}
},
{
text: `Players \u203a `,
color: 'gray' color: 'gray'
}, },
{ {
text: `Players \u203a ${server.players.online}/${server.players.max}\n`, text: `${server.players.online}`,
color: "gold"
},
{
text: ' / ',
color: 'gray' color: 'gray'
}, },
{
text: `${server.players.max}\n`,
color: "gold"
},
{ {
text: `Version \u203a ${server.version.name}\n`, text: `Version \u203a ${server.version.name}\n`,
color: 'gray', color: 'gray',
@ -41,21 +64,7 @@ module.exports = {
server.description, server.description,
]) ])
} catch (e) { } catch (e) {
bot.tellraw("@a", e.toString()) bot.chat.message(`${e.toString()}`)
} }
} }
} }
/*
try {
const server = await request(`https://eu.mc-api.net/v3/server/ping/${interaction.options.getString('ip')}`);
json = await server.body.json()
console.log((json))
const Embed = new EmbedBuilder()
.setColor(`${config.colors.commands.embed}`)
.setTitle(`${this.data.name} Command`)
setDescription(
`IP \u203a ${interaction.options.getString('ip')}\nPlayer Count \u203a ${json.players.online}/${json.players.max}\nOnline \u203a ${json.online}\n
Version \u203a ${json.version.name}\nMotd \u203a ${JSON.stringify(json.description)}`)
.setThumbnail(`${json.favicon}`)
*/

View file

@ -14,7 +14,6 @@ module.exports = {
const bot = context.bot; const bot = context.bot;
const source = context.source; const source = context.source;
const config = context.config; const config = context.config;
//throw new CommandError('ohio')
if (config.patches.netmsg) { if (config.patches.netmsg) {
component = [ component = [
{ text: '[', color: "dark_gray" }, { text: '[', color: "dark_gray" },
@ -35,10 +34,6 @@ module.exports = {
] ]
} }
} }
// bot.bots.filter((eachBot) => { if (eachBot.options.useChat) eachBot.chat.message('sussy');
// else if (!eachBot.options.useChat) eachBot.chat.message('baka!')})
// for (const eachBot of bot.bots) eachBot.tellraw("@a", component)
// for (const eachBot of bot.bots) {
bot.bots.filter((eachBot) => { bot.bots.filter((eachBot) => {
if (eachBot.options.serverName === "Savage Friends" && eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) { if (eachBot.options.serverName === "Savage Friends" && eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {
eachBot.chat.message(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${args.join(' ')}`) eachBot.chat.message(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${args.join(' ')}`)

View file

@ -25,7 +25,18 @@ module.exports = {
} else { } else {
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [ bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
{ {
text: util.inspect(eval(script), { stylize }).substring(0, 32700) text: util.inspect(eval(script), { stylize }).substring(0, 32700),
hoverEvent: {
action: 'show_text',
contents: [{
text: 'click here to copy the code input',
color: 'gray'
}]
},
clickEvent: {
action: 'copy_to_clipboard',
value: `${script}`
}
} }
]); ]);
} }

View file

@ -1,6 +1,8 @@
const http = require('http'); const http = require('http');
const https = require('https'); const https = require('https');
const util = require('util'); const util = require('util');
const fixansi = require('../util/ansi');
const CommandError = require('../util/command_error')
module.exports = { module.exports = {
name: 'website', name: 'website',
trustLevel: 0, trustLevel: 0,
@ -22,7 +24,7 @@ module.exports = {
res.on('data', (chunk) => { rawData += chunk; }); res.on('data', (chunk) => { rawData += chunk; });
res.on('end', () => { res.on('end', () => {
try { try {
bot.tellraw("@a", { text: util.inspect(rawData), color: "dark_green" }) bot.tellraw("@a", { text: util.inspect(rawData.toString().substring(0, 32750)), color: "dark_green" })
} catch (e) { } catch (e) {
bot.tellraw("@a", e.toString()); bot.tellraw("@a", e.toString());
} }
@ -30,10 +32,10 @@ module.exports = {
}).on('error', (e) => { }).on('error', (e) => {
bot.chat.message(`&4${e.toString()}`); bot.chat.message(`&4${e.toString()}`);
}); });
} else if (args.join(' ').toLowerCase().startsWith('https://')) { } else {
https.get(args.join(' '), (res) => { https.get(args.join(' '), (res) => {
res.on('data', (d) => { res.on('data', (d) => {
bot.tellraw("@a", { text: util.inspect(d.toString()), color: "dark_green", }) bot.tellraw("@a", { text: util.inspect(d.toString().substring(0, 32750)), color: "dark_green", })
// console.log(Object.keys(d.toString().length)); // console.log(Object.keys(d.toString().length));
}); });
}).on('error', (e) => { }).on('error', (e) => {
@ -44,5 +46,61 @@ module.exports = {
discordExecute (context) { discordExecute (context) {
const bot = context.bot; const bot = context.bot;
const args = context.arguments; const args = context.arguments;
const config = context.config;
let Embed;
let fix;
let ansi;
//bot.discord.message.reply('e');
if (args.join(' ').toLowerCase().startsWith("http://")) {
http.get(args.join(' '), (res) => {
const { statusCode } = res;
const contentType = res.headers['content-type'];
res.setEncoding('utf8');
let rawData = '';
res.on('data', (chunk) => { rawData += chunk; });
res.on('end', () => {
// try {
// bot.tellraw("@a", { text: util.inspect(rawData), color: "dark_green" })
ansi = bot.getMessageAsPrismarine({ text: util.inspect(rawData.toString()), color: 'dark_green'})?.toAnsi()
fix = fixansi(ansi.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
// } catch (e) {
// bot.tellraw("@a", e.toString());
//throw new CommandError(e.toString())
// }
});
}).on('error', (e) => {
//bot.chat.message(`&4${e.toString()}`);
});
} else {
https.get(args.join(' '), (res) => {
res.on('data', (d) => {
// bot.tellraw("@a", { text: util.inspect(d.toString()), color: "dark_green", })
// console.log(Object.keys(d.toString().length));
ansi = bot.getMessageAsPrismarine({ text: util.inspect(d.toString()), color: 'dark_green'})?.toAnsi()
fix = fixansi(ansi.replaceAll('`', '`\u200b'))
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
// bot.discord.message.reply('e');
});
}).on('error', (e) => {
//bot.chat.message(`&4${e.toString()}`);
//throw new CommandError(e.toString())
});
/*
Embed = new EmbedBuilder()
.setColor(`${config.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`\`\`\`ansi\n${fix1}\n\`\`\``)
bot.discord.message.reply({ embeds: [Embed] })
*/
}
} }
} }

721
src/data/changelog.json Normal file
View file

@ -0,0 +1,721 @@
[
{
"name": {
"text": "v0.1.0 - v0.5.0-beta",
"color": "blue",
"bold": false
},
"authors": [
"Prototypes"
],
"foundation": "11/22/22 - 1/24/23",
"exclaimer": "ehh nothing much just the release of the betas"
},
{
"name": {
"text": "v1.0.0-beta",
"color": "blue",
"bold": false
},
"authors": [
"in console test"
],
"foundation": "1/25/23",
"exclaimer": "original commands:!cloop bcraw,!cloop sudo,!troll,!say,!op (broke),!deop (broke), !gms (broke),!freeze,!icu <--- these commands no longer can be used in game but in console for beta 1.0 commands added: fake kick,ban,kick,crashserver,stop,gmc,greetin,test(broken idk),bypass,entity spam ,gms ,stop,tntspam ,prefix ,annoy (broke results in a complete server crash keeping ayunboom down for 3 to 5 hours),freeze,crashserver,troll ,trol(more destructive),icu ,say,sudo,cloop"
},
{
"name": {
"text": "v1.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"FNFBoyfriendBot"
],
"foundation": "1/26/23",
"exclaimer": "FNFBoyfriendBot. commands added: BOOM,deop,troll and trol(added extra code to both commands),kaboom,serverdeop, commands fixed:tp,gms,annoy(attemps to crash the server but not as bad as it was) commands untested:prefix command Broke:icu,freeze,tntspam,entityspam,tntspam? changed name to &b &lFNFBoyfriendBot may change later idk"
},
{
"name": {
"text": "v1.0.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "1/26/23",
"exclaimer": "reworked the kaboom command and fixed the description commands but thats about it. also reworked the greeting command"
},
{
"name": {
"text": "v1.1.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "1/26/23 2:00pm",
"exclaimer": "nothing much just added extra stuff to the troll, trol and that is about it"
},
{
"name": {
"text": "v1.2.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "1/28/23 1:51",
"exclaimer": "for ppl me making me really mad -.- got released early"
},
{
"name": {
"text": "v2.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"Major"
],
"foundation": "2/07/23 8:01pm",
"exclaimer": "added DREAMSTANALERT,technoblade,GODSWORD,KFC,MYLEG,OHHAIL,altcrash,MyHead Reworked tntspam,entityspam,soundbreaker added Spim to the whitelist of the bot released too early than it was planned gonna be released due do the code almost leaked it had to be released early"
},
{
"name": {
"text": "v2.1.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "2/11/23 5:30pm",
"exclaimer": "added: refillcore(had early prototypes of this was original), vanish,deop,cloopdeop,mute,cloopmute reworked: op (supposed to already op the bot but didnt work until this release) and reworked gmc (same problem with op) (had early prototypes of vanish,refillcore,gmc,and op but these were original gonna be automatic but after alot of attempts i said screw it and added 2 commands refillcore, and vanish reworked gmc and op and got them working finally) removed Spim because come to find out he couldnt be trusted"
},
{
"name": {
"text": "v2.2.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "2/20/23",
"exclaimer": "added ckill(added back after trial and error),serversuicidal changed username of the bot from hex code to FNFBoyfriendBot because hex code for the username was confusing as it changes everytime"
},
{
"name": {
"text": "v3.0.0-Beta",
"color": "blue",
"bold": false
},
"authors": [
"blue-balled corruption"
],
"foundation": "",
"exclaimer": "was canceled due to ayunboom being rewriten and renamed to creayun barely usable on there because commands blocks are disabled which i created a bot for that server that has no command blocks just finished the final build of the Creayun build of the bot due to chip announcing that he may make a kaboom clone yk what 1.5.2 and 1.8 support but anyway onto what is in the v3.0-beta well the beta for right now commands added:discord,version,online,list,iownyou,endmysuffering,wafflehouse,whopper,bcraw,destroycore Notes:the original say command was reworked into talking in chat without bcraw and command blocks which the bcraw chatting code is still in the bot but was reworked into the bcraw commmand. maybe some commands removed? i dont know yet edit there is 2 commands removed commands removed:tpe and serverdeop??? reworked commands :say command for right now relay chat mabe will be added as a seperate repl i dont know yet possible would need a whole code rewrite for relay chat"
},
{
"name": {
"text": "v3.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"Sky Remanifested"
],
"foundation": "",
"exclaimer": "the full release of 3.0 the rewrite has been pushed back to 4.0 due to 3.0 already pass its release date and the code i had on hand was done but the rewrite wasnt done Added: SelfCare Made during development:Relay chat prototypes for several servers"
},
{
"name": {
"text": "v3.0.5",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "",
"exclaimer": "bug fixes"
},
{
"name": {
"text": "v3.0.9",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "",
"exclaimer": "commands added:Help(finally added after about a year),consolelog(added cuz yes),cloopconsolelog(added cuz yes)"
},
{
"name": {
"text": "v3.3.0",
"color": "dark_red",
"bold": false
},
"authors": [
""
],
"foundation": "",
"exclaimer": "switched it base to 4.0s base during 4.0s development"
},
{
"name": {
"text": "v4.0.0-beta",
"color": "blue",
"bold": false
},
"authors": [
"FNFBoyfriendBot Ultimate"
],
"foundation": "",
"exclaimer": "all of the command removed and or rewriten from version 3.0.9 Commands added or rewriten:ban,buyrealminecraft,cloop,discord,echo,errortest,freeze,help,icu,info,kick,bots,skids,romncitrash,say,selfdestruct,serversuicidal,sudo,test,trol,troll (note that this is different and is not CommandModules)Modules Added:discord,chat,chat_command_handler,command_manager,position,registry,reconnect,command_core CustomChats added:kaboom(for normal chat) (note that this is different and is not Modules)CommandModules Added:command_error,Command_source a beta release for rn"
},
{
"name": {
"text": "v4.0.0-Alpha ",
"color": "aqua",
"bold": false
},
"authors": [
"FNFBoyfriendBot Ultimate"
],
"foundation": "",
"exclaimer": "Commands added: calculator,ckill,evaljs,urban,crash,cloopcrash,core,list,ping,netmsg,skin,tpr Commands Removed:Buyrealminecraft (note that this is different and is not CommandModules)Modules Added:op selfcare,gmc selfcare,vanish selfcare,cspy selfcare,console (note that this is different and is not Modules)CustomChats Added:u2O3a(for custom chat) added util with between(for urban) eval_colors(for evaljs)"
},
{
"name": {
"text": "v4.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"FNFBoyfriendBotX"
],
"foundation": "8/11/23",
"exclaimer": "Bot is finished with the rewrite thank you ChipMC and chayapak for helping me rewrite the bot Heres the commands ban (mabe removing), blacklist (currently being worked on), botdevhistory, bots, calculator, changelog, ckill, cloop, cloopcrash(probably removing), core, crash, creators, discord, echo, errortest, evaljs, freeze, help, icu, list, meminfo, mineflayerbot, netmsg (Hello World!), ping (pong!), reconnect, say, selfdestruct, serversuicidal (probably removing because theres ckill), skin, sudo, test, tpr, trol (mabe renaming it to troll), troll (mabe removing it and replacing it with the trol command), urban (ong sus asf), validate, version"
},
{
"name": {
"text": "v4.0.5",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "8/17/23",
"exclaimer": "bug fixes, did what i said i was gonna do in the last update"
},
{
"name": {
"text": "v4.0.6",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "8/22/23",
"exclaimer": "added 1 console command along with updating console.js so that the bot sends a message to 1 server at a time and not a message to all the servers at a time"
},
{
"name": {
"text": "v4.0.7",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/4/23",
"exclaimer": "merged server and botusername commands and naming the command logininfo cuz it now shows the server ip, server port, Minecraft java Version, and the Bots Username"
},
{
"name": {
"text": "v4.0.8",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/7/23",
"exclaimer": "added the wiki command even though its semi working. bug fixes. some bugs still in the bot is netmsg showing the bots username when i used the netmsg cmd from my end and not the console i find it funny asf though"
},
{
"name": {
"text": "v4.0.8A",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/7/23",
"exclaimer": "added some things to the changelog cmd. still needing to fix the issue with custom chat and netmsg also added a bugs command to check what bugs are needing to be fixed"
},
{
"name": {
"text": "v4.0.8B",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/8/23",
"exclaimer": "made it to where it sends more messages on start up and made it to where the buildstring is in secrets"
},
{
"name": {
"text": "v4.0.8C",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/14/23",
"exclaimer": "added the nodejs version to the version command but thats about it still fixing the bugs with the relay chat and mabe rewriting the validation system in the bot"
},
{
"name": {
"text": "v4.0.8D",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/16/23",
"exclaimer": "added onto the changelog command along with adding spambot and lol commands (cuz yes) along with removing the bugs command maybe adding it back sometime later also the discord relay chat and validation system mabe getting a rewrite and also updated node from v18 to v20.6.0"
},
{
"name": {
"text": "v4.0.8E",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/17/23",
"exclaimer": "changed the name for meminfo to serverinfo along with adding onto it and moving the nodejs, node-minecraft-protocol, and discord.js versions from the version command to the serverinfo command"
},
{
"name": {
"text": "v4.0.8F",
"color": "gold",
"bold": false
},
"authors": [
""
],
"foundation": "9/24/23",
"exclaimer": "added filesdirectories command but thats about it"
},
{
"name": {
"text": "v4.0.9",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/26/23",
"exclaimer": "added a hover event to the custom chat for the bot"
},
{
"name": {
"text": "v4.1.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/27/23",
"exclaimer": "Finally changed how the validation/hashing works in the bot instead of it being sent in discord there will be a key for trusted to validate"
},
{
"name": {
"text": "v4.1.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "9/28/23",
"exclaimer": "added uppercase and lowercase function for commands and soon gonna be completely overhauling the validation system in the bot again"
},
{
"name": {
"text": "v4.1.2",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/02/23",
"exclaimer": "added uptime as a command but thats it"
},
{
"name": {
"text": "v4.1.4",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/03/23",
"exclaimer": "moved the custom chat text and cmd block text to config.js"
},
{
"name": {
"text": "v4.1.6",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/08/23",
"exclaimer": "fixed the relay chat and fixed the cr issue with urban and also fixed reconnect"
},
{
"name": {
"text": "v4.1.7",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/08/03",
"exclaimer": "added mute, tag, and skin to selfcare"
},
{
"name": {
"text": "v4.1.8",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/11/23",
"exclaimer": "fixed the issue with memused cee mmm dee"
},
{
"name": {
"text": "v4.1.9",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/12/23",
"exclaimer": "rewrote evaljs its now using isolated-vm and not vm2"
},
{
"name": {
"text": "v4.2.0-restore",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/19/23",
"exclaimer": "fixed the disconnect message for discord and the bug with the say command"
},
{
"name": {
"text": "v4.2.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/24/23",
"exclaimer": "rewrote the help command to allow descriptions finally along with adding things to the base of the bot for the descriptions"
},
{
"name": {
"text": "v4.2.2",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/25/23",
"exclaimer": "merged serverinfo, memused, discord, logininfo, creators, version, uptime together"
},
{
"name": {
"text": "v4.2.3",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "10/30/23",
"exclaimer": "added a antiskid measure (thanks _yfd)"
},
{
"name": {
"text": "v4.2.4",
"color": "green",
"bold": false
},
"authors": [
"Spooky update (note: might as well give it a codename since its halloween)"
],
"foundation": "10/31/23",
"exclaimer": "merged fard and reconnect together making recend, added more crash methods to the crash command, and remove 12 commands"
},
{
"name": {
"text": "v4.2.5",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "11/8/23",
"exclaimer": "patched the exploit in the discordmsg command and made it to were with the netmsg command players cannot send empty messages"
},
{
"name": {
"text": "v4.3.0",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "11/16/23",
"exclaimer": "color coded the console logs are LOGS in the color gold consoleserver are in the category INFO in the color green, errors after start up are in the category WARN in the color yellow, Fatal Errors/start-up errors are in the category ERROR in the color red and hashs/validation codes sent to console are in the category HASH in the color green. added the command servereval. changed config.json to config.js and moved the username() function from the end of bot.js to the end of config.js and replacing where username() after options.username with 'Player' + Math.floor(Math.random() * 1000) and added player ping/latency to list along with fixing the bug with cloop list"
},
{
"name": {
"text": "v4.3.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "11/21/23 one day till the bots anniversary?!?!",
"exclaimer": "modified the bots boot originally it would spam the bots buildstring each time it logged into a server on boot but now it will only send it once to console on boot along with it now sending the foundationbuildstring after the buildstring sent in console. ported some commands over since chomens is pretty much dead along with adding chat support for chat.type.text and chat.type.emote"
},
{
"name": {
"text": "v4.3.2",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "11/23/23",
"exclaimer": "made the bots selfcare, the selfcares interval and console toggle-able along with making default options for the selfcare and its interval, the bots prefix, the bots discord prefix, the reconnectDelay interval, the core customname, and the console, partically fixed the issue with the trusted commands no being able to be ran in discord, edited the bots boot again it now also logs the amount of files its loading on boot its discord username its logged in with(also added the discord username to the info command)"
},
{
"name": {
"text": "v4.3.3",
"color": "dark_red",
"bold": false
},
"authors": [
"Lullaby Girlfriend's LostCause"
],
"foundation": "12/3/23",
"exclaimer": "added hover events to the help command for command descriptions, trust console and name along with click events for them added memusage and fixed the category issue with the console and added toggles to the bot for console, selfcare, and skin"
},
{
"name": {
"text": "v4.3.4",
"color": "dark_red",
"bold": false
},
"authors": [
"Suffering Siblings"
],
"foundation": "12/12/23",
"exclaimer": "overhauled the console and discord relay chat fixing trusted roles and making the selfcare toggleable in game also fixing the issue with hiding console only commands (thank you poopbob for helping me with that)"
},
{
"name": {
"text": "v5.0.0-Beta",
"color": "blue",
"bold": false
},
"authors": [
"Monochrome"
],
"foundation": "12/18/23",
"exclaimer": "added owner validation to the bot thats about it"
},
{
"name": {
"text": "v5.0.0",
"color": "dark_red",
"bold": false
},
"authors": [
"Monochrome"
],
"foundation": "12/20/23",
"exclaimer": "since the old validation system was able to barely handle owner validation it was completely remove and replaced with trust levels which handle validation way better also added command aliases (shoutouts to poopbob with the command aliases). made a whole new changelog command for v5.0.0 and renamed the old one changelogv4.3.4. also fixed the issue with the console not properly refreshing lines that are sent"
},
{
"name": {
"text": "v5.0.1",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "added botsrun for the funni along with making the bot be able to auto refill its core now and fill the core from a command block(edit: nevermind its very buggy reverting it back to how it originally filled its core) and adding a hover event to netmsg along with having the test command tellraw the players display name in the command and added support for 3 command prefixes",
"exclaimer": "12/23/23"
},
{
"name": {
"text": "v5.0.2",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "12/26/23",
"exclaimer": "fixed the issue with the cpu checking in the info command added discord hashing back into the bot to work along side the keys made it check to see if the config file is in the directory and if not it will recreate the config from default.js"
},
{
"name": {
"text": "v5.0.3",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "12/29/23",
"exclaimer": "mabe the bot last update of 2023 cuz next year will be 2024 www but anyway expanded the disconnect messages for both console and discord but thats pretty much it"
},
{
"name": {
"text": "v5.0.4",
"color": "green",
"bold": false
},
"authors": [
""
],
"foundation": "1/12/24",
"exclaimer": "first update of 2024 for the bot but anyway merged the test and errortest commands into cmdtest, changed the colors for the help command public is #00FFFF, trusted is dark_purple and owner remained as dark red. moved the module loader from bot.js to index.js to split the boot time in half which now allows module functions like bot.chat() to be used in bot.js and also since the command manager is a module it also loads the commands thats a w on all ends also removed some modules to improve the bots boot time and moved the functions for the sctoggle command into the command itself and not as a module which helped the boot time as well and last but not least merged the memused usage in the info command with the serverinfo usage and made the memusage command use the bossbar and not the actionbar"
},
{
"name": {
"text": "v5.0.5",
"color": "dark_red",
"bold": false
},
"authors": [
{
"text": "QT ",
"color": "#f001db"
},
{
"text": "KB ",
"color": "#740000"
},
{
"text": "Termination",
"color": "black"
}
],
"foundation": "1/26/24",
"exclaimer": "added a new feature to the bot called Coreless Mode to where the core can be toggled and most commands using tellraw will use chat instead along with the discord relay chat, fixed the bug with trust and owner commands not running in console along with removing alot of useless commands and made the 3 prefixes a array and added ratelimit for console logging and command usage and added file chat logging back"
},
{
"name": {
"text": "v5.0.6A",
"color": "gold",
"bold": false
},
"authors": [
"Interlope"
],
"foundation": "2/15/24",
"exclaimer": "added music finally fixed coreless mode made a seperate function for discord in the command manager and idk what all"
},
{
"name": {
"text": "v5.0.7a",
"color": "gold",
"bold": false
},
"authors": [
"Ski"
],
"foundation": "3/29/24",
"exclaimer": "rewrote alot of shiiiiiiit :3 and added matrix support"
},
{
"name": {
"text": "v5.0.7b",
"color": "gold",
"bold": false
},
"authors": [
"Ski"
],
"foundation": "4/22/24",
"exclaimer": "a lot of clean up adding shit and more"
},
{
"name": {
"text": "v5.0.7c",
"color": "gold",
"bold": false
},
"authors": [
"Ski"
],
"foundation": "5/1/24",
"exclaimer": "added discord execute, redone the website command, added attachments for discord ported the urban package to the bot added ping"
},
{
"name": {
"text": "v5.0.8",
"color": "dark_red",
"bold": false
},
"authors": [
"Censory Overload"
],
"foundation": "6/4/24",
"exclaimer": "rewritten the urban command to use undici removed the music command changed the colors for the help command and more"
}
]

View file

@ -1,8 +1,8 @@
{ {
"bot": { "bot": {
"buildstring": { "buildstring": {
"version": "v6.0.0-beta", "version": "v6.0.0",
"build":"800", "build":"950",
"codename":"§#fe019aGraffiti §7Groovin" "codename":"§#fe019aGraffiti §7Groovin"
}, },
"source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/" "source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/"

View file

@ -5,6 +5,7 @@ const CreayunChatParser = require('../util/ChatParsers/Creayun');
const sayConsoleChatParser = require('../util/ChatParsers/sayConsole'); const sayConsoleChatParser = require('../util/ChatParsers/sayConsole');
const VanillaChatParser = require("../util/ChatParsers/VanillaChat"); const VanillaChatParser = require("../util/ChatParsers/VanillaChat");
const nbt = require('prismarine-nbt'); const nbt = require('prismarine-nbt');
const yfdCustomChatParser = require('../util/ChatParsers/yfdCustomChat')
function tryParse (json) { function tryParse (json) {
try { try {
return JSON.parse(json) return JSON.parse(json)
@ -21,12 +22,11 @@ function chat (bot, options, config) {
if (options.isSavage) { if (options.isSavage) {
bot.chatParsers = [CreayunChatParser, sayConsoleChatParser] bot.chatParsers = [CreayunChatParser, sayConsoleChatParser]
} else { } else {
bot.chatParsers = [KaboomChatParser, ChipmunkModChatParser, VanillaChatParser, sayConsoleChatParser] bot.chatParsers = [KaboomChatParser, ChipmunkModChatParser, VanillaChatParser, sayConsoleChatParser, yfdCustomChatParser]
} }
bot.on('packet.profileless_chat', packet => { bot.on('packet.profileless_chat', packet => {
const message = tryParse(packet.message) const message = tryParse(packet.message)
const sender = tryParse(packet.name) const sender = tryParse(packet.name)
// bot.tellraw("@a", `Packet type ${packet.type}`)
bot.emit('profileless_chat', { bot.emit('profileless_chat', {
message, message,
type: packet.type, type: packet.type,
@ -39,12 +39,6 @@ function chat (bot, options, config) {
if (packet.type === 3) bot.emit('message', bot.getMessageAsPrismarine({"translate":"commands.message.display.outgoing","with":[`${translateUsername}`,`${translateMessage}`],"color":"gray","italic":true})?.toMotd()) if (packet.type === 3) bot.emit('message', bot.getMessageAsPrismarine({"translate":"commands.message.display.outgoing","with":[`${translateUsername}`,`${translateMessage}`],"color":"gray","italic":true})?.toMotd())
if (packet.type === 4) bot.emit('message', message); if (packet.type === 4) bot.emit('message', message);
if (packet.type === 5) bot.emit('message', bot.getMessageAsPrismarine({translate:"chat.type.announcement",color:'white', with:[`${translateUsername}`,`${translateMessage}`]})?.toMotd()) if (packet.type === 5) bot.emit('message', bot.getMessageAsPrismarine({translate:"chat.type.announcement",color:'white', with:[`${translateUsername}`,`${translateMessage}`]})?.toMotd())
/* switch (packet.type) {
case "4":
bot.emit('message', message)
// console.log('packet type 4');
break
}*/
tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine }) tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
}) })
@ -63,6 +57,7 @@ function chat (bot, options, config) {
if (config.commandSetMessage) { if (config.commandSetMessage) {
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
} }
if (message.translate === 'multiplayer.message_not_delivered') return
bot.emit('system_chat', { message, actionbar: packet.isActionBar }) bot.emit('system_chat', { message, actionbar: packet.isActionBar })
if (packet.isActionBar) { if (packet.isActionBar) {

View file

@ -12,8 +12,8 @@ function core (bot, options, config) {
if (!pos) return if (!pos) return
if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return
// if (isNaN(pos.x + start.x)) bot.chat.command('world 3'); // if (isNaN(pos.x + start.x)) bot.chat.command('world 3');
// console.log(isNaN(pos.x + start.x)) // console.log(isNaN(pos.x + start.x))
bot.chat.command(`minecraft:fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName:'${JSON.stringify(config.core.name)}'}`) bot.chat.command(`minecraft:fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName:'${JSON.stringify(config.core.name)}'}`)
}, },

View file

@ -2,27 +2,29 @@ function command_loop (bot, options, config) {
bot.cloop = { bot.cloop = {
list: [], list: [],
add (command, interval) { add (command, interval) {
setTimeout(() => { let timer;
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval }) timer = ({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
}, 10) this.list.push(timer)
bot.on('end', () => { bot.on('end', () => {
this.clear() this.clear()
}) })
bot.on('packet.login', () => {
timer = ({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
this.list.push(timer);
})
}, },
remove (index) { remove (index) {
clearInterval(this.list[index].timer) clearInterval(this.list[index].timer)
bot.cloop.list.splice(index, 1) bot.cloop.list.splice(index, 1)
}, },
clear () { clear () {
for (const cloop of this.list) clearInterval(cloop.timer) for (const cloop of this.list) clearInterval(cloop.timer)
this.list = [] this.list = []
} }
} }
/* bot.on('end', () => {
// clearInterval(this.list);
for (const cloop of this.list) console.log(cloop)
console.log('e')
})*/
} }
module.exports = command_loop; module.exports = command_loop;

View file

@ -20,21 +20,21 @@ function command_manager (bot, options, config, discordClient) {
} }
} else if (!source?.sources?.discord && !source?.sources?.console) { } else if (!source?.sources?.discord && !source?.sources?.console) {
if (!command || !command.execute) if (!command || !command.execute)
throw new CommandError( throw new CommandError([
bot.getMessageAsPrismarine([ {
{ translate: `command.unknown.command`
translate: `command.unknown.command` },
}, {
{ text: '\n'
text: '\n' },
}, {
{ text: `${commandName} `
text: `${commandName} ` },
}, {
{ translate: "command.context.here"
translate: "command.context.here" }
}])?.toMotd(bot.registry.language) ])
) //}
} else if (source?.sources?.console && !source?.sources?.discord) { } else if (source?.sources?.console && !source?.sources?.discord) {
if (!command || !command.execute) if (!command || !command.execute)
bot.console.warn(bot.getMessageAsPrismarine([ bot.console.warn(bot.getMessageAsPrismarine([
@ -90,7 +90,7 @@ function command_manager (bot, options, config, discordClient) {
return command?.execute({ bot, source, arguments: args, config, discordClient}) return command?.execute({ bot, source, arguments: args, config, discordClient})
} }
} catch (error) { } catch (error) {
console.error(error) console.error(error.stack)
bot?.console?.filelogging(error.stack); bot?.console?.filelogging(error.stack);
if (source?.sources?.discord && !source?.sources?.console) { if (source?.sources?.discord && !source?.sources?.console) {
const Embed = new EmbedBuilder() const Embed = new EmbedBuilder()
@ -120,6 +120,7 @@ function command_manager (bot, options, config, discordClient) {
return this.discordExecute(source, commandName, args) return this.discordExecute(source, commandName, args)
} }
}, },
register (command) { register (command) {
this.commands[command.name] = command this.commands[command.name] = command
if (command.aliases) { if (command.aliases) {
@ -127,7 +128,6 @@ function command_manager (bot, options, config, discordClient) {
} }
}, },
unregister (command) { unregister (command) {
// commands = {};
this.commands = {}; this.commands = {};
}, },
getCommand (name) { getCommand (name) {
@ -136,6 +136,21 @@ function command_manager (bot, options, config, discordClient) {
getCommands () { getCommands () {
return Object.values(this.commands) return Object.values(this.commands)
},
reload() {
for (const filename of fs.readdirSync(path.join(__dirname, "../commands"))) {
try {
delete require.cache[require.resolve(path.join(__dirname, "../commands/", filename))]
const command = require(path.join(__dirname, "../commands/", filename));
bot.commandManager.register(command);
bot.commandManager.commandlist.pop(command)
bot.commandManager.commandlist.push(command)
} catch (error) {
bot.tellraw("@a", { text: `Failed to reload file ${filename}\n${error.stack}`, color: "red" })
bot?.console?.filelogger(error.stack);
}
}
} }
} }
@ -165,33 +180,11 @@ function command_manager (bot, options, config, discordClient) {
}, 1000) }, 1000)
if (ratelimit > 2) { if (ratelimit > 2) {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'You are using commands too fast!', color: 'dark_red'}) bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, { text: 'You are using commands too fast!', color: 'dark_red'})
} else if (command.split(" ")[0].length === 0) {
} else { } else {
bot.commandManager.executeString(source, command) bot.commandManager.executeString(source, command)
} }
}) })
}) })
bot.commandManager.reload = function () {
//commandlist = [];
// bot.commandManager.unregister();
// bot.commandManager.commandlist = [];
for (const filename of fs.readdirSync(path.join(__dirname, "../commands"))) {
try {
// bot.commandManager.unregister();
delete require.cache[require.resolve(path.join(__dirname, "../commands/", filename))]
const command = require(path.join(__dirname, "../commands/", filename));
// bot.commandManager.unregister();
// delete require.cache[require.resolve(path.join(__dirname, "../commands", filename))]
// bot.commandManager.register(command);
// bot.commandManager.commandlist.push(command);
bot.commandManager.register(command);
bot.commandManager.commandlist.pop(command)
bot.commandManager.commandlist.push(command)
} catch (error) {
// bot.console.error(["Failed to load File ", filename, ":", error.stack])
bot.tellraw("@a", { text: `Failed to reload file ${filename}\n${error.stack}`, color: "red" })
bot?.console?.filelogger(error.stack);
}
}
}
} }
module.exports = command_manager; module.exports = command_manager;

View file

@ -1,6 +1,7 @@
const CommandSource = require('../util/command_source'); const CommandSource = require('../util/command_source');
function CommandConsole (bot, options, config) { function CommandConsole (bot, options, config) {
const ChatMessage = require('prismarine-chat')(options.version); const ChatMessage = require('prismarine-chat')(options.version);
let ratelimit = 0;
bot.console = { bot.console = {
readline: null, readline: null,
consoleServer: 'all', consoleServer: 'all',
@ -75,8 +76,18 @@ function CommandConsole (bot, options, config) {
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(bot.registry.language).replaceAll('BlackStone Mafia On Top!', "Fuck off you god damn cunt") const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(bot.registry.language).replaceAll('BlackStone Mafia On Top!', "Fuck off you god damn cunt")
const string = bot.getMessageAsPrismarine(message)?.toString(bot.registry.language).replaceAll('BlackStone Mafia On Top!', "Fuck off you god damn cunt") const string = bot.getMessageAsPrismarine(message)?.toString(bot.registry.language).replaceAll('BlackStone Mafia On Top!', "Fuck off you god damn cunt")
if (!options.logging) return if (!options.logging) return
//ratelimit++
setInterval(() => {
// ratelimit--
ratelimit = 0
}, 1000)
if (ratelimit > 300) {
// options.logging = false
return
}
bot.console.logs(`${ansi}`) bot.console.logs(`${ansi}`)
bot.console.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ${string}`) bot.console.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ${string}`)
ratelimit++
}) })
} }
module.exports = CommandConsole; module.exports = CommandConsole;

View file

@ -26,7 +26,7 @@ function discord(bot, options, config, discordClient) {
bot.discord.channel = discordClient.channels.cache.get(options.channelId) bot.discord.channel = discordClient.channels.cache.get(options.channelId)
discordClient.user.setPresence({ discordClient.user.setPresence({
activities: [{ activities: [{
name: `amogus ඞ`, name: `your mother`,
type: 0 type: 0
}], }],
status: `dnd` status: `dnd`

View file

@ -14,8 +14,12 @@ function selfcare (bot, options, config) {
// You no longer have a tag // You no longer have a tag
bot.on('message', (message) => { bot.on('message', (message) => {
const stringMessage = bot.getMessageAsPrismarine(message)?.toString(); const stringMessage = bot.getMessageAsPrismarine(message)?.toString();
if (stringMessage?.startsWith("Successfully enabled CommandSpy")) commandSpy = true; // if (stringMessage?.startsWith("Successfully enabled CommandSpy")) commandSpy = true;
else if (stringMessage?.startsWith("Successfully disabled CommandSpy")) commandSpy = false; // else if (stringMessage?.startsWith("Successfully disabled CommandSpy")) commandSpy = false;
if (stringMessage === "Successfully enabled CommandSpy") commandSpy = true;
else if (stringMessage === "Successfully enabled CommandSpy.") commandSpy = true;
else if (stringMessage === "Successfully disabled CommandSpy") commandSpy = false;
else if (stringMessage === "Successfully disabled CommandSpy.") commandSpy = false;
else if (stringMessage === `Vanish for ${bot.options.username}: enabled`) vanished = true; else if (stringMessage === `Vanish for ${bot.options.username}: enabled`) vanished = true;
else if (stringMessage === `Vanish for ${bot.options.username}: disabled`) vanished = false; else if (stringMessage === `Vanish for ${bot.options.username}: disabled`) vanished = false;
else if (stringMessage === `You now have the tag: &8[&bPrefix&8: &3${config.prefixes[0]}&8]` || stringMessage === "Something went wrong while saving the prefix. Please check console.") prefix = true; else if (stringMessage === `You now have the tag: &8[&bPrefix&8: &3${config.prefixes[0]}&8]` || stringMessage === "Something went wrong while saving the prefix. Please check console.") prefix = true;
@ -58,7 +62,7 @@ function selfcare (bot, options, config) {
if (clientLock !== 4) bot._client.write("client_command", { actionId: 0 }); if (clientLock !== 4) bot._client.write("client_command", { actionId: 0 });
} else if (bot.options.isKaboom && !bot.options.isSavage) { } else if (bot.options.isKaboom && !bot.options.isSavage) {
if (permissionLevel < 2) bot.chat.command('op @s[type=player]'); if (permissionLevel < 2) bot.chat.command('op @s[type=player]');
else if (gameMode !== 1) bot.chat.command('gamemode creative @s[type=player]'); else if (gameMode !== 1) bot.chat.command('minecraft:gamemode creative');
else if (!commandSpy) bot.chat.command('commandspy on'); else if (!commandSpy) bot.chat.command('commandspy on');
else if (username) bot.chat.command(`username ${bot.options.username}`) else if (username) bot.chat.command(`username ${bot.options.username}`)
else if (nickname) bot.chat.command(`nick off`) else if (nickname) bot.chat.command(`nick off`)

View file

@ -18,7 +18,7 @@ function VanillaChat (message, data, context) {
return { sender, contents, type: 'minecraft:chat', senderComponent } return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) { } catch(e) {
console.log(e.stack) console.error(`${e.toString()}`)
} }
} }
module.exports = VanillaChat; module.exports = VanillaChat;

View file

@ -0,0 +1,25 @@
function yfdCustomChat (message, data, context, bot) {
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 3 || (message.translate !== '[%s] %s: %s' && message.translate !== '%s %s %s')) return
const senderComponent = message.with[1]
const contents = message.with[2]
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.profile.name === stringUsername)
}
if (!sender) return null
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(e)
}
}
module.exports = yfdCustomChat

View file

@ -1,6 +1,5 @@
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
//const readline = require("readline");
function loadModules (bot, options, config, discordClient) { function loadModules (bot, options, config, discordClient) {
bot.loadModule = module => module(bot, options, config, discordClient) bot.loadModule = module => module(bot, options, config, discordClient)