get this command suggestion bullshit out of here its so god damn useless i wanna die in a ditch
This commit is contained in:
parent
3a5b5bdbbc
commit
2e50641297
6 changed files with 7 additions and 80 deletions
|
@ -20,13 +20,17 @@ module.exports = {
|
|||
const discordClient = context.discordClient;
|
||||
const args = context.arguments;
|
||||
const script = args.slice(1).join(' ');
|
||||
const { MessageBuilder } = require('prismarine-chat')(bot.options.version);
|
||||
try {
|
||||
if (source.sources.console) {
|
||||
bot.console.log(bot.getMessageAsPrismarine({ text: util.inspect(eval(args.join(' ')), { stylize })})?.toAnsi())
|
||||
} else if (bot.options.useChat || bot.options.isSavage) {
|
||||
bot.chat.message(bot.getMessageAsPrismarine({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })?.toMotd().replaceAll('§','&'))
|
||||
} else {
|
||||
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
|
||||
bot.tellraw(`@a[name="${source.player.profile.name}"]`, new MessageBuilder()
|
||||
.setText(util.inspect(eval(script), { stylize }).substring(0, 32700))
|
||||
)
|
||||
/* bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
|
||||
{
|
||||
text: util.inspect(eval(script), { stylize }).substring(0, 32700),
|
||||
hoverEvent: {
|
||||
|
@ -41,7 +45,7 @@ module.exports = {
|
|||
value: `${script}`
|
||||
}
|
||||
}
|
||||
]);
|
||||
]);*/
|
||||
}
|
||||
} catch (e) {
|
||||
throw new CommandError(e.toString())
|
||||
|
|
|
@ -360,20 +360,6 @@ module.exports = {
|
|||
}
|
||||
if (bot.options.isSavage) {
|
||||
bot.chat.message(bot.getMessageAsPrismarine(component)?.toMotd().replaceAll('§','&'));
|
||||
// bot.chat.message(bot.getMessageAsPrismarine(component)?.toMotd().replaceAll('§','&'));
|
||||
// console.log(component.includes('\n'));
|
||||
// if (component.includes('\n')) {
|
||||
// console.log('e');
|
||||
// }
|
||||
// console.log(bot.getMessageAsPrismarine(component)?.toString()?.find)
|
||||
// bot.chat.message(bot.getMessageAsPrismarine(component)?.toMotd().replaceAll('§','&').replaceAll('\n','\n'));
|
||||
// bot.chat.message(bot.getMessageAsPrismarine(component)?.toMotd().replaceAll('\n','\n')?.replaceAll('§','&'));
|
||||
// console.log(component.toString());
|
||||
// console.log(component.toString().replaceAll)
|
||||
//console.log(component.find((e) => e).with)
|
||||
// for (const componentText of component.find((e) => e).with) {
|
||||
// bot.chat.message(bot.getMessageAsPrismarine(component)?.toMotd().replaceAll('§','&'))
|
||||
// }
|
||||
} else {
|
||||
bot.tellraw(`@a[name="${source.player.profile.name}"]`, component);
|
||||
}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
function commandsuggestions(context) {
|
||||
const bot = context.bot
|
||||
if (!bot.options.isKaboom) return
|
||||
bot.on('systemChat',(data)=>{
|
||||
try {
|
||||
const message = data;
|
||||
if (message.text === "fnfboyfriendbot_request_command_suggestion") {
|
||||
const extra = message.extra;
|
||||
const uuidString = extra[0]?.text;
|
||||
const uuidMatch = uuidString.match(/UUID:\[I;(-?\d+),(-?\d+),(-?\d+),(-?\d+)\]/);
|
||||
if (!uuidMatch) return;
|
||||
if (Array.isArray(extra) && extra.length > 0) {
|
||||
const commandSuggestions = {
|
||||
extra: [
|
||||
{ text: "fnfboyfriendbot_request_command_suggestion" },
|
||||
...bot.commandManager.commandlist.map((c) => {
|
||||
const aliases = c.data.aliases.length > 0 ? c.data.aliases : [];
|
||||
return {
|
||||
extra: [
|
||||
c.data.trustLevel === 0 ? "PUBLIC" :
|
||||
c.data.trustLevel === 1 ? "TRUSTED" :
|
||||
c.data.trustLevel === 2 ? "ADMIN" :
|
||||
c.data.trustLevel === 3 ? "OWNER" :
|
||||
"OWNER",
|
||||
"true",
|
||||
...aliases
|
||||
],
|
||||
text: c.data.name
|
||||
};
|
||||
})
|
||||
],
|
||||
text: ""
|
||||
};
|
||||
const jsonString = (commandSuggestions);
|
||||
bot.tellraw(`@a[nbt={UUID:[I;${uuidMatch.slice(1).map(Number)}]}]`, jsonString)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.toString() === "TypeError: Cannot read properties of undefined (reading '0')") return
|
||||
else console.log(e.toString())
|
||||
}
|
||||
})
|
||||
}
|
||||
module.exports = commandsuggestions
|
|
@ -67,26 +67,6 @@ module.exports = (context) => {
|
|||
.setColor(config.colors.commands.secondary)
|
||||
.setText("MiB")
|
||||
)
|
||||
/* component = {
|
||||
translate: "%s%s%s %s | %s: %s%s / %s%s | %s: %s%s / %s%s |",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "FNF", color: "dark_blue" },
|
||||
{ text: "Boyfriend", color: "dark_aqua" },
|
||||
{ text: "Bot", color: "blue" },
|
||||
{ text: "Memory Usage" },
|
||||
{ text: "Free Server Memory", color: config.colors.commands.primary },
|
||||
{ text: `${Math.floor(os.freemem() / 1048576)}`, color: config.colors.integer },
|
||||
{ text: "MiB", color: config.colors.commands.secondary },
|
||||
{ text: `${Math.floor(os.totalmem() / 1048576)}`, color: config.colors.integer },
|
||||
{ text: "MiB", color: config.colors.commands.secondary },
|
||||
{ text: "Bot Memory Usage", color: config.colors.commands.primary },
|
||||
{ text: `${Math.floor(process.memoryUsage().heapUsed / 1048576)}`, color: config.colors.integer },
|
||||
{ text: "MiB", color: config.colors.commands.secondary },
|
||||
{ text: `${Math.floor(process.memoryUsage().heapTotal / 1048576 )}`, color: config.colors.integer },
|
||||
{ text: "MiB", color: config.colors.commands.secondary }
|
||||
]
|
||||
}*/
|
||||
if (!bot.memUsage.enabled) return;
|
||||
bot.core.run(`minecraft:title @a[tag=!memusage] actionbar ${JSON.stringify(component)}`)
|
||||
}, 100)
|
||||
|
|
|
@ -40,6 +40,7 @@ function player_list (context) {
|
|||
bot.players = bot.players.filter(_entry => _entry.uuid !== entry.uuid)
|
||||
bot.players.push({
|
||||
uuid: entry.uuid,
|
||||
mcUUID: "",
|
||||
profile: { name: entry.player.name, properties: entry.player.properties },
|
||||
chatSession: undefined,
|
||||
gamemode: undefined,
|
||||
|
|
Loading…
Reference in a new issue