mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-29 13:45:38 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f2c073767 | ||
|
|
5000abf90d | ||
|
|
afff6aea83 | ||
|
|
2e753c583b |
+4
-2
@@ -1,4 +1,6 @@
|
||||
node_modules
|
||||
logs
|
||||
midis
|
||||
config.js
|
||||
.git
|
||||
src/modules/exploits.js
|
||||
.env
|
||||
amog
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# FNFBoyfriendBot
|
||||
|
||||
some things were git ignored from the repo that are needed for some things to work so you gotta recreate them
|
||||
|
||||
|
||||
FNFBoyfriendBot is a minecraft java bot made for the server kaboom.pw
|
||||
|
||||
# Setup:
|
||||
1. make sure to have nodejs npm and git installed
|
||||
|
||||
2. run npm i
|
||||
|
||||
3. fix some modules and stuff
|
||||
|
||||
4. edit the config
|
||||
|
||||
5. node src
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
Note: each time changes are made push them to the dev branch in the bots repo
|
||||
1. Rewrite the version argument of the info command
|
||||
2. Fix arguments for discord
|
||||
3. Try adding a argument limit for commands maybe
|
||||
4. Use the nbt parser that chayapak wrote for the bot for 1.21.5 command block output
|
||||
5. Completely remove tptoggle selfcare since it’s no longer used
|
||||
- 6. Have the bot get output from the actual core instead of a command block it places
|
||||
- 7. Add support for 1.21 and 1.21.1 while keeping support for 1.19.3 to 1.20.2
|
||||
8. Add a server check
|
||||
9. Add source.sendfeedback back maybe
|
||||
10. Add a check to sendFeedback for discord to see if the message length is longer than discord’s max message limit to output it to a file and then reply with the file in discord
|
||||
11. Add a embed function for discord maybe
|
||||
12. Have the bot output errors to a seperate file to make debugging easier
|
||||
- 13. Revert class changes for usernameGen, loadModules, between, and ansi since it wouldn’t make much sense to make them classes instead of functions (chayapaks suggestion)
|
||||
- 14. Have the bot.js class extend the event emitter (chayapak suggestion)
|
||||
15. Maybe parse cspy in the chat module and emit it as a packet maybe
|
||||
16. For the owner check module have the bot send a message to the player username thats in the config if the 18. username name is online and if theres no reply back in discord within 10 seconds (10000 ms) to start deoping, muting, kicking, and changing their gamemode
|
||||
@@ -0,0 +1,5 @@
|
||||
while true; do
|
||||
echo "Starting FNFBoyfriendBot...."
|
||||
node --max-old-space-size=1000 --trace-warnings src/index.js
|
||||
sleep 1
|
||||
done
|
||||
Generated
+1502
-598
File diff suppressed because it is too large
Load Diff
+20
-6
@@ -1,11 +1,25 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"discord.js": "^14.22.1",
|
||||
"minecraft-data": "^3.99.1",
|
||||
"minecraft-protocol": "^1.62.0",
|
||||
"prismarine-chat": "^1.12.0",
|
||||
"prismarine-registry": "^1.11.0",
|
||||
"undici": "^7.16.0",
|
||||
"@tonejs/midi": "^2.0.28",
|
||||
"@vitalets/google-translate-api": "^9.2.0",
|
||||
"axios": "^1.6.8",
|
||||
"color-convert": "^2.0.1",
|
||||
"cowsay2": "^2.0.4",
|
||||
"discord.js": "^14.14.1",
|
||||
"dockerode": "^4.0.2",
|
||||
"dotenv": "^16.4.5",
|
||||
"final-stream": "^2.0.4",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"isolated-vm": "^4.7.2",
|
||||
"matrix-js-sdk": "^31.6.1",
|
||||
"minecraft-protocol": "^1.47.0",
|
||||
"moment-timezone": "^0.5.45",
|
||||
"prismarine-chat": "^1.10.0",
|
||||
"prismarine-registry": "^1.7.0",
|
||||
"readline": "^1.3.0",
|
||||
"stream": "^0.0.2",
|
||||
"urban-dictionary": "git+https://code.chipmunk.land/chipmunkMC/urban-dictionary.git",
|
||||
"weather-js": "^2.0.0",
|
||||
"wikipedia": "^2.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// TODO: Improve how messages are stringified
|
||||
const ChatMessage = require('prismarine-chat')('1.20.2')
|
||||
const stringify = message => new ChatMessage(message).toString()
|
||||
|
||||
class CommandError extends Error {
|
||||
constructor (message, filename, lineError) {
|
||||
super(stringify(message), filename, lineError)
|
||||
this.name = 'CommandError'
|
||||
this._message = message
|
||||
|
||||
}
|
||||
|
||||
get message () {
|
||||
return stringify(this._message)
|
||||
}
|
||||
}
|
||||
module.exports = CommandError
|
||||
@@ -0,0 +1,17 @@
|
||||
class CommandSource {
|
||||
constructor (player, sources, hash, owner,) {
|
||||
this.player = player//kaboom on crack!
|
||||
// idk fr // mabe
|
||||
// /shrug
|
||||
//am i good to restart it?
|
||||
this.sources = sources
|
||||
this.hash = hash
|
||||
|
||||
this.owner = owner
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = CommandSource
|
||||
+101
-110
@@ -1,117 +1,108 @@
|
||||
const mc = require("minecraft-protocol");
|
||||
const { EventEmitter } = require("events");
|
||||
const ChatMessage = require("prismarine-chat");
|
||||
const usernameGen = require("./util/usernameGen");
|
||||
let disconnectCount = 0;
|
||||
const { EventEmitter } = require("node:events");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const util = require("node:util");
|
||||
|
||||
EventEmitter.defaultMaxListeners = Infinity;
|
||||
require("events").EventEmitter.defaultMaxListeners = Infinity;
|
||||
const ChatMessage = require('prismarine-chat')('1.20.2')
|
||||
function createBot(options = {}) {
|
||||
const bot = new EventEmitter();
|
||||
// const rs = require("randomstring");
|
||||
// Set some default values in options
|
||||
bot.options = {
|
||||
host: options.host ??= "localhost",
|
||||
username: options.username ??= "FNFBoyfriendBot",
|
||||
hideErrors: options.hideErrors ??= true, // HACK: Hide errors by default as a lazy fix to console being spammed with the console
|
||||
version: options.version ??= '1.20.2',
|
||||
|
||||
class Bot {
|
||||
constructor(options = {}, config) {
|
||||
const bot = new EventEmitter();
|
||||
bot.options = {
|
||||
// Set some default values in options
|
||||
host: (options.host ??= "localhost"),
|
||||
username: (options.username ??= usernameGen()),
|
||||
version: (options.version ??= "1.21.8"),
|
||||
hideErrors: (options.hideErrors ??= true), // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
serverName: (options.serverName ??= "localhost"),
|
||||
private: (options.private ??= false),
|
||||
reconnectDelay: (options.reconnectDelay ??= 300),
|
||||
channelId: (options.channelId ??= "0000000000000000000"),
|
||||
logging: {
|
||||
file: (options.logging.file ??= false),
|
||||
console: (options.logging.console ??= false)
|
||||
},
|
||||
mode: (options.mode ??= "kaboom"),
|
||||
selfcareInterval: (options.selfcareInterval ??= 1000),
|
||||
itemRefill: (options.itemRefill ??= false),
|
||||
chatGamemodeChange: (options.chatGamemodeChange ??= false)
|
||||
};
|
||||
},
|
||||
|
||||
bot.options = options;
|
||||
bot.options = options;
|
||||
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
bot.on("init_client", (client) => {
|
||||
client.on("packet", (data, meta) => {
|
||||
bot.emit("packet", data, meta);
|
||||
bot.emit("packet." + meta.name, data);
|
||||
});
|
||||
|
||||
client.once("login", (data) => {
|
||||
bot.uuid = client.uuid;
|
||||
bot.username = client.username;
|
||||
bot.loggedIn = true;
|
||||
disconnectCount = 0
|
||||
bot.reconnectDelay = options.reconnectDelay;
|
||||
});
|
||||
|
||||
client.on("disconnect", (data) => {
|
||||
try {
|
||||
if (
|
||||
JSON.parse(data.reason) ===
|
||||
"Wait 5 seconds before connecting, thanks! :)"
|
||||
)
|
||||
bot.reconnectDelay = 5000;
|
||||
bot.console.warn(
|
||||
`${ChatMessage(bot._client.version).fromNotch("§8[§bClient Reconnect§8]§r")?.toAnsi()} ${ChatMessage(bot._client.version).fromNotch(data.reason)?.toAnsi()}`,
|
||||
);
|
||||
bot?.discord?.channel?.send(
|
||||
ChatMessage(bot._client.version).fromNotch(data.reason)?.toString(),
|
||||
);
|
||||
} catch {} // do nothing
|
||||
});
|
||||
|
||||
client.on("end", (reason) => {
|
||||
bot.emit("end", reason);
|
||||
bot.loggedIn = false;
|
||||
disconnectCount++;
|
||||
});
|
||||
|
||||
client.on("error", (error) => {
|
||||
try {
|
||||
if (disconnectCount === 10) {
|
||||
bot.console.info("stopped logging disconnect messages for now...");
|
||||
bot?.discord?.channel?.send(
|
||||
"stopped logging disconnect messages for now...",
|
||||
);
|
||||
return;
|
||||
} else if (disconnectCount > 10) {
|
||||
return;
|
||||
} else {
|
||||
bot.console.warn(
|
||||
ChatMessage(bot._client.version)
|
||||
.fromNotch(`§8[§bClient Reconnect§8]§r ${error.stack}`)
|
||||
?.toAnsi(),
|
||||
);
|
||||
bot?.discord?.channel?.send(error.toString());
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
}
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (data) => {
|
||||
bot.console.warn(
|
||||
`${ChatMessage(bot._client.version).fromNotch("§8[§bClient Reconnect§8]§r")?.toAnsi()} ${ChatMessage(bot._client.version).fromNotch(data.reason)?.toAnsi()}`,
|
||||
);
|
||||
bot?.discord?.channel?.send(
|
||||
ChatMessage(bot._client.version).fromNotch(data.reason)?.toString(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
process.on("uncaughtException", (e) => {
|
||||
//console.log('meow')
|
||||
console.warn(`${e.stack}`);
|
||||
});
|
||||
|
||||
|
||||
const client = options.client ?? new mc.createClient(bot.options);
|
||||
bot._client = client;
|
||||
bot.emit("init_client", client);
|
||||
bot.bots = options.bots ?? [bot];
|
||||
return bot;
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
bot.on("init_client", (client) => {
|
||||
client.on("packet", (data, meta) => {
|
||||
bot.emit("packet", data, meta);
|
||||
try{
|
||||
bot.emit('packet.' + meta.name, data)
|
||||
} catch(e) {
|
||||
if(e.toString() === 'RangeError: Invalid string length'){
|
||||
bot._client.chat('Leaving to prevent crashing')
|
||||
bot._client.end()
|
||||
} else {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
});
|
||||
const timer = setInterval(() => {
|
||||
if(!bot.options.endcredits){
|
||||
return
|
||||
}else{
|
||||
bot.chat(`Join the FNFBoyfriendBot discord ${bot.options.discord.invite}`)
|
||||
}
|
||||
}, 280000)
|
||||
|
||||
client.on("login", async function (data) {
|
||||
bot.uuid = client.uuid;
|
||||
bot.username = client.username;
|
||||
bot.port = bot.options.port;
|
||||
bot.version = bot.options.version;
|
||||
if (bot.options.isCreayun) {
|
||||
bot.command('server creative')
|
||||
}
|
||||
try {
|
||||
var day = new Date().getDay()
|
||||
if (day === 5) {
|
||||
bot.sendFeedback({text:"Gettin' freaky on a Friday Night!"})
|
||||
} else {
|
||||
bot.sendFeedback({text:`${process.env.buildstring}`})
|
||||
}
|
||||
}catch(e){
|
||||
}
|
||||
timer
|
||||
})
|
||||
client.on("end", (reason) => {
|
||||
bot.emit("end", reason);
|
||||
bot.console.warn(`Disconnected: ${reason.toString()}`);
|
||||
bot.cloop.clear()
|
||||
bot.memusage.off()
|
||||
bot.tps.off()
|
||||
bot.bruhifyText = ''
|
||||
clearInterval(timer)
|
||||
bot?.discord?.channel?.send('``Disconnected:' + reason.toString() + '``' )
|
||||
|
||||
});
|
||||
|
||||
client.on("disconnect", (reason) => {
|
||||
bot.emit("disconnect", reason);
|
||||
bot.console.warn(`Disconnected: ${reason.toString()}`);
|
||||
bot?.discord?.channel?.send('``Disconnected:' + reason.toString() + '``' )
|
||||
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (reason) => {
|
||||
bot.emit("kick_disconnect", reason);
|
||||
bot.console.warn(`Disconnected: ${reason.toString()}`);
|
||||
bot?.discord?.channel?.send('``Disconnected:' + reason.toString() + '``')
|
||||
});
|
||||
client.on("keep_alive", ({ keepAliveId }) => {
|
||||
bot.emit("keep_alive", { keepAliveId });
|
||||
});
|
||||
|
||||
client.on("error", (error) => {
|
||||
bot?.discord?.channel?.send('``' + error.toString() + '``' )
|
||||
bot.emit("error", error)
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
const client = options.client ?? mc.createClient(options);
|
||||
bot._client = client;
|
||||
bot.emit("init_client", client);
|
||||
bot.bots = options.bots ?? [bot];
|
||||
return bot;
|
||||
}
|
||||
module.exports = Bot;
|
||||
|
||||
|
||||
module.exports = createBot;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
function chatTypeEmote (message, data, context) {
|
||||
try{
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 2 || (message.translate !== 'chat.type.emote' && message.translate !== '%s %s')) return
|
||||
|
||||
const senderComponent = message.with[0]
|
||||
// wtf spam again - console.log(senderComponent)//wtf...
|
||||
//console.log(senderComponent)
|
||||
|
||||
const contents = message.with[1]
|
||||
// spam lol - console.log(contents)
|
||||
//console.log(contents)
|
||||
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 undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}catch(e){
|
||||
console.log(e.stack)
|
||||
}
|
||||
}
|
||||
module.exports = chatTypeEmote
|
||||
@@ -0,0 +1,34 @@
|
||||
function chatTypeText (message, data, context) {
|
||||
try {
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 2 || (message.translate !== 'chat.type.text' && message.translate !== '%s %s')) return
|
||||
|
||||
const senderComponent = message.with[0]
|
||||
// wtf spam again - console.log(senderComponent)//wtf...
|
||||
//console.log(senderComponent)
|
||||
|
||||
const contents = message.with[1]
|
||||
// spam lol - console.log(contents)
|
||||
//console.log(contents)
|
||||
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 undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}catch(e){
|
||||
console.log(e.stack)
|
||||
}
|
||||
}
|
||||
module.exports = chatTypeText
|
||||
@@ -0,0 +1,35 @@
|
||||
function chipmunkmod (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]
|
||||
// wtf spam again -
|
||||
//console.log(senderComponent)//wtf...
|
||||
|
||||
|
||||
const contents = message.with[2]
|
||||
// spam lol - console.log(contents)
|
||||
let sender
|
||||
|
||||
const hoverEvent = senderComponent.hoverEvent
|
||||
//console.log(JSON.stringify(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 = chipmunkmod
|
||||
@@ -0,0 +1,27 @@
|
||||
function chipmunkmodBlackilyKat (message, data) {
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 4 || (message.translate !== '[%s%s] %s › %s', message.color !== '#55FFFF' && message.translate !== '%s%s %s › %s', message.color !== '#55FFFF')) return
|
||||
|
||||
const senderComponent = message.with[1]
|
||||
const contents = message.with[3]
|
||||
|
||||
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 undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}
|
||||
|
||||
module.exports = chipmunkmodBlackilyKat
|
||||
@@ -0,0 +1,33 @@
|
||||
function creayun (messageobj, data) { // this function is not getting called
|
||||
const ChatMessage = require('prismarine-chat')('1.20.1')
|
||||
const stringify = message => new ChatMessage(message).toString()
|
||||
const message = stringify(messageobj);
|
||||
var pattern = /^(.*?) (\S*?) » (.*?)$/;
|
||||
// var pattern = /^(.*?) (\S*?) \u203a (.*?)$/;
|
||||
//console.log('[debug] parsing a message');
|
||||
const match = message.match(pattern);
|
||||
if(pattern.test(message)) {
|
||||
// console.log('[debug]', match);
|
||||
return { sender: match[2], contents: match[3], type: 'minecraft:chat'}; //
|
||||
} else {
|
||||
//console.log('[debug] pattern does not match');
|
||||
}//i just realized that the bot uses tellraw
|
||||
//ima try to fix that
|
||||
}//it picks players up as undefined in creayun
|
||||
//and i tried using the kaboom chat parser but edited and that didnt work
|
||||
// [] username »
|
||||
module.exports = creayun//:troll:
|
||||
// •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
|
||||
// function(function(function(function(function(function(function(function(function(function(function(function(function(function(function(function)))))))))))))))
|
||||
// i guess so because it connects you
|
||||
// i think?
|
||||
//🐔💨💩😎🐒🥶😁😂⏰❌🐒🛏
|
||||
//very real
|
||||
// theres so much things that get logged :sob:
|
||||
//gotta love when it refuses to connect
|
||||
// someones trying to be fake me in kaboom
|
||||
//the bot is being waaay to sus
|
||||
// i will crash him when i get on // sus // very
|
||||
//k
|
||||
// getting the fake parker out of kaboom
|
||||
// pcrashed
|
||||
@@ -21,10 +21,8 @@ function kaboom (message, data) {
|
||||
}
|
||||
|
||||
const playerListDisplayName = { extra: [prefix, displayName], text: '' }
|
||||
|
||||
let sender
|
||||
|
||||
if (data.senderUuid) {
|
||||
if (data.uuid) {
|
||||
sender = data.players.find(player => player.uuid === data.senderUuid)
|
||||
} else {
|
||||
const playerListDisplayName = { extra: [prefix, displayName], text: '' }
|
||||
@@ -33,7 +31,7 @@ function kaboom (message, data) {
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: "minecraft:chat", displayName, chatType: data.chatType }
|
||||
return { sender, contents, type: 'minecraft:chat', displayName }
|
||||
}
|
||||
|
||||
function isSeparatorAt (children, start) {
|
||||
@@ -41,3 +39,4 @@ function isSeparatorAt (children, start) {
|
||||
}
|
||||
|
||||
module.exports = kaboom
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
function chipmunkmod(message, data) {
|
||||
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.hover_event;
|
||||
// console.log(hoverEvent)
|
||||
if (hoverEvent?.action === "show_entity") {
|
||||
const id = hoverEvent.uuid;
|
||||
|
||||
sender = data.players.find((player) => player.entityUuid[0] === id[0])//.entityUuid //=== hoverEvent.uuid)//.entityUuid;
|
||||
} else {
|
||||
const stringUsername = data
|
||||
.getMessageAsPrismarine(senderComponent)
|
||||
?.toString();
|
||||
|
||||
sender = data.players.find(
|
||||
(player) => player.profile.name === stringUsername,
|
||||
);
|
||||
}
|
||||
|
||||
if (!sender) return null;
|
||||
|
||||
return {
|
||||
sender,
|
||||
contents,
|
||||
type: "minecraft:chat",
|
||||
senderComponent,
|
||||
chatType: data.chatType
|
||||
};
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
module.exports = chipmunkmod;
|
||||
@@ -1,26 +0,0 @@
|
||||
const ChatMessage = require("prismarine-chat")("1.20.2");
|
||||
const util = require("util");
|
||||
function parseMessage(messageobj, data) {
|
||||
try {
|
||||
let match;
|
||||
let sender;
|
||||
const stringify = (message) => new ChatMessage(message).toString();
|
||||
const message = stringify(messageobj);
|
||||
const playerWithPrefix = /^(.*?) (\S*?) » (.*?)$/;
|
||||
const playerWithoutPrefix = /^(\S*?) » (.*?)$/;
|
||||
if (playerWithPrefix.test(message)) {
|
||||
match = message.match(playerWithPrefix);
|
||||
|
||||
sender = data.players.find((player) => player.profile.name === match[2]);
|
||||
return {
|
||||
sender,
|
||||
contents: match[3],
|
||||
type: "minecraft:chat",
|
||||
chatType: data.chatType
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
}
|
||||
}
|
||||
module.exports = parseMessage;
|
||||
@@ -1,31 +0,0 @@
|
||||
function me (message, data) {
|
||||
try {
|
||||
if (message === null || typeof message !== "object") return;
|
||||
|
||||
if (message.with?.length > 2 || message.translate !== "chat.type.announcement") return;
|
||||
|
||||
const component = message.with[0];
|
||||
const contents = message.with[1];
|
||||
let sender;
|
||||
const hoverEvent = component.hover_event
|
||||
|
||||
if (hoverEvent?.action === "show_entity") {
|
||||
const name = hoverEvent.name;
|
||||
sender = data.players.find((player) => player.profile.name === name)
|
||||
}
|
||||
|
||||
if (!sender) return;
|
||||
|
||||
return {
|
||||
sender,
|
||||
contents,
|
||||
type: "minecraft:chat",
|
||||
component,
|
||||
chatType: data.chatType
|
||||
};
|
||||
} catch (e) {
|
||||
console.log(e.stack)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = me;
|
||||
@@ -1,5 +0,0 @@
|
||||
function say (message, data) {
|
||||
|
||||
}
|
||||
|
||||
module.exports = say;
|
||||
@@ -1,37 +0,0 @@
|
||||
function vanilla(message, data) {
|
||||
try {
|
||||
if (message === null || typeof message !== "object") return;
|
||||
|
||||
if (
|
||||
message.with?.length < 2 ||
|
||||
(message.translate !== "chat.type.text" && message.translate !== "%s %s")
|
||||
)
|
||||
return;
|
||||
const senderComponent = message.with[0];
|
||||
const contents = message.with[1];
|
||||
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();
|
||||
sender = data.players.find(
|
||||
(player) => player.profile.name === stringUsername,
|
||||
);
|
||||
}
|
||||
if (!sender) return;
|
||||
return {
|
||||
sender,
|
||||
contents,
|
||||
type: "minecraft:chat",
|
||||
senderComponent,
|
||||
chatType: data.chatType
|
||||
};
|
||||
} catch (e) {
|
||||
console.error(`${e.stack}`);
|
||||
}
|
||||
}
|
||||
module.exports = vanilla;
|
||||
@@ -1,38 +0,0 @@
|
||||
const CommandError = require('./CommandError');
|
||||
const translations = require('../data/translations.json');
|
||||
|
||||
class CommandArguments {
|
||||
static getInteger (integer) {
|
||||
if (isNaN(integer)) throw new CommandError({
|
||||
translate: "fnfboyfriendbot.arguments.invalid_integer",
|
||||
fallback: translations["fnfboyfriendbot.arguments.invalid_integer"],
|
||||
color: "red",
|
||||
with: [
|
||||
{ text: `${integer}` }
|
||||
]
|
||||
})
|
||||
else return String(Number(integer))
|
||||
}
|
||||
|
||||
static getJson (json) {
|
||||
|
||||
}
|
||||
|
||||
static getArguments () {
|
||||
|
||||
}
|
||||
|
||||
static getMaxArguments (commandArgs, args) {
|
||||
if (commandArgs < args) throw new CommandError({
|
||||
translate: "fnfboyfriendbot.arguments.max_exceeded",
|
||||
fallback: translations["fnfboyfriendbot.arguments.max_exceeded"],
|
||||
color: "red",
|
||||
with: [
|
||||
{ text: `${commandArgs}` },
|
||||
{ text: `${args}` }
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CommandArguments;
|
||||
@@ -1,12 +0,0 @@
|
||||
class CommandContext {
|
||||
constructor(name, aliases, description, trustLevel, usages, playerChatOnly) {
|
||||
this.data = {};
|
||||
this.data.name = name;
|
||||
this.data.aliases = aliases;
|
||||
this.data.description = description;
|
||||
this.data.trustLevel = trustLevel;
|
||||
this.data.usages = usages;
|
||||
this.data.playerChatOnly = playerChatOnly
|
||||
}
|
||||
}
|
||||
module.exports = CommandContext;
|
||||
@@ -1,15 +0,0 @@
|
||||
const ChatMessage = require("prismarine-chat")("1.21.8");
|
||||
const stringify = (message) => new ChatMessage(message)?.toString();
|
||||
|
||||
class CommandError extends Error {
|
||||
constructor(message, filename, lineError) {
|
||||
super(stringify(message), filename, lineError);
|
||||
this.name = "CommandError";
|
||||
this._message = message;
|
||||
}
|
||||
|
||||
get message() {
|
||||
return stringify(this._message);
|
||||
}
|
||||
}
|
||||
module.exports = CommandError;
|
||||
@@ -1,9 +0,0 @@
|
||||
class CommandSource {
|
||||
constructor(player, sources, ChatType) {
|
||||
this.player = player;
|
||||
this.sources = sources;
|
||||
this.ChatType = ChatType;
|
||||
this.player.trustLevel = 0;
|
||||
}
|
||||
}
|
||||
module.exports = CommandSource;
|
||||
@@ -1,10 +0,0 @@
|
||||
class CommandTrustLevel {
|
||||
static public = 0;
|
||||
static trusted = 1;
|
||||
static admin = 2;
|
||||
static owner = 3;
|
||||
static console = 4;
|
||||
static disabled = 5;
|
||||
}
|
||||
|
||||
module.exports = CommandTrustLevel;
|
||||
@@ -1,155 +0,0 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class CoresettingsCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("coresettings", ["cbsettings"], "change the bots core settings", 2, [
|
||||
"useplacedcommandblock <on/off/true/false/enable/disable>",
|
||||
"area start <positions>",
|
||||
"area end <positions>",
|
||||
"refillmethod/rcmethod <item/chat>",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const source = context.source;
|
||||
let component = [];
|
||||
|
||||
if (
|
||||
!args &&
|
||||
!args[0] &&
|
||||
!args[1] &&
|
||||
!args[2] &&
|
||||
!args[3] &&
|
||||
!args[4] &&
|
||||
!args[5]
|
||||
)
|
||||
return;
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "useplacedcommandblock":
|
||||
switch (args[2]?.toLowerCase()) {
|
||||
case "on":
|
||||
case "true":
|
||||
case "enable":
|
||||
bot.core.usePlacedCommandBlock = true;
|
||||
component.push({
|
||||
text: "now using the placed command block",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
break;
|
||||
case "off":
|
||||
case "false":
|
||||
case "disable":
|
||||
bot.core.usePlacedCommandBlock = false;
|
||||
component.push({
|
||||
text: "no longer using the placed command block",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
if (bot.core.usePlacedCommandBlock) {
|
||||
component.push({
|
||||
text: "the bot is currently using the placed command block to run its commands",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
} else {
|
||||
component.push({
|
||||
text: "the bot is currently using its command block core to run its commands",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "area":
|
||||
switch (args[2]?.toLowerCase()) {
|
||||
case "start":
|
||||
if (isNaN(args[3]) || isNaN(args[4]) || isNaN(args[5])) {
|
||||
bot.core.area.start = config.core.area.start;
|
||||
component.push({
|
||||
text: "arguments were NaN, defaulting to config core start coords",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
} else {
|
||||
bot.core.area.start = {
|
||||
x: Number(args[3]),
|
||||
y: Number(args[4]),
|
||||
z: Number(args[5]),
|
||||
};
|
||||
component.push({
|
||||
text: `setting core start pos to x: ${args[3]}, y: ${args[4]}, z: ${args[5]}`,
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "end":
|
||||
if (isNaN(args[3]) || isNaN(args[4]) || isNaN(args[5])) {
|
||||
bot.core.area.end = config.core.area.end;
|
||||
throw new CommandError(
|
||||
"arguments were NaN, defaulting to config core end coords",
|
||||
);
|
||||
} else {
|
||||
bot.core.area.end = {
|
||||
x: Number(args[3]),
|
||||
y: Number(args[4]),
|
||||
z: Number(args[5]),
|
||||
};
|
||||
|
||||
component.push({
|
||||
text: `setting core end pos to x: ${args[3]}, y: ${args[4]}, z: ${args[5]}`,
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
component.push({
|
||||
text: `core start pos: x: ${bot.core.area.start.x}, y: ${bot.core.area.start.y}, z: ${bot.core.area.start.z}, and end pos: x: ${bot.core.area.end.x}, y: ${bot.core.area.end.y}, z: ${bot.core.area.end.z}`,
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "refillmethod":
|
||||
case "rcmethod":
|
||||
switch (args[2]?.toLowerCase()) {
|
||||
case "item":
|
||||
config.core.itemRefill = true;
|
||||
component.push({
|
||||
text: "now refilling via item",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
break;
|
||||
case "chat":
|
||||
config.core.itemRefill = false;
|
||||
component.push({
|
||||
text: "now refilling via chat",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
if (config.core.itemRefill) {
|
||||
component.push({
|
||||
text: "currently filling core via item",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
} else {
|
||||
component.push({
|
||||
text: "currently filling core via chat",
|
||||
color: config.colors.commands.primary,
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new CommandError("invalid argument");
|
||||
}
|
||||
|
||||
if (source.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CoresettingsCommand;
|
||||
@@ -1,37 +0,0 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class KickCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("kick", [], "kick a player from the server", 2, [
|
||||
"invalidstring",
|
||||
"item",
|
||||
"te",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return;
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "invalidstring":
|
||||
bot.exploits.crashes.invalidString(args[2]);
|
||||
bot.tellraw("@a", `crashing ${args[2]}`);
|
||||
break;
|
||||
case "item":
|
||||
bot.exploits.kicks.item(args[2]);
|
||||
bot.tellraw("@a", `kicking ${args[2]}`);
|
||||
break;
|
||||
case "te":
|
||||
bot.exploits.kicks.translateEntity(args[2]);
|
||||
bot.tellraw("@a", `kicking ${args[2]}`);
|
||||
break;
|
||||
default:
|
||||
throw new CommandError("invalid argument");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = KickCommand;
|
||||
@@ -1,13 +0,0 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class ReconnectCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("reconnect", ["end"], "reconnects the bot", 2, [""]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
bot._client.end();
|
||||
bot.chat.message("reconnecting");
|
||||
}
|
||||
}
|
||||
module.exports = ReconnectCommand;
|
||||
@@ -1,118 +0,0 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
|
||||
class ConsoleCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("console", ["c"], "runs commands made for the bots console", 4, [
|
||||
"server/srv <all/servername>",
|
||||
"customchat <on/true/enable/off/false/disable>",
|
||||
"say <message>",
|
||||
"validate/validation/val <owner/o/admin/a/trusted/t>",
|
||||
"logging/togglelogging/logtoconsole <on/true/enable/off/false/disable>",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
const config = context.config;
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return;
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "server":
|
||||
case "svr":
|
||||
const servers = bot.bots.map((eachBot) => eachBot.options.serverName);
|
||||
for (const eachBot of bot.bots) {
|
||||
if (args.slice(1).join(" ").toLowerCase() === "all") {
|
||||
eachBot.console.server = "all";
|
||||
bot.console.info("Set the console server to all");
|
||||
continue;
|
||||
}
|
||||
const server = servers.find((server) =>
|
||||
server.toLowerCase().includes(args[1]),
|
||||
);
|
||||
if (!server) {
|
||||
bot.console.info("Invalid server");
|
||||
return;
|
||||
}
|
||||
bot.console.info(`Set the console server to ` + server);
|
||||
eachBot.console.server = server;
|
||||
}
|
||||
break;
|
||||
case "say":
|
||||
bot.chat.send(args.slice(1).join(" "));
|
||||
break;
|
||||
case "validate":
|
||||
case "validation":
|
||||
case "val":
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "owner":
|
||||
case "o":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
case "admin":
|
||||
case "a":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
case "trusted":
|
||||
case "t":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "logging":
|
||||
case "togglelogging":
|
||||
case "logtoconsole":
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "on":
|
||||
case "enable":
|
||||
case "enabled":
|
||||
case "true":
|
||||
if (bot.options.logging === true) {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is already enabled!`,
|
||||
);
|
||||
} else {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is now enabled`,
|
||||
);
|
||||
bot.options.logging = true;
|
||||
}
|
||||
break;
|
||||
case "off":
|
||||
case "disable":
|
||||
case "disabled":
|
||||
case "false":
|
||||
if (bot.options.logging === false) {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is already disabled!`,
|
||||
);
|
||||
} else {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is now disabled`,
|
||||
);
|
||||
bot.options.logging = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ConsoleCommand;
|
||||
@@ -1,12 +0,0 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class KillCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("kill", ["suicide", "quit"], "kill the bots process", 3, [""]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
module.exports = KillCommand;
|
||||
@@ -1,42 +0,0 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const { stylize } = require("../../util/stylizeEval");
|
||||
const util = require("util");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class ServerevalCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("servereval", ["se"], "run code unisolated", 4, ["<code>"]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
const config = context.config;
|
||||
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.mode === "savageFriends") {
|
||||
bot.core.run(
|
||||
`minecraft:tellraw @a ${JSON.stringify(util.inspect(eval(script), { stylize }).substring(0, 32700))}`,
|
||||
);
|
||||
} else {
|
||||
bot.tellraw(`@a[name="${source.player.profile.name}"]`, {
|
||||
text: `${util.inspect(eval(script), { stylize }).substring(0, 32700)}`,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
throw new CommandError(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ServerevalCommand;
|
||||
@@ -1,36 +0,0 @@
|
||||
const sleep = require("../../util/sleep");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class core extends CommandContext {
|
||||
constructor() {
|
||||
super("core", ["cb", "cbrun", "corerun"], "run commands in core", 0, [
|
||||
"$username <message>",
|
||||
"$uuid <message>",
|
||||
"<message>",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
|
||||
if (args.includes("$username") || args.includes("$uuid")) {
|
||||
bot.players.forEach((eachPlayer) => {
|
||||
bot.core.runTracked(
|
||||
args
|
||||
.join(" ")
|
||||
.replaceAll("$username", eachPlayer.profile.name)
|
||||
.replaceAll("$uuid", eachPlayer.uuid),
|
||||
source,
|
||||
);
|
||||
// await sleep(1000)
|
||||
});
|
||||
} else if (bot.options.mode === "savageFriends") {
|
||||
bot.core.run(args.join(" "));
|
||||
} else {
|
||||
bot.core.runTracked(args.join(" "), source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = core;
|
||||
@@ -1,18 +0,0 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class EchoCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("echo", ["say", "botsay"], "make me say something!", 0, [
|
||||
"<message>",
|
||||
]);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
|
||||
bot.chat.send(`${args.join(" ")}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = EchoCommand;
|
||||
@@ -1,446 +0,0 @@
|
||||
const fixansi = require("../../util/ansi");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class HelpCommand extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"help",
|
||||
["heko", "?", "cmds", "commands", "hell"],
|
||||
"see a list of commands",
|
||||
0,
|
||||
["<command>"],
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const source = context.source;
|
||||
|
||||
let component = [];
|
||||
let infoComponent = [];
|
||||
let usagesComponent = [];
|
||||
let Public = [];
|
||||
let trusted = [];
|
||||
let admin = [];
|
||||
let owner = [];
|
||||
let Console = [];
|
||||
|
||||
let cat = {
|
||||
translate: "(%s | %s | %s | %s)",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Public", color: config.colors.help.public },
|
||||
{ text: "Trusted", color: config.colors.help.trusted },
|
||||
{ text: "Admin", color: config.colors.help.admin },
|
||||
{ text: "Owner", color: config.colors.help.owner },
|
||||
],
|
||||
};
|
||||
|
||||
component.push({
|
||||
translate: "%s: (%s) %s \u203a\n",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Commands", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${bot.commandManager.commandlist.length}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
cat,
|
||||
],
|
||||
});
|
||||
for (const commands of bot.commandManager.commandlist) {
|
||||
switch (commands.data.trustLevel) {
|
||||
case 0:
|
||||
Public.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.public,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
trusted.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.trusted,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
admin.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.admin,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
owner.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.owner,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 4:
|
||||
Console.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.console,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Command Name",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Trust Level",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Description",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.usages}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "suggest_command",
|
||||
value: `${config.prefixes[0]}${commands.data.name}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
default:
|
||||
bot.chat.message(
|
||||
`fuck you ${commands.data.name} has a invalid trust level`,
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
args[0]?.toLowerCase() === commands.data.name?.toLowerCase() ||
|
||||
commands.data.aliases.find(
|
||||
(e) => e?.toLowerCase() === args[0]?.toLowerCase(),
|
||||
)
|
||||
) {
|
||||
for (const usages of commands.data.usages) {
|
||||
usagesComponent.push({
|
||||
translate: "%s%s %s",
|
||||
with: [
|
||||
{
|
||||
text: `${config.prefixes[0]}`,
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: `${usages}`, color: config.colors.commands.secondary },
|
||||
],
|
||||
});
|
||||
|
||||
usagesComponent.push("\n");
|
||||
}
|
||||
|
||||
usagesComponent.pop();
|
||||
|
||||
infoComponent.push({
|
||||
translate: "%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s:\n",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Name", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Aliases", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.aliases.toString().replaceAll(",", " ")}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Description", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.description}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Trust Level", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${commands.data.trustLevel}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "Usages", color: config.colors.commands.primary },
|
||||
],
|
||||
});
|
||||
|
||||
infoComponent.push(usagesComponent);
|
||||
|
||||
if (source?.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(infoComponent)?.toAnsi());
|
||||
} else if (source.sources.discord) {
|
||||
bot.discord.message.reply(
|
||||
`\`\`\`ansi\n${fixansi(bot.getMessageAsPrismarine(infoComponent)?.toAnsi())}\`\`\``,
|
||||
);
|
||||
} else {
|
||||
bot.tellraw(`@a`, infoComponent);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Public.length > 0) {
|
||||
component.push(Public);
|
||||
if (trusted.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (trusted.length > 0) {
|
||||
component.push(trusted);
|
||||
if (admin.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (admin.length > 0) {
|
||||
component.push(admin);
|
||||
if (owner.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (owner.length > 0) {
|
||||
component.push(owner);
|
||||
}
|
||||
|
||||
if (source.sources.console && Console.length > 0) {
|
||||
component.push(Console);
|
||||
}
|
||||
|
||||
if (source?.sources?.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else if (source.sources.discord) {
|
||||
bot.discord.message.reply(
|
||||
`\`\`\`ansi\n${fixansi(bot.getMessageAsPrismarine(component)?.toAnsi())}\`\`\``,
|
||||
);
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = HelpCommand;
|
||||
@@ -1,608 +0,0 @@
|
||||
const os = require("os");
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const fs = require("fs");
|
||||
const botInfo = require("../../data/info.json");
|
||||
const fixansi = require("../../util/ansi.js");
|
||||
const { execSync } = require("child_process");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
function format(seconds) {
|
||||
function pad(s) {
|
||||
return (s < 10 ? "0" : "") + s;
|
||||
}
|
||||
var hours = Math.floor(seconds / (60 * 60));
|
||||
var minutes = Math.floor((seconds % (60 * 60)) / 60);
|
||||
var seconds = Math.floor(seconds % 60);
|
||||
return (
|
||||
pad(`${hours} Hours`) +
|
||||
" " +
|
||||
pad(`${minutes} Minutes`) +
|
||||
" " +
|
||||
pad(`${seconds} Seconds`)
|
||||
);
|
||||
}
|
||||
|
||||
class InfoCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("info", ["information"], "check the bots info", 0, [
|
||||
"about",
|
||||
"config <client, discord, options, all>",
|
||||
"contributors/credits",
|
||||
"discord",
|
||||
"loaded",
|
||||
"usages <bot, server, all>",
|
||||
"uptimes/uptime <bot, server, all>",
|
||||
"server",
|
||||
"version/ver",
|
||||
]);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const discordClient = context.discordClient;
|
||||
const source = context.source;
|
||||
let component = [];
|
||||
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "about":
|
||||
component.push({
|
||||
text: `FNFBoyfriendBot is a kaboom bot created by Parker2991\nThe source code and changelog can be found here ${botInfo.buildstring.url}`,
|
||||
color: `${config.colors.commands.primary}`,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "click here to view bots source code",
|
||||
color: `${config.colors.commands.primary}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `${botInfo.buildstring.url}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case "config":
|
||||
if (bot.options.isKaboom) {
|
||||
mode = "Kaboom";
|
||||
}
|
||||
if (bot.options.useChat && bot.options.isKaboom) {
|
||||
mode = "Kaboom/Coreless";
|
||||
}
|
||||
if (bot.options.isSavage) {
|
||||
mode = "Savage";
|
||||
}
|
||||
if (bot.options.isCreayun) {
|
||||
mode = "Creayun";
|
||||
}
|
||||
switch (args.slice(1).join(" ")?.toLowerCase()) {
|
||||
case "client":
|
||||
component.push({
|
||||
translate: "%s: %s:%s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Server", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${bot.options.host}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: `${bot.options.port}`, color: config.colors.integer },
|
||||
{ text: "Server Name", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${bot.options.serverName}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Minecraft Username",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${bot.options.username}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Version", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${bot.options.version}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "discord":
|
||||
if (!config.discord.enabled || discordClient.user === null) {
|
||||
throw new CommandError(
|
||||
"Token is incorrect or discord isnt enabled!",
|
||||
);
|
||||
} else {
|
||||
component.push({
|
||||
translate: "%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Discord Username",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${discordClient.user.tag}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Discord Channel",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${bot.discord?.channel?.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "options":
|
||||
component.push({
|
||||
translate: "%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Server Count", color: config.colors.commands.primary },
|
||||
{ text: `${bot.bots.length}`, color: config.colors.integer },
|
||||
{ text: "Prefixes", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${config.prefixes.map((e) => e + " ").join(" ")}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Mode", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${bot.options.mode}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "all":
|
||||
component.push({
|
||||
translate:
|
||||
"%s: %s:%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Server", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${bot.options.host}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: `${bot.options.port}`, color: config.colors.integer },
|
||||
{ text: "Server Name", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${bot.options.serverName}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Minecraft Username",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${bot.options.username}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Version", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${bot.options.version}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Discord Username",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${discordClient.user?.tag}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Discord Channel",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${bot.discord.channel?.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Server Count", color: config.colors.commands.primary },
|
||||
{ text: `${bot.bots.length}`, color: config.colors.integer },
|
||||
{ text: "Prefixes", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${config.prefixes.map((e) => e + " ").join(" ")}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Mode", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${bot.options.mode}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "contributors":
|
||||
case "credits":
|
||||
component.push({
|
||||
translate: "%s%s - %s\n%s:\n%s\n%s\n%s\n%s\n%s %s\n%s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Parker", color: "dark_red" },
|
||||
{ text: "2991", color: "black" },
|
||||
{ text: "Owner" },
|
||||
{ text: "Contributors" },
|
||||
{ text: "_ChipMC_", color: "dark_blue" },
|
||||
{ text: "chayapak", color: "yellow" },
|
||||
{ text: "_yfd", color: "light_purple" },
|
||||
{ text: "aaa", color: "gold" },
|
||||
{ text: "Morgan", color: "green" },
|
||||
{ text: "Ankan", color: "dark_green" },
|
||||
{ text: "TurtleKid", color: "green" },
|
||||
{ text: "Ploat/ImGloriz", color: "#cd8ccb" },
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "discord":
|
||||
component.push({
|
||||
text: `the discord server invite is ${config.discord.invite}`,
|
||||
color: config.colors.commands.primary,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "click here to join the discord server!",
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `${config.discord.invite}`,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case "loaded":
|
||||
component.push({
|
||||
translate: "%s %s\n%s %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: `${bot.commandManager.commandlist.length}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "Commands", color: config.colors.commands.primary },
|
||||
{ text: `${bot.modules.length}`, color: config.colors.integer },
|
||||
{ text: "Modules", color: config.colors.commands.primary },
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "usages":
|
||||
case "usage":
|
||||
switch (args.slice(1).join(" ")?.toLowerCase()) {
|
||||
case "bot":
|
||||
component.push({
|
||||
translate: "%s: %s %s / %s %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Bot Memory",
|
||||
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 },
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "server":
|
||||
component.push({
|
||||
translate: "%s: %s %s / %s %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Server Memory",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${Math.floor(os.totalmem() / 1048576) - Math.floor(os.freemem() / 1048576)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "MB", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${Math.floor(os.totalmem() / 1048576)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "MB", color: config.colors.commands.secondary },
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "all":
|
||||
component.push({
|
||||
translate: "%s: %s %s / %s %s\n%s: %s %s / %s %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Server Memory",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${Math.floor(os.totalmem() / 1048576) - Math.floor(os.freemem() / 1048576)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "MB", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${Math.floor(os.totalmem() / 1048576)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "MB", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: "Bot Memory",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${Math.floor(process.memoryUsage().heapUsed / 1048576)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "MB", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${Math.floor(process.memoryUsage().heapTotal / 1048576)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "MB", color: config.colors.commands.secondary },
|
||||
],
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "uptimes":
|
||||
switch (args.slice(1).join(" ")?.toLowerCase()) {
|
||||
case "bot":
|
||||
component.push({
|
||||
translate: "%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Bot Uptime", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${format(process.uptime())}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "server":
|
||||
component.push({
|
||||
translate: "%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: "Server Uptime",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${format(os.uptime())}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "all":
|
||||
component.push({
|
||||
translate: "%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Bot Uptime", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${format(process.uptime())}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Server Uptime",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${format(os.uptime())}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
break;
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "server":
|
||||
component.push({
|
||||
translate:
|
||||
"%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Hostname", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${os.hostname()}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "User", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${os.userInfo().username}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: "Working Directory",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${require.main.path}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Arch", color: config.colors.commands.primary },
|
||||
{ text: `${os.arch()}`, color: config.colors.commands.secondary },
|
||||
{ text: "OS", color: config.colors.commands.primary },
|
||||
{ text: `${os.platform}`, color: config.colors.commands.secondary },
|
||||
{ text: "OS Version", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${os.version()}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Kernel Version", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${os.release()}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "CPU", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${os.cpus()[0].model}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "CPU cores", color: config.colors.commands.primary },
|
||||
{ text: `${os.cpus().length}`, color: config.colors.integer },
|
||||
{ text: "Processes", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${execSync("ps aux | wc -l").toString().replace("\n", "")}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "Node Version", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${process.version}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "NPM Version", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${execSync("npm -v").toString().replaceAll("\n", "")}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "version":
|
||||
case "ver":
|
||||
if (botInfo.buildstring.codename.length > 0) {
|
||||
component.push({
|
||||
translate: "%s %s %s-%s-%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s-%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Friday Night Funkin", color: "dark_blue" },
|
||||
{ text: "Boyfriend", color: "dark_aqua" },
|
||||
{ text: "Bot", color: "blue" },
|
||||
{
|
||||
text: `${botInfo.buildstring.version}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
botInfo.buildstring.codename,
|
||||
{ text: "Build", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${botInfo.buildstring.build}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "Repo Build", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${execSync("git rev-list --count --all").toString().replaceAll("\n", "")}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Version Release Date",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${new Date(execSync("git log -1 --format=%ci").toString()).toLocaleString("en-US", { timeZone: "America/CHICAGO" })}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Commit", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${execSync("git rev-parse HEAD").toString().substring(0, 10)}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "11/22/22", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
} else {
|
||||
component.push({
|
||||
translate: "%s %s %s-%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s-%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Friday Night Funkin", color: "dark_blue" },
|
||||
{ text: "Boyfriend", color: "dark_aqua" },
|
||||
{ text: "Bot", color: "blue" },
|
||||
{
|
||||
text: `${botInfo.buildstring.version}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "Build", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${botInfo.buildstring.build}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "Repo Build", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${execSync("git rev-list --count --all").toString().replaceAll("\n", "")}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: "Version Release Date",
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${new Date(execSync("git log -1 --format=%ci").toString()).toLocaleString("en-US", { timeZone: "America/CHICAGO" })}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Commit", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${execSync("git rev-parse HEAD").toString().substring(0, 10)}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "11/22/22", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
|
||||
if (source?.sources?.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else if (source.sources.discord) {
|
||||
bot.discord.message.reply(
|
||||
`\`\`\`ansi\n${fixansi(bot.getMessageAsPrismarine(component)?.toAnsi())}\`\`\``,
|
||||
);
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = InfoCommand;
|
||||
@@ -1,54 +0,0 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class ListCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("list", ["pl", "playerlist"], "check whos online on the server", 0, [
|
||||
"",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const source = context.source;
|
||||
|
||||
let component = [];
|
||||
let infoComponent = [];
|
||||
let playerCount = [];
|
||||
|
||||
playerCount.push({
|
||||
translate: "%s: (%s)\n",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Players", color: config.colors.commands.primary },
|
||||
{ text: `${bot.players.length}`, color: config.colors.integer },
|
||||
],
|
||||
});
|
||||
|
||||
component.push(playerCount);
|
||||
|
||||
for (const player of bot.players) {
|
||||
component.push({
|
||||
translate: "%s \u203a %s [%s: %s]",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
player.displayName ?? player.profile.name,
|
||||
{ text: `${player.uuid}`, color: config.colors.commands.primary },
|
||||
{ text: "Latency", color: config.colors.commands.primary },
|
||||
{ text: `${player.latency}`, color: config.colors.integer },
|
||||
],
|
||||
});
|
||||
component.push("\n");
|
||||
}
|
||||
component.pop();
|
||||
|
||||
if (source.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ListCommand;
|
||||
@@ -1,52 +0,0 @@
|
||||
const mc = require("minecraft-protocol");
|
||||
const util = require("util");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
class McserverCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("mcserver", ["pingserver"], "pings minecraft servers", 0, ["<ip>"]);
|
||||
}
|
||||
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const args = context.arguments;
|
||||
const [host, port] = args[0].split(":");
|
||||
const source = context.source;
|
||||
const server = await mc.ping({ host, port: Number(port ?? 25565) });
|
||||
let component = [];
|
||||
|
||||
try {
|
||||
component.push({
|
||||
translate: "%s: %s:%s\n%s: (%s/%s)\n%s: %s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "ip", color: config.colors.commands.primary },
|
||||
{ text: `${host}`, color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${Number(port ?? 25565)}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "players", color: config.colors.commands.primary },
|
||||
{ text: `${server.players.online}`, color: config.colors.integer },
|
||||
{ text: `${server.players.max}`, color: config.colors.integer },
|
||||
{ text: "server version", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${server.version.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
server.description,
|
||||
],
|
||||
});
|
||||
|
||||
if (source.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e.stack);
|
||||
bot.chat.message(`${e.toString()}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = McserverCommand;
|
||||
@@ -1,65 +0,0 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class NetmsgCommand extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"netmsg",
|
||||
["networkmessage", "netmessage"],
|
||||
"send a message to other servers",
|
||||
0,
|
||||
["<message>"],
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
|
||||
let component = [];
|
||||
|
||||
if (bot.options.private === true) {
|
||||
component.push({
|
||||
translate: "[%s] %s \u203a %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: `${bot.options.serverName}`,
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
source?.player?.displayName ?? source?.player?.profile?.name,
|
||||
{
|
||||
text: `${args.join(" ")}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
} else {
|
||||
component.push({
|
||||
translate: "[%s:%s] %s \u203a %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
text: `${bot.options.host}`,
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${bot.options.port}`,
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
source.player.displayName ?? source.player.profile.name,
|
||||
{
|
||||
text: `${args.join(" ")}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
eachBot.tellraw("@a", component);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = NetmsgCommand;
|
||||
@@ -1,14 +0,0 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class RefillcoreCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("refillcore", ["rc", "refill"], "refill the bots core", 0, [""]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
bot.core.move(bot.position);
|
||||
bot.tellraw("@a", "Refilling core,...");
|
||||
}
|
||||
}
|
||||
module.exports = RefillcoreCommand;
|
||||
@@ -1,121 +0,0 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const { request } = require("undici");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
const fixansi = require("../../util/ansi");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { AttachmentBuilder } = require("discord.js");
|
||||
|
||||
class UrbanCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("urban", ["urbandictionary"], "urban dictionary", 0, [
|
||||
"<definition>",
|
||||
]);
|
||||
}
|
||||
async execute(context) {
|
||||
const source = context.source;
|
||||
const args = context.arguments;
|
||||
const bot = context.bot;
|
||||
const prefix = [
|
||||
{ text: "[", color: "dark_gray" },
|
||||
{ text: "Urban", color: "#B72A00" },
|
||||
{ text: "] ", color: "dark_gray" },
|
||||
];
|
||||
let component = [];
|
||||
let term = `${args.join(" ")}`;
|
||||
const query = new URLSearchParams({ term });
|
||||
const dictResult = await request(
|
||||
`https://api.urbandictionary.com/v0/define?${query}`,
|
||||
);
|
||||
const { list } = await dictResult.body.json();
|
||||
|
||||
if (bot.options.mode === "savageFriends") {
|
||||
bot.chat.message(
|
||||
"this command is disabled for this server for right now sorry!",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!list.length) {
|
||||
bot.tellraw("@a", { text: "No results found", color: "dark_red" });
|
||||
}
|
||||
|
||||
for (const definitions of list) {
|
||||
component.push(prefix, [
|
||||
{
|
||||
text: `${definitions.definition.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
|
||||
color: "gray",
|
||||
underlined: false,
|
||||
italic: false,
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: `Example \u203a \n ${definitions.example.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `Word \u203a ${definitions.word.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `Author \u203a ${definitions.author.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `written on \u203a ${definitions.written_on.replaceAll("\r", "").replaceAll("[", "\xa71\xa7n\xa7o").replaceAll("]", "\xa7r\xa77")}\n`,
|
||||
color: "gray",
|
||||
},
|
||||
{
|
||||
text: `Rating \u203a Thumbs-Up ${definitions.thumbs_up} / Thumbs-Down ${definitions.thumbs_down}`,
|
||||
color: "gray",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `${definitions.permalink}`,
|
||||
},
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
if (source.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else if (source.sources.discord) {
|
||||
const discordOutput = fixansi(
|
||||
bot.getMessageAsPrismarine(component)?.toAnsi(),
|
||||
);
|
||||
|
||||
if (discordOutput.length > 2000) {
|
||||
const output = fs.writeFileSync(
|
||||
path.join(__dirname, "../../output.txt"),
|
||||
JSON.stringify(bot.getMessageAsPrismarine(component)?.toString()),
|
||||
);
|
||||
|
||||
const file = new AttachmentBuilder(
|
||||
path.join(__dirname, "../../output.txt"),
|
||||
);
|
||||
|
||||
bot.discord.message.reply("output", {
|
||||
files: [file],
|
||||
});
|
||||
// bot.discord.message.reply('meow') //[{
|
||||
// files: path.join(__dirname, '../../output.txt')
|
||||
// }])
|
||||
|
||||
// fs.unlinkSync(path.join(__dirname, '../../output.txt'))
|
||||
} else {
|
||||
bot.discord.message.reply(`\`\`\`ansi\n${discordOutput}\`\`\``);
|
||||
}
|
||||
// console.log(discordOutput.length)
|
||||
} else if (bot.options.mode === "savageFriends") {
|
||||
bot.core.run(`minecraft:tellraw @a ${JSON.stringify(component)}`);
|
||||
} else {
|
||||
bot.tellraw(`@a`, component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UrbanCommand;
|
||||
@@ -1,122 +0,0 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const { request } = require("undici");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class WeatherCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("weather", [], "check the weather in locations", 0, [
|
||||
"<weather/zip code>",
|
||||
]);
|
||||
}
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
let component = [];
|
||||
|
||||
try {
|
||||
const url = await request(
|
||||
`https://api.weatherapi.com/v1/current.json?key=${config.weatherApiKey}&q=${args.join(" ").replaceAll(" ", "%20")}`,
|
||||
);
|
||||
const info = await url.body.json();
|
||||
|
||||
component.push({
|
||||
translate: "%s\n%s: %s, %s\n%s: %s (%s)\n%s\n%s\n%s: %s\n%s: %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
translate: "%s: %s, %s %s",
|
||||
with: [
|
||||
{ text: "Location", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${info.location.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: `${info.location.region}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: `${info.location.country}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
{ text: "Coords", color: config.colors.commands.primary },
|
||||
{ text: `${info.location.lat}`, color: config.colors.integer },
|
||||
{ text: `${info.location.lon}`, color: config.colors.integer },
|
||||
{ text: "Time", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${new Date().toLocaleTimeString("en-US", { timeZone: info.location.tz_id })}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: `${info.location.tz_id}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
translate: "%s: %s (%s), %s (%s)",
|
||||
with: [
|
||||
{ text: "Temp", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${Math.floor(info.current.temp_c)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "\u00b0C", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${Math.floor(info.current.temp_f)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "\u00b0F", color: config.colors.commands.secondary },
|
||||
],
|
||||
},
|
||||
{
|
||||
translate: "%s: %s (%s, %s), %s (%s, %s)",
|
||||
with: [
|
||||
{ text: "Wind Speed", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${Math.floor(info.current.wind_kph)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "kph", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${info.current.wind_dir}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: `${Math.floor(info.current.wind_mph)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "mph", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${info.current.wind_dir}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
{ text: "Condition", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${info.current.condition.text}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: "Humidity", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${Math.floor(info.current.humidity)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
if (source.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
} catch (e) {
|
||||
bot.chat.message(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = WeatherCommand;
|
||||
@@ -1,45 +0,0 @@
|
||||
const wiki = require("wikipedia");
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const fixansi = require("../../util/ansi");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class WikiCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("wiki", ["wikipedia"], "wikipedia", 0, ["<article>"]);
|
||||
}
|
||||
async execute(context) {
|
||||
const source = context.source;
|
||||
const args = context.arguments;
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
let component = [];
|
||||
|
||||
try {
|
||||
const page = await wiki.page(args.join(" "));
|
||||
const summary = await page.intro();
|
||||
|
||||
component.push({ text: summary, color: config.colors.commands.primary });
|
||||
|
||||
if (source.sources.console) {
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi());
|
||||
} else if (source.sources.discord) {
|
||||
bot.discord.message.reply(
|
||||
`\`\`\`ansi\n${new fixansi(bot.getMessageAsPrismarine(component)?.toAnsi()).ansi}\`\`\``,
|
||||
);
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
} catch (e) {
|
||||
if (
|
||||
e.toString() ===
|
||||
"pageError: TypeError: Cannot read properties of undefined (reading 'pages')"
|
||||
) {
|
||||
bot.tellraw("@a", { text: "no article found!", color: "red" });
|
||||
} else {
|
||||
bot.tellraw(`@a`, `${e.toString()}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = WikiCommand;
|
||||
@@ -1,108 +0,0 @@
|
||||
const CommandError = require("../../command_util/command_error");
|
||||
const fixAnsi = require("../../util/ansi");
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class CloopCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("cloop", ["commandloop", "loop"], "loops commands", 1, [
|
||||
"add <interval> <command>",
|
||||
"remove <index>",
|
||||
"list",
|
||||
"clear",
|
||||
]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const source = context.source;
|
||||
let args;
|
||||
let component = [];
|
||||
|
||||
if (!source.sources.console && !source.sources.discord) {
|
||||
args = context.arguments.slice(16);
|
||||
} else {
|
||||
args = context.arguments;
|
||||
}
|
||||
|
||||
if (
|
||||
!args &&
|
||||
!args[0] &&
|
||||
!args[1] &&
|
||||
!args[2] &&
|
||||
!args[3] &&
|
||||
!args[4] &&
|
||||
!args[5]
|
||||
)
|
||||
return;
|
||||
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "add":
|
||||
if (isNaN(args[1])) throw new CommandError("invalid interval");
|
||||
|
||||
const interval = parseInt(args[1]);
|
||||
const command = args.slice(2).join(" ");
|
||||
bot.cloop.add(command, interval);
|
||||
|
||||
component.push(
|
||||
`added ${command} to the cloops with the interval ${interval}`,
|
||||
);
|
||||
break;
|
||||
case "clear":
|
||||
bot.cloop.clear();
|
||||
component.push("cleared the cloops");
|
||||
break;
|
||||
case "remove":
|
||||
if (isNaN(args[1]))
|
||||
throw new CommandError("argument must be an integer!");
|
||||
|
||||
const index = parseInt(args[1]);
|
||||
bot.cloop.remove(index);
|
||||
|
||||
component.push(`removed ${index} from cloops`);
|
||||
break;
|
||||
case "list":
|
||||
let listComponent = [];
|
||||
let i = 0;
|
||||
for (const cloop of bot.cloop.list) {
|
||||
listComponent.push({
|
||||
translate: "%s \u203a %s (%s)",
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${i}`, color: config.colors.integer },
|
||||
cloop.command,
|
||||
{ text: `${cloop.interval}`, color: config.colors.integer },
|
||||
],
|
||||
});
|
||||
listComponent.push("\n");
|
||||
i++;
|
||||
}
|
||||
|
||||
listComponent.pop();
|
||||
|
||||
component.push({
|
||||
translate: "Cloops (%s):",
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${bot.cloop.list.length}`, color: config.colors.integer },
|
||||
],
|
||||
});
|
||||
component.push("\n");
|
||||
|
||||
if (bot.cloop.list.length > 0) {
|
||||
component.push(listComponent);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new CommandError("invalid argument");
|
||||
}
|
||||
|
||||
if (source.sources.discord) {
|
||||
} else if (source.sources.console) {
|
||||
bot.console.info(component);
|
||||
} else {
|
||||
bot.tellraw("@a", component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CloopCommand;
|
||||
@@ -1,24 +0,0 @@
|
||||
const CommandContext = require("../../command_util/command_context");
|
||||
|
||||
class ValidateCommand extends CommandContext {
|
||||
constructor() {
|
||||
super("validate", ["val"], "validate through the bot", 1, [""]);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
|
||||
if (args[0] === bot.validation.trusted) {
|
||||
bot.chat.message("&2Valid Trusted hash");
|
||||
}
|
||||
if (args[0] === bot.validation.admin) {
|
||||
bot.chat.message("&2Valid Admin hash");
|
||||
}
|
||||
if (args[0] === bot.validation.owner) {
|
||||
bot.chat.message("&2Valid Owner hash");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ValidateCommand;
|
||||
@@ -1,41 +0,0 @@
|
||||
const CommandError = require("../../commandUtil/CommandError");
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class kick extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"kick",
|
||||
[],
|
||||
"kick a player from the server",
|
||||
trustLevel.admin,
|
||||
["invalidstring", "item", "te"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return;
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "invalidstring":
|
||||
bot.exploits.crashes.invalidString(args[2]);
|
||||
bot.tellraw("@a", `crashing ${args[2]}`);
|
||||
break;
|
||||
case "item":
|
||||
bot.exploits.kicks.item(args[2]);
|
||||
bot.tellraw("@a", `kicking ${args[2]}`);
|
||||
break;
|
||||
case "te":
|
||||
bot.exploits.kicks.translateEntity(args[2]);
|
||||
bot.tellraw("@a", `kicking ${args[2]}`);
|
||||
break;
|
||||
default:
|
||||
throw new CommandError("invalid argument");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = kick;
|
||||
@@ -0,0 +1,394 @@
|
||||
// TODO: Maybe add more authors
|
||||
/*const bots = [
|
||||
{
|
||||
name: { text: "HBot", color: "aqua", bold: false },
|
||||
authors: ["hhhzzzsss"],
|
||||
exclaimer: "HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO",
|
||||
foundation: "java/mcprotocollib",
|
||||
prefixes: ["#"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "SC09", color: "gray", bold: false },
|
||||
authors: ["spyingcreeper09"],
|
||||
exclaimer: "i approve :3",
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["@"],
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: { text: "FBot", color: "gold", bold: false },
|
||||
authors: ["aaa"],
|
||||
exclaimer: "frog :3",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["+"],
|
||||
maintained:'true?',
|
||||
},
|
||||
{
|
||||
name: { text: "64Bot", color: "gold", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer: "NINTENDO 64?!?!??!?! 69Bot when??????",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["w="],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "Nebulabot", color: "dark_purple", bold: false },
|
||||
authors: ["IuCC"],
|
||||
exclaimer: "the void",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Prism", color: "#00FF9C", bold: true },
|
||||
{ text: "Bot", color: "white",bold:true },
|
||||
],
|
||||
authors: ["IuCC"],
|
||||
exclaimer: "prismarine :3",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
maintained:'true',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: "SharpBot", color: "aqua", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer:
|
||||
"sharp as in the tv? idfk im out of jokes also the first c# bot on the list??",
|
||||
foundation: "C#/MineSharp",
|
||||
prefixes: ["s="],
|
||||
maintained:'false',
|
||||
},
|
||||
|
||||
{
|
||||
name: { text: "MoonBot", color: "red", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer: "stop mooning/mooing me ",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["m="],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "TableBot", color: "yellow", bold: false },
|
||||
authors: ["12alex12"],
|
||||
exclaimer: "TABLE CLOTH BOT?!?! ",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["t!"],
|
||||
maintained:'false?',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Evil", color: "dark_red", bold: false },
|
||||
{ text: "Bot", color: "dark_purple" },
|
||||
],
|
||||
authors: ["FusseligerDev"],
|
||||
exclaimer: "",
|
||||
foundation: "Java/Custom",
|
||||
prefixes: ["!"],
|
||||
maintained:'false?',
|
||||
},
|
||||
{
|
||||
name: { text: "SBot Java", color: "white", bold: false }, // TODO: Gradient
|
||||
authors: ["evkc"],
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: [":"],
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: { text: "SBot Rust", color: "white", bold: false }, // TODO: Gradient
|
||||
authors: ["evkc"],
|
||||
foundation: "Rust",
|
||||
prefixes: ["re:"],
|
||||
maintained:':shrug:',
|
||||
},
|
||||
{
|
||||
name: { text: "Z-Boy-Bot", color: "dark_purple", bold: false }, // TODO: Gradient
|
||||
exclaimer: "Most likely skidded along with kbot that the dev used",
|
||||
authors: ["Romnci"],
|
||||
foundation: "NodeJS/mineflayer or Java/mcprotocollib idfk",
|
||||
prefixes: ["Z]"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ABot", color: "gold", bold: true }, // TODO: Gradient
|
||||
exclaimer: "not used anymore (replaced by V2)",
|
||||
authors: [{ text: "_yfd", color: "light_purple" }],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["<"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ABot-V2", color: "gold", bold: true }, // TODO: Gradient
|
||||
exclaimer: "",
|
||||
authors: [{ text: "_yfd", color: "light_purple" }],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["<"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "FardBot", color: "light_purple", bold: false },
|
||||
authors: ["_yfd"],
|
||||
exclaimer: "bot is dead lol",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["<"],
|
||||
maintained:'false',
|
||||
},
|
||||
|
||||
{
|
||||
name: { text: "ChipmunkBot Java", color: "green", bold: false },
|
||||
authors: ["_ChipMC_"],
|
||||
exclaimer:
|
||||
"chips? also shoutout to chip and chayapak for helping in the rewrite",
|
||||
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["'", "/'"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ChipmunkBot NodeJS", color: "green", bold: false },
|
||||
authors: ["_ChipMC_"],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: { text: "TestBot", color: "aqua", bold: false },
|
||||
authors: ["Blackilykat"],
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["-"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "UBot", color: "grey", bold: false },
|
||||
authors: ["HexWoman"],
|
||||
exclaimer: "UwU OwO",
|
||||
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ['"'],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ChomeNS Bot Java", color: "yellow", bold: false },
|
||||
authors: ["chayapak"],
|
||||
exclaimer: "wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak",
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["*", "cbot ", "/cbot "],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ChomeNS Bot NodeJS", color: "yellow", bold: false },
|
||||
authors: ["chayapak"],
|
||||
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["*", "cbot", "/cbot"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "RecycleBot", color: "dark_green", bold: false },
|
||||
foundation: ["MorganAnkan"],
|
||||
exclaimer: "nice bot",
|
||||
language: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["="],
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: { text: "neobot", color: "blue", bold: false },
|
||||
exclaimer: "n e o b o t ;oslkdfj;salkdfj;ladsjf",
|
||||
authors: ["mirkokral"],
|
||||
foundation: "java/MCProtocolLib",
|
||||
prefixes: ["_"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ManBot", color: "dark_green", bold: false },
|
||||
exclaimer:
|
||||
"(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT",
|
||||
authors: ["Man/LogintimedOut"],
|
||||
foundation: "NodeJS/mineflayer",
|
||||
prefixes: ["(Note:I dont remember!!)"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Useless", color: "red", bold: false },
|
||||
{ text: "Bot", color: "gray", bold: false },
|
||||
],
|
||||
exclaimer: "it isnt useless its a good bot................",
|
||||
authors: ["IuCC"],
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Blurry", color: "dark_purple", bold: false },
|
||||
{ text: "Bot", color: "red" },
|
||||
],
|
||||
exclaimer: "§4§kfuck you",
|
||||
authors: ["SirLennox"],
|
||||
foundation: "???",
|
||||
prefixes: [","],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [{ text: "SnifferBot", color: "gold", bold: false }],
|
||||
exclaimer: "sniff sniff FNFBoyfriendBot simp",
|
||||
authors: ["popbob"],
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: [">"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [{ text: "XBot", color: "dark_purple", bold: false }],
|
||||
exclaimer: "",
|
||||
authors: ["popbob"],
|
||||
foundation: "ts-Node/Node-minecraft-protocol",
|
||||
prefixes: ["$"],
|
||||
maintained:':shrug:',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Kitty", color: "gold", bold: false },{text:"Corp", color:'aqua',bold:false},
|
||||
{ text: "Bot", color: "yellow",bold:false },
|
||||
],
|
||||
exclaimer: "3 words ginlang is gay",
|
||||
authors: ["ginlang , G6_, ArrayBuffer, and i guess more??"],
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["^"],
|
||||
maintained:'false',
|
||||
},
|
||||
|
||||
{
|
||||
name: [
|
||||
{ text: "FNF", color: "dark_purple", bold: false },
|
||||
{ text: "Boyfriend", color: "aqua", bold: false },
|
||||
{ text: "Bot", color: "dark_red", bold: false },
|
||||
{ text: " nmp", color: "black", bold: false },
|
||||
],
|
||||
authors: [
|
||||
{ text: "Parker2991", color: "dark_red" },
|
||||
{ text: " _ChipMC_", color: "dark_green", bold: false },
|
||||
{ text: " chayapak", color: "yellow", bold: false },
|
||||
{ text: " _yfd", color: "light_purple", bold: false },
|
||||
{ text: "popbob", color: "gold" },
|
||||
],
|
||||
exclaimer: "FNFBoyfriendBot NMP Rewrite",
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["~ % &"],
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "FNF", color: "dark_purple", bold: false },
|
||||
{ text: "Boyfriend", color: "aqua", bold: false },
|
||||
{ text: "Bot", color: "dark_red", bold: false },
|
||||
{ text: " legacy", color: "green", bold: false },
|
||||
],
|
||||
authors: [
|
||||
{ text: "Parker2991", color: "dark_red" },
|
||||
{ text: " _ChipMC_", color: "dark_green", bold: false },
|
||||
],
|
||||
exclaimer:
|
||||
"1037 LINES OF CODE WTFARD!??! also this version is in console commands only",
|
||||
foundation: "NodeJS/mineflayer",
|
||||
prefixes: [],
|
||||
maintained:'false',
|
||||
},
|
||||
];
|
||||
*/
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
module.exports = {
|
||||
name: "bots",
|
||||
description: ["shows a list of known bots"],
|
||||
aliases: ["knownbots"],
|
||||
trustLevel: 0,
|
||||
usage:[""],
|
||||
execute(context) {
|
||||
|
||||
//const bots = fs.readdirSync(path.join(__dirname,'../util/bots')).forEach(file => require(`../util/bots/${file}`))
|
||||
//const bots = require(fs.readdirSync(path.join(__dirname,'../util/bots')).forEach(file => (file)))
|
||||
//const bots = require(['../util/bots'].forEach(file => file))
|
||||
const query = context.arguments.join(" ").toLowerCase();
|
||||
const bot = context.bot;
|
||||
const botsFiles = path.join(__dirname, '../util/bots');
|
||||
//list = [];
|
||||
//for (const file of fs.readdirSync('./util/bots')) {
|
||||
//bots.push(require(path.join(__dirname, '../util/bots', file)))
|
||||
//};
|
||||
//name = Object.values(bots.map(name => name))
|
||||
//auth = Object.values(bots).map(sus => sus.authors)
|
||||
//exclaimer = Object.values(bots).map(sus => sus.exclaimer)
|
||||
//prefixes = Object.values(bots).map(sus => sus.prefixes)
|
||||
//foundation = Object.values(bots).map(sus => sus.foundation)
|
||||
//prefix = Object.values(bots).map(sus => sus.prefixes)
|
||||
// maintained = Object.values(bots).map(sus => sus.maintained)
|
||||
//amongus = Object.values(bots).map(sus => sus)
|
||||
if (query.length === 0) {
|
||||
const list = [];
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('Coreless mode is active can not execute command!')
|
||||
}else{
|
||||
//for (const file of fs.readdirSync('./util/bots')) {
|
||||
//bots.push(require(path.join(__dirname, '../util/bots', file)))
|
||||
//};
|
||||
//bots = fs.readdirSync('./util/bots')
|
||||
for (const file of fs.readdirSync('./util/bots')) {
|
||||
list.push(require(path.join(__dirname,'../util/bots',file)))
|
||||
}
|
||||
for (const info of bots) {
|
||||
if (bots.length !== 0) list.push({ text: ", ", color: "gray" }); // list.push(info.name)
|
||||
list.push(info.name);
|
||||
}
|
||||
bot.tellraw(bots.name)
|
||||
console.log(Object.values(bots).map(name => name))
|
||||
//const ping = Object.values(bot.players).map(player =>player.latency)
|
||||
bot.sendFeedback(bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - ", ...list])?.toMotd().replaceAll('\xa7','\xa7'),false);
|
||||
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("Name: ", amongus.name);
|
||||
//const name = Object.values(bots.map(name => name.name))
|
||||
//const auth = Object.values(bots).map(sus => sus.authors)
|
||||
//const exclaimer = Object.values(bots).map(sus => sus.exclaimer)
|
||||
//const prefixes = Object.values(bots).map(sus => sus.prefixes)
|
||||
//const foundation = Object.values(bots).map(sus => sus.foundation)
|
||||
//const prefix = Object.values(bots).map(sus => sus.prefixes)
|
||||
//const maintained = Object.values(bots).map(sus => sus.maintained)
|
||||
component.push("Name: ", Object.values(bots).map(name => name.name));
|
||||
console.log(name)
|
||||
if (info.exclaimer) component.push("\n", "Exclaimer: ", info.exclaimer);
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push("\n", "Authors: ");
|
||||
for (const author of info.authors) {
|
||||
component.push(author, { text: ", ", color: "gray" });
|
||||
}
|
||||
component.pop();
|
||||
}
|
||||
if (info.foundation) component.push("\n", "Foundation: ", info.foundation);
|
||||
if (info.prefixes && info.prefixes.length !== 0) {
|
||||
component.push("\n", "Prefixes: ");
|
||||
for (const prefix of info.prefixes) {
|
||||
component.push(prefix, { text: ", ", color: "gray" });
|
||||
}
|
||||
component.pop();
|
||||
}
|
||||
if(info.maintained) component.push("\n","Maintained: ",info.maintained)
|
||||
|
||||
bot.tellraw([component]);
|
||||
},
|
||||
};
|
||||
//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
@@ -0,0 +1,20 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'bruhify',
|
||||
description:['bruhify text'],
|
||||
aliases:['bruhifytext', 'bruh'],
|
||||
trustLevel: 0,
|
||||
usage:["smexy text here"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
bot.bruhifyText = args.join(' ')
|
||||
|
||||
bot.sendFeedback(JSON.stringify(bot.bruhifyText))
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
|
||||
const bots = [
|
||||
{//
|
||||
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'}],
|
||||
//#f001dbQT #740000KB 0Termination
|
||||
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',
|
||||
},
|
||||
]//
|
||||
//back
|
||||
|
||||
|
||||
/*{//
|
||||
name: { text: '', color: 'gray', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'',
|
||||
},*/
|
||||
module.exports = {
|
||||
name: 'changelog',
|
||||
description:['check the bots changelog'],
|
||||
trustLevel: 0,
|
||||
aliases:['cl', '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: 'white',
|
||||
with: [
|
||||
|
||||
{ color: 'aqua', text: 'Alpha Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'blue', text: 'Beta Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'green', text: 'Minor release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'gold', text: 'Revision Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Major Release'},
|
||||
|
||||
]
|
||||
}
|
||||
bot.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\u00a7','\u00a7'), false)
|
||||
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([component])
|
||||
}
|
||||
}//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
@@ -0,0 +1,410 @@
|
||||
|
||||
const bots = [
|
||||
{
|
||||
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',
|
||||
}, // am I even gonna be credited?
|
||||
{
|
||||
name: { text: 'v4.1.8', color: 'green', bold:false },
|
||||
authors: [''],//cai cee mmm deee sus
|
||||
|
||||
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)',
|
||||
},
|
||||
]//§4Lullaby §cGirlfriend's §cLost§bCause
|
||||
//back
|
||||
|
||||
|
||||
/*{//
|
||||
name: { text: '', color: 'gray', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '',
|
||||
exclaimer:'',
|
||||
},*/
|
||||
module.exports = {
|
||||
name: 'changelogv4.3.4',
|
||||
description:['check the bots changelog'],
|
||||
trustLevel: 0,
|
||||
aliases:['clv4.3.4', 'changesv4.3.4'],
|
||||
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: 'white',
|
||||
with: [
|
||||
|
||||
{ color: 'aqua', text: 'Alpha Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'blue', text: 'Beta Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'green', text: 'Minor release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'gold', text: 'Revision Release'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Major Release'},
|
||||
|
||||
]
|
||||
}
|
||||
bot.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\xa7','\xa7'), false)
|
||||
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([component])
|
||||
}
|
||||
}//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
@@ -0,0 +1,186 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const {EmbedBuilder} = require('discord.js')
|
||||
module.exports = {
|
||||
name: 'cloop',
|
||||
trustLevel: 1,
|
||||
description:['command loop commands'],
|
||||
aliases:['commandloop'],
|
||||
usage:[
|
||||
"add <interval> <command/message>",
|
||||
"clear",
|
||||
"remove <id>",
|
||||
"list",
|
||||
],
|
||||
execute (context, selector) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (args[1]) {
|
||||
case 'add':
|
||||
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
|
||||
|
||||
const interval = parseInt(args[2])
|
||||
const command = args.slice(3).join(' ')
|
||||
|
||||
bot.cloop.add(command, interval)
|
||||
|
||||
bot.sendFeedback({
|
||||
translate: 'Added \'%s\' with interval %s to the cloops',
|
||||
with: [ command, interval ]
|
||||
})
|
||||
|
||||
break
|
||||
case 'remove':
|
||||
//const aaa = args[2]
|
||||
var id
|
||||
// if (bot.cloop.list[args[2]].id === undefined) new CommandError({text:'Invalid index'})
|
||||
try{
|
||||
|
||||
const index = (args[2])
|
||||
|
||||
bot.cloop.remove(index)
|
||||
|
||||
bot.sendFeedback({
|
||||
translate: 'Removed cloop %s',
|
||||
with: [ index ]
|
||||
})
|
||||
} catch(e) {
|
||||
if (e.toString() === "TypeError: Cannot read properties of undefined (reading 'id')"){
|
||||
bot.sendError({text:'Invalid Index'})
|
||||
}
|
||||
}
|
||||
|
||||
break
|
||||
case 'clear':
|
||||
bot.cloop.clear()
|
||||
|
||||
bot.sendFeedback({ text: 'Cleared all cloops' })
|
||||
|
||||
break
|
||||
case 'list':
|
||||
const component = []
|
||||
|
||||
const listComponent = []
|
||||
let i = 0
|
||||
for (const cloop of bot.cloop.list) {
|
||||
listComponent.push({
|
||||
translate: '%s \u203a %s (%s)',
|
||||
with: [
|
||||
`id ${i}`,
|
||||
cloop.command,
|
||||
cloop.interval
|
||||
]
|
||||
})
|
||||
listComponent.push('\n')
|
||||
|
||||
i++
|
||||
}
|
||||
|
||||
listComponent.pop()
|
||||
|
||||
component.push({
|
||||
translate: "Cloops (%s):",
|
||||
with: [ JSON.stringify(bot.cloop.list.length) ]
|
||||
})
|
||||
component.push('\n')
|
||||
component.push(listComponent)
|
||||
if(bot.cloop.list.length === 0){
|
||||
bot.sendFeedback({ translate: "Cloops (%s):", with: [ JSON.stringify(bot.cloop.list.length) ] })
|
||||
}else{
|
||||
bot.sendFeedback(component)
|
||||
}
|
||||
break
|
||||
default:
|
||||
bot.sendFeedback({ text: 'Invalid action', color: 'red' })
|
||||
break
|
||||
}
|
||||
},
|
||||
discordExecute(context) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
switch(args[0]) {
|
||||
case 'add':
|
||||
const interval = parseInt(args[1])
|
||||
const command = args.slice(2).join(' ')
|
||||
|
||||
bot.cloop.add(command, interval)
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`Added ${command} with the interval ${interval} to the cloops`)
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
break
|
||||
case 'remove':
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
var index = (args[1])
|
||||
bot.cloop.remove(index)
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`removed cloop ${index}`)
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
|
||||
|
||||
} catch(e) {
|
||||
if (e.toString() === "TypeError: Cannot read properties of undefined (reading 'id')"){
|
||||
throw new CommandError({text:'Invalid Index'})
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'clear':
|
||||
bot.cloop.clear()
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`cleared cloops`)
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
break
|
||||
case 'list':
|
||||
|
||||
const component = []
|
||||
|
||||
const listComponent = []
|
||||
let i = 0
|
||||
for (const cloop of bot.cloop.list) {
|
||||
listComponent.push({
|
||||
translate: '%s \u203a %s (%s)',
|
||||
with: [
|
||||
`id ${i}`,
|
||||
cloop.command,
|
||||
cloop.interval
|
||||
]
|
||||
})
|
||||
listComponent.push('\n')
|
||||
|
||||
i++
|
||||
}
|
||||
|
||||
listComponent.pop()
|
||||
|
||||
component.push({
|
||||
translate: 'Cloops (%s):',
|
||||
with: [ bot.cloop.list.length ]
|
||||
})
|
||||
component.push('\n')
|
||||
component.push(listComponent)
|
||||
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor(`#00FFFF`)
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(bot.getMessageAsPrismarine(component)?.toString())
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
|
||||
|
||||
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
module.exports = {
|
||||
name: 'cmdtest',
|
||||
description:['usages are test and msg error'],
|
||||
trustLevel: 0,
|
||||
aliases:['cmdtst', 'commandtest', 'commandtst'],
|
||||
usage:[
|
||||
"msg",
|
||||
"error",
|
||||
],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
switch (args[0]) {
|
||||
case 'msg':
|
||||
const component = {
|
||||
translate: '[%s] %s %s %s %s %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: 'aqua'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
bold: true,
|
||||
color: 'dark_red'
|
||||
},
|
||||
],
|
||||
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
|
||||
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
|
||||
},
|
||||
{
|
||||
text:'Hello, World!,'
|
||||
},{
|
||||
text:'Player:'
|
||||
},
|
||||
|
||||
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
{
|
||||
text:`, uuid: ${uuid ?? context.source.player.uuid } , `
|
||||
},
|
||||
//entry.displayName
|
||||
{text:`Argument: ${args.slice(1).join(' ')}`}
|
||||
]//command.split(' ')[0]
|
||||
}//context.source.player.displayName ?? context.source.player.profile.name
|
||||
|
||||
//ChatMessage.fromNotch(`${process.env["buildstring"]}`).toMotd().replaceAll('§', '&')
|
||||
|
||||
if (!bot.options.Core.enabled){
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
bot.chat(`Hello, World!, Player: ${ChatMessage.fromNotch(context.source.player.displayName ?? context.source.player.profile.name).toMotd().replaceAll('§', '&')}, uuid: ${context.source.player.uuid}, Argument: ${args.slice(1).join(' ')}`)
|
||||
|
||||
} else {
|
||||
bot.tellraw([component])
|
||||
}
|
||||
/*
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
|
||||
bot.sendFeedback(`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`, false)
|
||||
*/
|
||||
break
|
||||
case 'error':
|
||||
|
||||
throw new Error(args.slice(1).join(' '))
|
||||
|
||||
break
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
default:
|
||||
if (bot.options.Core.CorelessMode){
|
||||
bot.chat('&4Invalid action')
|
||||
sleep(500)
|
||||
bot.chat('the usages are msg and error')
|
||||
}else{
|
||||
bot.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
bot.sendError([{ text: 'the usages are msg and error', color: 'gray', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
*/
|
||||
//context.source.player.displayName ?? context.source.player.profile.name,
|
||||
@@ -0,0 +1,47 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundation = process.env['FoundationBuildString']
|
||||
module.exports = {
|
||||
name: 'console',
|
||||
trustLevel: 3,
|
||||
description:['no :)'],
|
||||
// description:['make me say something in custom chat'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = {
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'dark_gray',
|
||||
with: [
|
||||
{
|
||||
text: 'FNFBoyfriendBot Console', color:'#00FFFF'
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
selector: `${bot.username}`, color:'#00FFFF',
|
||||
clickEvent: { action: 'suggest_command', value: '~help' }
|
||||
},
|
||||
{
|
||||
text: '',
|
||||
extra: [`${message}`],
|
||||
color:'white'
|
||||
},
|
||||
|
||||
],
|
||||
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
|
||||
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
|
||||
}
|
||||
|
||||
bot.tellraw([prefix])
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -1,126 +0,0 @@
|
||||
const CommandError = require("../../commandUtil/CommandError");
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class console extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"console",
|
||||
["c"],
|
||||
"runs commands made for the bots console",
|
||||
trustLevel.console,
|
||||
[
|
||||
"server/srv <all/servername>",
|
||||
"customchat <on/true/enable/off/false/disable>",
|
||||
"say <message>",
|
||||
"validate/validation/val <owner/o/admin/a/trusted/t>",
|
||||
"logging/togglelogging/logtoconsole <on/true/enable/off/false/disable>",
|
||||
],
|
||||
false,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
const config = context.config;
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return;
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "server":
|
||||
case "svr":
|
||||
const servers = bot.bots.map((eachBot) => eachBot.options.serverName);
|
||||
for (const eachBot of bot.bots) {
|
||||
if (args.slice(1).join(" ").toLowerCase() === "all") {
|
||||
eachBot.console.server = "all";
|
||||
bot.console.info("Set the console server to all");
|
||||
continue;
|
||||
}
|
||||
const server = servers.find((server) =>
|
||||
server.toLowerCase().includes(args[1]),
|
||||
);
|
||||
if (!server) {
|
||||
bot.console.info("Invalid server");
|
||||
return;
|
||||
}
|
||||
bot.console.info(`Set the console server to ` + server);
|
||||
eachBot.console.server = server;
|
||||
}
|
||||
break;
|
||||
case "say":
|
||||
bot.chat.send(args.slice(1).join(" "));
|
||||
break;
|
||||
case "validate":
|
||||
case "validation":
|
||||
case "val":
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "owner":
|
||||
case "o":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
case "admin":
|
||||
case "a":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
case "trusted":
|
||||
case "t":
|
||||
bot.chat.message(
|
||||
`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(" ")}`,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "logging":
|
||||
case "togglelogging":
|
||||
case "logtoconsole":
|
||||
switch (args[1]?.toLowerCase()) {
|
||||
case "on":
|
||||
case "enable":
|
||||
case "enabled":
|
||||
case "true":
|
||||
if (bot.options.logging === true) {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is already enabled!`,
|
||||
);
|
||||
} else {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is now enabled`,
|
||||
);
|
||||
bot.options.logging = true;
|
||||
}
|
||||
break;
|
||||
case "off":
|
||||
case "disable":
|
||||
case "disabled":
|
||||
case "false":
|
||||
if (bot.options.logging === false) {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is already disabled!`,
|
||||
);
|
||||
} else {
|
||||
bot.console.info(
|
||||
`logging for ${bot.options.serverName} is now disabled`,
|
||||
);
|
||||
bot.options.logging = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = console;
|
||||
@@ -0,0 +1,46 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'consoleserver',
|
||||
|
||||
trustLevel: 3,
|
||||
description:['consoleserver'],
|
||||
aliases:['csvr'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
|
||||
// const servers = bot.bots.map(eachBot => eachBot.options.host)
|
||||
const serverName = bot.bots.map(eachBot => eachBot.options.serverName)
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
for (const eachBot of bot.bots) {
|
||||
|
||||
|
||||
if (args.join(' ').toLowerCase() === 'all') {
|
||||
|
||||
eachBot.console.consoleServer = 'all'
|
||||
bot.console.info(` Set the console server to all servers`)
|
||||
|
||||
//Set the console server to all servers
|
||||
continue
|
||||
|
||||
|
||||
}
|
||||
|
||||
const server = serverName.find(server => server.toLowerCase().includes(args[0]))
|
||||
|
||||
if (!server) {
|
||||
source.sendFeedback({ text: 'Invalid server', color: 'red' })
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
bot.console.info(`Set the console server to ` + server)
|
||||
eachBot.console.consoleServer = server
|
||||
// eachBot.console.consoleServer = port
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'core',
|
||||
description:['make me run a command in core'],
|
||||
aliases:['cb','corerun','run','commandblockrun','cbrun'],
|
||||
trustLevel: 0,
|
||||
usage:["<command/message>"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
// const client = context.client
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
// const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
|
||||
// if (args.length === 0){
|
||||
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
if (message.startsWith('/')) {
|
||||
bot.core.run(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.core.run(`${args.join(' ')}`)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'cowsay',
|
||||
description:['mooooo'],
|
||||
aliases:['cws', 'cow'],
|
||||
trustLevel: 0,
|
||||
usage:["list"],
|
||||
execute (context, selector) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const component = ['']
|
||||
// const args = context.arguments
|
||||
const source = context.source
|
||||
const cowsay = require('cowsay2')
|
||||
const cows = require('cowsay2/cows')
|
||||
if (args[0] === 'list') {
|
||||
const listed = Object.keys(cows)
|
||||
|
||||
let primary = true
|
||||
const message = []
|
||||
|
||||
for (const value of listed) {
|
||||
message.push({
|
||||
text: value + ' ',
|
||||
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${bot.Commands.prefixes[0]}cowsay ${value} `
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
bot.tellraw(message)
|
||||
} else {
|
||||
bot.tellraw({ text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
// bot.tellraw({ text: cowsay.say(context.arguments.join(' ').slice(1), { cow: cows[args[0]] })
|
||||
|
||||
//const listed = JSON.parse(cows)
|
||||
//source.sendFeedback(`${listed}`, false)
|
||||
/* if (args[0] === 'list') {
|
||||
const listed = Object.keys(cows)
|
||||
|
||||
let primary = true
|
||||
const message = []
|
||||
|
||||
for (const value of listed) {
|
||||
message.push({
|
||||
text: value + ' ',
|
||||
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${prefix}cowsay ${value} `
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
bot.tellraw(selector, message)
|
||||
} else {
|
||||
bot.tellraw(selector, { text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
|
||||
}
|
||||
},
|
||||
*/
|
||||
/*if (query.length === 0) {
|
||||
const list = []
|
||||
|
||||
for (const info of bots) {
|
||||
if (list.length !== 0) list.push({ text: ', ', color: 'gray' })
|
||||
list.push(info.name)
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,56 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'crash',
|
||||
description:['crashes a server'],
|
||||
trustLevel: 1,
|
||||
aliases:['crashserver', '69'],//69 cuz yes
|
||||
usage:["exe","give"],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
// throw new CommandError('temp disabled')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('&4Coreless mode is active can not execute command!')
|
||||
}else {
|
||||
switch (args[1] ?? (!source.sources.console && args[0])) {
|
||||
case `exe`:
|
||||
const amogus = process.env['amogus']
|
||||
bot.core.run(`${amogus}`)
|
||||
break
|
||||
case `give`:
|
||||
const amogus2 = process.env['amogus2']
|
||||
bot.core.run(`${amogus2}`)
|
||||
break
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'gold', text: 'crash'},
|
||||
]
|
||||
}
|
||||
if(source.sources.console){
|
||||
bot.console.info([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
// bot.console.info([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
|
||||
}else{
|
||||
bot.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
// bot.sendError([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -0,0 +1,40 @@
|
||||
const CommandError = require("../CommandModules/command_error")
|
||||
|
||||
module.exports = {
|
||||
name: 'discordmsg',
|
||||
description:['make me say something in discord'],
|
||||
trustLevel: 0,
|
||||
aliases:['discordmessage', 'ddmsg'],
|
||||
usage:["message"],
|
||||
execute (context) {
|
||||
//const args = context.args
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
// if (args.translate !== '\u202e')
|
||||
|
||||
// throw new CommandError('u202e detected')
|
||||
if (!args[0]) {
|
||||
bot.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
bot.discord.channel.send(args.join(' '))
|
||||
console.log(args[0])
|
||||
bot.sendFeedback({ text: `Recieved: ${args.join(' ')}`, color:'green'})
|
||||
|
||||
//}
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
//bot.discord.channel.send(args.join(' '))
|
||||
/*
|
||||
if(!args[0])
|
||||
bot.sendFeedback('message is empty')
|
||||
|
||||
else if (args[0])
|
||||
bot.discord.channel.send(args[0])
|
||||
console.log(args[0])
|
||||
bot.sendFeedback(`Recieved: ${args[0]}`)
|
||||
return;
|
||||
*/
|
||||
@@ -0,0 +1,31 @@
|
||||
module.exports = {
|
||||
name: 'echo',
|
||||
description:['make me say something in chat'],
|
||||
aliases:['chatsay'],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"<command/message>",
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
if (message.startsWith('/')) {
|
||||
bot.command(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.chat(message)
|
||||
|
||||
},
|
||||
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
if (message.startsWith('/')) {
|
||||
bot.command(message.substring(1))
|
||||
return
|
||||
}
|
||||
|
||||
bot.chat(message)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'end',
|
||||
description:['/kill the bot or make it /suicide'],
|
||||
trustLevel: 1,
|
||||
aliases:['kys','kill','suicide'],
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
bot.sendFeedback(`${bot.username} fell out of the world`)
|
||||
process.exit()
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
@@ -0,0 +1,56 @@
|
||||
const ivm = require('isolated-vm');
|
||||
const isolate = new ivm.Isolate({ memoryLimit: 128 });
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
const util = require('util')
|
||||
module.exports = {
|
||||
name: 'eval',
|
||||
description:[''],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"<command/message>",
|
||||
],
|
||||
async execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
|
||||
|
||||
// Create a new isolate limited to 128MB
|
||||
const ivm = require('isolated-vm');
|
||||
const isolate = new ivm.Isolate({ memoryLimit: 128 });
|
||||
|
||||
// Create a new context within this isolate. Each context has its own copy of all the builtin
|
||||
// Objects. So for instance if one context does Object.prototype.foo = 1 this would not affect any
|
||||
// other contexts.
|
||||
const cOntext = isolate.createContextSync();
|
||||
|
||||
// Get a Reference{} to the global object within the context.
|
||||
const jail = cOntext.global;
|
||||
|
||||
// This makes the global object available in the context as `global`. We use `derefInto()` here
|
||||
// because otherwise `global` would actually be a Reference{} object in the new isolate.
|
||||
jail.setSync('global', jail.derefInto());
|
||||
|
||||
// We will create a basic `log` function for the new isolate to use.
|
||||
jail.setSync('log', function(...args) {
|
||||
console.log(...args);
|
||||
});
|
||||
|
||||
// And let's test it out:
|
||||
cOntext.evalSync('let e');
|
||||
// > hello world
|
||||
|
||||
const hostile = isolate.compileScriptSync(`${args.join(' ')}`)
|
||||
//console.log(await hostile)
|
||||
console.log(hostile.run(`e`))
|
||||
|
||||
// Using the async version of `run` so that calls to `log` will get to the main node isolate
|
||||
|
||||
(`${hostile.run(context).catch(err => console.error(err))}`)
|
||||
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'botval',
|
||||
|
||||
trustLevel: 3,
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const prefix = '~' // mabe not hardcode the prefix
|
||||
|
||||
const args = context.arguments
|
||||
|
||||
const key = process.env['FNFBoyfriendBot_Owner_key']
|
||||
//al
|
||||
const time = Math.floor(Date.now() / 11000)
|
||||
|
||||
const value = bot.uuid + args[0] + time + key
|
||||
|
||||
const hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
|
||||
|
||||
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
|
||||
const customchat = {
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'gray',
|
||||
with: [
|
||||
{ text: 'FNFBoyfriendBot', color:'#00FFFF'},
|
||||
{ selector: `${bot.username}`, color:'#00FFFF'},
|
||||
{ text: '', extra: [`${command}`], color:'white'},
|
||||
|
||||
],
|
||||
hoverEvent: { action:"show_text", value: 'FNF Sky is a fangirl but a simp for boyfriend confirmed??'},
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"}
|
||||
}
|
||||
|
||||
context.bot.tellraw(customchat)
|
||||
}
|
||||
}
|
||||
//const interval = setInterval(() => {
|
||||
// bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.normalKey).digest('hex').substring(0, 16)
|
||||
// bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.ownerHashKey).digest('hex').substring(0, 16)
|
||||
|
||||
|
||||
// Make a copy of this
|
||||
@@ -0,0 +1,412 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const {EmbedBuilder } = require('discord.js')
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
|
||||
description:['shows the command list or the usage of a command'],
|
||||
trustLevel: 0,
|
||||
usage:'[COMMAND]',
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const commandList = []
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
|
||||
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
const CommandManager = bot.commandManager
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'blue', text: 'help cmd'},
|
||||
]
|
||||
}
|
||||
const category = {
|
||||
translate: '(%s%s%s%s%s) \u203a ',
|
||||
bold: false,
|
||||
color: 'dark_gray',
|
||||
with: [
|
||||
{ color: `${bot.Commands.colors.help.pub_lickColor}`, text: 'Public'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: `${bot.Commands.colors.help.t_rustedColor}`, text: 'Trusted'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: `${bot.Commands.colors.help.own_herColor}`, text: 'Owner'},
|
||||
]
|
||||
}
|
||||
|
||||
if (args[0]) {
|
||||
let valid
|
||||
//if (command.aliases) { command.aliases.map((a) => (this.commands[a] = command)); }
|
||||
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
|
||||
|
||||
const command = bot.commandManager.getCommand(`${args[0].toLowerCase()}`)
|
||||
|
||||
if (args[0].toLowerCase() === command.name)
|
||||
|
||||
//bot.tellraw(`${bot.commandManager.commandlist['help'].aliases}`)
|
||||
|
||||
|
||||
{
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}//bot.getMessageAsPrismarine([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi()
|
||||
|
||||
valid = true
|
||||
if (bot.options.useChat) {
|
||||
bot.sendFeedback([{text:`Trust levels: -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console`,color:'dark_purple'}])
|
||||
await bot.chatDelay(100)
|
||||
//bot.sendFeedback({text:`${bot.Commands.prefixes[0]}${command.name} `,color:'#00ffff'},{text:`(Aliases: ${command.aliases}) › ${command.description}`,color:'dark_purple'}])
|
||||
bot.sendFeedback({text: `${bot.Commands.prefixes[0]}${command.name} `,color:'#00ffff'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`Aliases`,color:'dark_purple'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`${command.aliases}`,color:'dark_purple'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`${command.description}`})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Trust Level: `,color:'#00ffff'},{text:`${command.trustLevel}`,color:'dark_purple'}])
|
||||
await bot.chatDelay(100)
|
||||
if (command.trustLevel === 2) {
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} <owner hash> `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
await bot.chatDelay(100)
|
||||
} else if (command.trustLevel === 1) {
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} <trusted/owner hash> `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
await bot.chatDelay(100)
|
||||
} else {
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
await bot.chatDelay(100)
|
||||
}
|
||||
|
||||
} else {
|
||||
bot.sendFeedback([cmd,{text:`Trust levels: -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console`,color:'dark_purple'}])
|
||||
bot.sendFeedback([cmd, {text:`${bot.Commands.prefixes[0]}${command.name} `,color:'#00ffff'},{text:`(Aliases: ${command.aliases}) › ${command.description}`,color:'dark_purple'}])
|
||||
bot.sendFeedback([cmd,{text:`Trust Level: `,color:'#00ffff'},{text:`${command.trustLevel}`,color:'dark_purple'}])
|
||||
|
||||
if (command.trustLevel === 2) {
|
||||
bot.sendFeedback([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} <owner hash> `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
} else if (command.trustLevel === 1) {
|
||||
bot.sendFeedback([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} <trusted/owner hash> `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
} else {
|
||||
bot.sendFeedback([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
}
|
||||
}
|
||||
break
|
||||
// }
|
||||
} else valid = false
|
||||
}
|
||||
|
||||
|
||||
if (valid) {
|
||||
|
||||
} else {
|
||||
const args = context.arguments
|
||||
|
||||
|
||||
bot.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefixes[0]}help" for help or click on this for the command`,color:'red', with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefixes[0]}help` } : undefined}])
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
let pub_lick = [];
|
||||
let t_rust = [];
|
||||
let own_her = [];
|
||||
let cons_ole = [];
|
||||
let disabled = [];
|
||||
for (const commands in CommandManager.commandlist) {
|
||||
const command = CommandManager.commandlist[commands]
|
||||
|
||||
|
||||
if(command.trustLevel === 3) {
|
||||
cons_ole.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'blue',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:"HashOnly:",
|
||||
color:'white'},
|
||||
{text:`${command.hashOnly}\n`,color:'red'},
|
||||
{text:'consoleOnly:',color:'white'},
|
||||
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
}
|
||||
}
|
||||
)// copypasted from below, and removed stuff that wont work in the console
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
if (command.trustLevel === 2) {
|
||||
if(bot.options.useChat && !source.sources.console && !source.sources.discord){
|
||||
own_her.push(`&4${command.name + ' '}`)
|
||||
}else{
|
||||
|
||||
|
||||
own_her.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: `${bot.Commands.colors.help.own_herColor}`,
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
}, {text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'dark_red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.Commands.prefixes[0]}${command.name}`
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
else if (command.trustLevel === 1){
|
||||
if(bot.options.useChat && !source.sources.console && !source.sources.discord){
|
||||
t_rust.push(`&5${command.name + ' '}`)
|
||||
}else {
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color:`${bot.Commands.colors.help.t_rustedColor}`,
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
}, {text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'}, {text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.Commands.prefixes[0]}${command.name}`
|
||||
},
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
else if (command.trustLevel === 0){
|
||||
if (bot.options.useChat && !source.sources.console && !source.sources.discord){
|
||||
pub_lick.push(`&b${command.name + ' '}`)
|
||||
} else{
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: `${bot.Commands.colors.help.pub_lickColor}`,
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"suggest_command",value:`${bot.Commands.prefixes[0]}${command.name}`}
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
} else if (command.trustLevel === -1) {
|
||||
disabled.push({
|
||||
text: command.name + ' ',
|
||||
color:`dark_blue`,
|
||||
})
|
||||
}
|
||||
}
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms))
|
||||
}
|
||||
const isConsole = context.source.player ? false : true
|
||||
|
||||
if(source.sources.console && !source.sources.discord) {
|
||||
|
||||
bot.console.info(bot.getMessageAsPrismarine([cmd, 'Commands (', CommandManager.commandlist.length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi(), false)//[cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole]
|
||||
} /*else if(source.sources.discord&& !source.sources.console){
|
||||
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle('help Command')
|
||||
.setDescription(bot.getMessageAsPrismarine(['Commands (',JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3).length),')'])?.toString())
|
||||
.addFields(
|
||||
{ name: 'Public Commands', value:`${bot.getMessageAsPrismarine(pub_lick)?.toString()}`},
|
||||
{ name: 'Trusted Commands', value: `${bot.getMessageAsPrismarine(t_rust)?.toString()}`, inline: true },
|
||||
{ name: 'Owner Commands', value: `${bot.getMessageAsPrismarine(own_her)?.toString()}`, inline: true },
|
||||
)
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
bot?.discord?.Message.react('♋')
|
||||
}*/ else if (bot.options.useChat) {
|
||||
|
||||
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
|
||||
bot.chat('&8Commands &3(&6' + JSON.stringify(length) + '&3) (&bPublic &f| &5Trusted &f| &4Owner&f)')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat(`${pub_lick}`)
|
||||
await bot.chatDelay(100)
|
||||
bot.chat(`${t_rust}`)
|
||||
await bot.chatDelay(100)
|
||||
bot.chat(`${own_her}`)
|
||||
|
||||
|
||||
}else {
|
||||
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
|
||||
/*
|
||||
bot.sendFeedback([
|
||||
'Commands (',
|
||||
{text:`${JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3 && c.trustLevel != -1).length)}`,color:'gold'}, ') ',
|
||||
category,
|
||||
...pub_lick,
|
||||
t_rust
|
||||
,own_her],
|
||||
false)*/
|
||||
bot.sendFeedback([
|
||||
{ text:'Commands ',color:'dark_gray'},
|
||||
{ text:'(',color:'dark_blue'},
|
||||
{ text:`${JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3 && c.trustLevel != -1).length)}`,color:'gold'},
|
||||
{ text:') ',color:'dark_blue'},
|
||||
category,
|
||||
...pub_lick,
|
||||
t_rust,
|
||||
own_her,
|
||||
])
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
discordExecute(context){
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const message = args.join(' ')
|
||||
const CommandManager = bot.commandManager
|
||||
if (args[0]) {
|
||||
let valid
|
||||
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
if (args[0].toLowerCase() === command.name) {
|
||||
valid = true
|
||||
/* const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle('help Command')
|
||||
.setDescription(`help \u203a ${command.name}`)
|
||||
.addFields(
|
||||
{ name: '', value:`` },
|
||||
)
|
||||
bot?.discord?.Message?.reply({embeds: [Embed]})
|
||||
bot?.discord?.Message.react('♋')*/
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`${command.name} info`)
|
||||
.addFields(
|
||||
// { name: '', value: `${bot.Discord.commandPrefix + command.name}` }
|
||||
{name: `${bot.Discord.commandPrefix}${command.name} (Aliases: ${command.aliases}) \u203a ${command.description}`, value: `\u200b`,inline:false},
|
||||
{ name: `Trust Level \u203a ${command.trustLevel}`,value:'\u200b'},
|
||||
{ name: `Usage \u203a ${bot.Discord.commandPrefix}${command.name} ${command.usage}`,value:'\u200b'},
|
||||
)
|
||||
bot?.discord?.Message?.reply({embeds: [Embed]})
|
||||
bot?.discord?.Message.react('♋')
|
||||
|
||||
|
||||
break
|
||||
} else valid = false
|
||||
}
|
||||
//source is defined btw
|
||||
//source.sendFeedback([cmd, 'This command is ' + valid + ' to this for loop'])
|
||||
if (valid) {
|
||||
|
||||
} else {
|
||||
const args = context.arguments
|
||||
|
||||
throw new CommandError(`Unknown command ${args[0]}. type "${bot.Discord.commandPrefix}" for help`)
|
||||
|
||||
}
|
||||
const length = context.bot.commandManager.commandlist.length // ok
|
||||
|
||||
//context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
|
||||
} else {
|
||||
let pub_lick = []
|
||||
let t_rust = []
|
||||
let own_her = []
|
||||
for (const commands in bot.commandManager.commandlist) {
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
|
||||
// }
|
||||
|
||||
if (command.trustLevel === 2) {
|
||||
own_her.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
})
|
||||
}
|
||||
else if (command.trustLevel === 1){
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
})
|
||||
}
|
||||
else if (command.trustLevel === 0){
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`${bot.getMessageAsPrismarine(['Commands (',JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3).length),')'])?.toString()}`)
|
||||
.addFields(
|
||||
{ name: 'Public', value:`${bot.getMessageAsPrismarine(pub_lick)?.toString()}`, inline: false },
|
||||
{ name: 'Trusted', value: `${bot.getMessageAsPrismarine(t_rust)?.toString()}`, inline: false },
|
||||
{ name: 'Owner', value: `${bot.getMessageAsPrismarine(own_her)?.toString()}`,inline: false },
|
||||
)
|
||||
bot?.discord?.Message?.reply({embeds: [Embed]})
|
||||
bot?.discord?.Message.react('♋')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const packageJSON = require("../../package.json");
|
||||
const os = require('os');
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
function format(seconds) {
|
||||
function pad(s) {
|
||||
return (s < 10 ? "0" : "") + s;
|
||||
}
|
||||
var hours = Math.floor(seconds / (60 * 60));
|
||||
var minutes = Math.floor((seconds % (60 * 60)) / 60);
|
||||
var seconds = Math.floor(seconds % 60);
|
||||
return (pad(`${hours} Hours`) + " " +
|
||||
pad(`${minutes} Minutes`) + " " +
|
||||
pad(`${seconds} Seconds`))
|
||||
}
|
||||
module.exports = {
|
||||
name: "info",
|
||||
description: [
|
||||
"check the bots info",
|
||||
],
|
||||
aliases: ["information"],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"version",
|
||||
"invites",
|
||||
"server",
|
||||
"packages",
|
||||
"login",
|
||||
"config",
|
||||
"uptime",
|
||||
"contributors",
|
||||
],
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source
|
||||
switch(args.join(' ').toLowerCase()) {
|
||||
case 'version':
|
||||
if (bot.options.useChat) {
|
||||
bot.chat(`${bot.getMessageAsPrismarine({text:`${process.env.buildstring}`})?.toMotd().replaceAll('§',"&")}`)
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`${process.env.FoundationBuildString}`})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`11/22/2022 - ${date}`})
|
||||
} else {
|
||||
bot.sendFeedback({text:`${process.env.buildstring}`})
|
||||
bot.sendFeedback({text:`${process.env.FoundationBuildString}`})
|
||||
bot.sendFeedback({text:`11/22/2022 - ${date}`})
|
||||
}
|
||||
break
|
||||
case 'invites':
|
||||
bot.sendFeedback({ text: 'Discord Invite', color: "dark_gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.discord.invite}`, }, });
|
||||
bot.sendFeedback({ text: 'Matrix Invite', color: "dark_gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.matrix.invite}`, }, });
|
||||
break
|
||||
case 'server':
|
||||
if (bot.options.useChat) {
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Hostname \u203a ${os.hostname()}`, })
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Working Directory \u203a ${process.mainModule.path}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `${os.arch()}`})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text:`OS \u203a ${os.platform()}`})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `OS Version/distro \u203a ${os.version()}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Kernal Version \u203a ${os.release()}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `cores \u203a ${os.cpus().length}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `CPU \u203a ${os.cpus()[0].model}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Server Free memory `, color:'dark_gray'},{text:`${Math.floor( os.freemem() / 1048576, )} `,color:'dark_gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'dark_gray'}]);
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`Device uptime \u203a ${format(os.uptime())}`,color:'dark_gray'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`Node version \u203a ${process.version}`,color:'dark_gray'})
|
||||
} else {
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Hostname \u203a ${os.hostname()}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Working Directory \u203a ${process.mainModule.path}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `${os.arch()}`})
|
||||
bot.sendFeedback({ color: "dark_gray", text:`OS \u203a ${os.platform()}`})
|
||||
bot.sendFeedback({ color: "dark_gray", text: `OS Version/distro \u203a ${os.version()}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Kernal Version \u203a ${os.release()}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `cores \u203a ${os.cpus().length}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `CPU \u203a ${os.cpus()[0].model}`, });
|
||||
bot.sendFeedback([{text:`Server Free memory `, color:'dark_gray'},{text:`${Math.floor( os.freemem() / 1048576, )} `,color:'dark_gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'dark_gray'}]);
|
||||
bot.sendFeedback({text:`Device uptime \u203a ${format(os.uptime())}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Node version \u203a ${process.version}`,color:'dark_gray'})
|
||||
}
|
||||
break
|
||||
case 'loaded':
|
||||
let src = fs.readdirSync('./src/').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let util = fs.readdirSync('./src/util/').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let utilJSON = fs.readdirSync('./src/util/').filter(f => path.extname(f).toLowerCase() === '.json').length;
|
||||
let language = fs.readdirSync('./src/util/language').filter(f => path.extname(f).toLowerCase() === '.json').length;
|
||||
let music = fs.readdirSync('./src/util/music').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let convertor = fs.readdirSync('./src/util/music/midi_converter').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let convertorJSON = fs.readdirSync('./src/util/music/midi_converter').filter(f => path.extname(f).toLowerCase() === '.json').length
|
||||
let modules = fs.readdirSync('./src/modules').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let commands = fs.readdirSync('./src/commands').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let chat = fs.readdirSync('./src/chat').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let CommandModules = fs.readdirSync('./src/CommandModules').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let FileCount = `${src + util + utilJSON + language + music + convertor + convertorJSON + modules + commands + chat + CommandModules}`
|
||||
|
||||
|
||||
// lazy file count :shrug:
|
||||
// source.sendFeedback([{text:'Package Count \u203a ',color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
|
||||
if (bot.options.useChat) {
|
||||
bot.sendFeedback([{text:'Package Count \u203a ', color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
|
||||
} else {
|
||||
// bot.sendFeedback([{text:'Packages \u203a ',color:'dark_gray'},{text:`${Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')}`}])
|
||||
bot.sendFeedback([{text:'Package Count \u203a ', color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'File count ',color:'dark_gray'},{text:'(',color:'dark_blue'},{text:`${FileCount}`,color:'gold'},{text:')',color:'dark_blue'}])
|
||||
}
|
||||
break
|
||||
case 'login':
|
||||
if (bot.options.useChat) {
|
||||
bot.sendFeedback({text:`Minecraft Username \u203a ${bot.options.username}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
bot.sendFeedback({text: `uuid \u203a ${bot.uuid}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
/*if(bot.discord === undefined){
|
||||
bot.sendFeedback({text:'Currently not logged into discord',color:'dark_red'})
|
||||
await bot.chatDelay(150)
|
||||
}else{
|
||||
bot.sendFeedback({text:`Discord Username \u203a ${bot.discord.client.user.username + '#' + bot.discord.client.user.discriminator}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
} */
|
||||
await bot.chatDelay(150)
|
||||
/*if (bot.matrix.client === undefined){
|
||||
bot.sendFeedback({text:'Currently not logged into matrix',color:'dark_red'})
|
||||
}else{
|
||||
bot.sendFeedback({text: `Matrix Username \u203a ${bot.matrix.client.credentials.userId}`,color:'dark_gray'})
|
||||
}*/
|
||||
await bot.chatDelay(150)
|
||||
bot.sendFeedback({text:`Server \u203a ${bot.options.serverName}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
bot.sendFeedback({text:`Server IP \u203a ${bot.options.host + ':' + bot.options.port}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
source.sendFeedback({text:`Version \u203a ${bot.options.version}`,color:'dark_gray'})
|
||||
} else {
|
||||
bot.sendFeedback({text:`Minecraft Username \u203a ${bot.options.username}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text: `uuid \u203a ${bot.uuid}`,color:'dark_gray'})
|
||||
if(bot.discord === undefined){
|
||||
bot.sendFeedback({text:'Currently not logged into discord',color:'dark_red'})
|
||||
}else{
|
||||
bot.sendFeedback({text:`Discord Username \u203a ${bot.discord.client.user.username + '#' + bot.discord.client.user.discriminator}`,color:'dark_gray'})
|
||||
}
|
||||
if (bot.matrix.client === undefined){
|
||||
bot.sendFeedback({text:'Currently not logged into matrix',color:'dark_red'})
|
||||
}else{
|
||||
bot.sendFeedback({text: `Matrix Username \u203a ${bot.matrix.client.credentials.userId}`,color:'dark_gray'})
|
||||
}
|
||||
bot.sendFeedback({text:`Server \u203a ${bot.options.serverName}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Server IP \u203a ${bot.options.host + ':' + bot.options.port}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Version \u203a ${bot.options.version}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Discord channel \u203a ${bot.discord.channel.name}`,color:'dark_gray'})
|
||||
}
|
||||
break
|
||||
case 'config':
|
||||
if (bot.options.useChat) {
|
||||
bot.sendFeedback({text:`Prefixes \u203a ${bot.Commands.prefixes}`,color:'dark_gray'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Core enabled? `,color:'dark_gray'},{text:`${bot.options.Core.enabled}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
//bot.sendFeedback([{text:'Discord enabled? ',color:'dark_gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
//bot.sendFeedback([{text:'Matrix enabled? ',color:'dark_gray'},{text:`${bot.matrix.enabled}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:'Console logging enabled? ',color:'dark_gray'},{text:`${bot.options.Console.enabled}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:'Chat filelogging enabled? ',color:'dark_gray'},{text:`${bot.Console.filelogging}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:'Multiconnect Server count \u203a ',color:'dark_gray'},{text:`${Object.keys(bot.bots).length}`,color:'gold'}])
|
||||
} else {
|
||||
bot.sendFeedback({text:`Prefixes \u203a ${bot.Commands.prefixes}`,color:'dark_gray'})
|
||||
bot.sendFeedback([{text:`Core enabled? `,color:'dark_gray'},{text:`${bot.options.Core.enabled}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Discord enabled? ',color:'dark_gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Matrix enabled? ',color:'dark_gray'},{text:`${bot.matrix.enabled}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Console logging enabled? ',color:'dark_gray'},{text:`${bot.options.Console.enabled}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Chat filelogging enabled? ',color:'dark_gray'},{text:`${bot.Console.filelogging}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Multiconnect Server count \u203a ',color:'dark_gray'},{text:`${Object.keys(bot.bots).length}`,color:'gold'}])
|
||||
}
|
||||
break
|
||||
case 'uptime':
|
||||
bot.sendFeedback([{text:`${format(process.uptime())}`,color:'dark_gray'}])
|
||||
break
|
||||
case 'contributors':
|
||||
if (bot.options.useChat) {
|
||||
bot.chat('&4Parker&02991')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&a_ChipMC_')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&eChayapak')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat(bot.getMessageAsPrismarine({ text: "_yfd", color: "light_purple"})?.toMotd().replaceAll('§','&'))
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&6aaa')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&aMorganAnkan')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&2TurtleKid')
|
||||
} else {
|
||||
bot.sendFeedback({ translate: "%s%s", with: [ { color: "dark_red", text: "Parker" }, { color: "black", text: "2991" }, ], hoverEvent: { action: "show_text", value: [ { text: "FNF", color: "dark_purple", bold: true, }, { text: "Boyfriend", color: "aqua", bold: true, }, { text: "Bot ", color: "dark_red", bold: true, }, { text: "Discord", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `${bot.Discord.invite}`, }, });
|
||||
bot.sendFeedback({ text: "_ChipMC_", color: "dark_green", translate: "", hoverEvent: { action: "show_text", value: [ { text: "chipmunk dot land", color: "green", }, ], }, clickEvent: { action: "open_url", value: `https://chipmunk.land`, }, });
|
||||
bot.sendFeedback({ text: "chayapak", color: "yellow", translate: "", hoverEvent: { action: "show_text", value: [ { text: "Chomens ", color: "yellow", }, { text: "Discord (dead)", color: "blue", }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/xdgCkUyaA4`, }, });
|
||||
bot.sendFeedback({ text: "_yfd", color: "light_purple", translate: "", hoverEvent: { action: "show_text", value: [ { text: "ABot ", color: "gold", bold: true, }, { text: "Discord (gone)", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/CRfP2ZbG8T`, }, });
|
||||
bot.sendFeedback({ text: "aaa", color: "gold" });
|
||||
bot.sendFeedback({text:"MorganAnkan",color:"dark_green"})
|
||||
bot.sendFeedback({text:"TurtleKid",color:'green'})
|
||||
}
|
||||
break
|
||||
case 'thankyou':
|
||||
var prefix = "&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r ";
|
||||
bot.core.run( "bcraw " + prefix + "Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!",)
|
||||
break
|
||||
default:
|
||||
bot.sendError({text:'Invalid Argument!!'})
|
||||
|
||||
}
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
switch(args.join(' ').toLowerCase()) {
|
||||
/*
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`${bot.getMessageAsPrismarine({ text: util.inspect(eval(args.slice(0).join(' ')), { stylize }) })?.toString()}`)
|
||||
bot.discord.Message.reply({embeds: [Embed]})
|
||||
*/
|
||||
case 'version':
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription('\u200b')
|
||||
.addFields(
|
||||
{name:`${process.env.buildstring}`,value:'\u200b'},
|
||||
{name:`${process.env.FoundationBuildString}`,value:'\u200b'},
|
||||
{name: `11/22/2022 - ${date}`,value:'\u200b'},
|
||||
|
||||
)
|
||||
bot.discord.Message.reply({embeds: [Embed]})
|
||||
break
|
||||
case 'invites':
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription('\u200b')
|
||||
.addFields(
|
||||
{name:`${bot.Discord.invite}`,value:'\u200b'},
|
||||
{name:`${bot.matrix.invite}`,value:'\u200b'},
|
||||
)
|
||||
bot.discord.Message.reply({embeds: [Embed]})
|
||||
break
|
||||
case 'server':
|
||||
bot.discord.Message.reply(`Hostname \u203a ${os.hostname()}\nWorking Directory \u203a ${process.mainModule.path}\nOS \u203a ${os.platform()}\nKernal Version \u203a ${os.release()}\ncores \u203a ${os.cpus().length}\nCPU \u203a ${os.cpus()[0].model}\nServer Free memory ${Math.floor( os.freemem() / 1048576 )} MiB / ${Math.floor(os.totalmem() / 1048576)} MiB\nDevice uptime \u203a ${format(os.uptime())}\nNode version \u203a ${process.version}`)
|
||||
|
||||
|
||||
break
|
||||
case 'packages':
|
||||
let packages = Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription('\u200b')
|
||||
.addFields(
|
||||
{name:`Packages \u203a ${JSON.stringify(packages)}`,value:'\u200b'},
|
||||
{name:`Package Count \u203a ${Object.keys(packageJSON.dependencies).length}`,value:'\u200b'},
|
||||
)
|
||||
bot.discord.Message.reply({embeds: [Embed]})
|
||||
break
|
||||
/*
|
||||
case 'packages':
|
||||
// source.sendFeedback([{text:'Package Count \u203a ',color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Packages \u203a ',color:'dark_gray'},{text:`${Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')}`}])
|
||||
bot.sendFeedback([{text:'Package Count \u203a ', color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
const timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'kick',
|
||||
|
||||
description: ['kicks a player'],
|
||||
|
||||
trustLevel: 1,
|
||||
aliases: [],
|
||||
usage: ['sussy <player>', 'invalidstring <player>'],
|
||||
execute (context) {
|
||||
// throw new CommandError('temp disabled')
|
||||
// throw new CommandError('command temporarily disabled until hashing is implemented')
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case 'sussy':
|
||||
if (args[2] === 'clear' || args[2] === 'stop') {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
|
||||
bot.sendFeedback('Cloop Stopped', false)
|
||||
return
|
||||
}
|
||||
|
||||
// if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
|
||||
// anti fard
|
||||
|
||||
const target = context.player// let me hashonly it rq
|
||||
this.timer = setInterval(function () { // Wait, is this command public?
|
||||
repeat(context.bot, 400, `tellraw ${args[2]} {"text":"${'ඞ'.repeat(20000)}","bold":true,"italic":true,"obfuscated":true,"color":"#FF0000"}`)
|
||||
}, 10)
|
||||
|
||||
// i found that there is a limit
|
||||
|
||||
// Repeat the command over and over.
|
||||
function repeat (bot, repetitions, cmd) {
|
||||
for (let i = 0; i < repetitions; i++) {
|
||||
bot.core.run(cmd)
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'invalidstring':
|
||||
bot.core.run(`minecraft:tellraw ${args[2]} ${process.env.invalidstring}`)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
module.exports = {
|
||||
name: 'list',
|
||||
description:['check the player list'],
|
||||
trustLevel: 0,
|
||||
aliases:['playerlist', 'plist', 'pl'],
|
||||
usage:[""],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const players = bot.players
|
||||
const source = context.source
|
||||
const component = []
|
||||
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
if (args.length !== 0){
|
||||
throw new CommandError({translate:"Too many Arguments!", color:"red"})
|
||||
}
|
||||
|
||||
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: `%s \u203a %s [%s %s %s %s %s]`,
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text:`Ping:`,color:'dark_green'},
|
||||
{text:`${player.latency}`,color:'gold'},
|
||||
{text:'/',color:'dark_gray'},
|
||||
{text:`Gamemode:`, color:'dark_purple'},
|
||||
{text:`${player.gamemode}`,color:'gold'},
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
|
||||
component.pop()
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
/*
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s %s %s]',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`,color:'dark_green'},
|
||||
{text:'/',color:'dark_gray'},
|
||||
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
*/
|
||||
if(source.sources.console){
|
||||
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi())
|
||||
|
||||
}else
|
||||
if(!bot.options.Core.enabled){
|
||||
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
for (const player of players){
|
||||
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(500) ?? player.displayName ?? player.profile.name ).toMotd().replaceAll('§', '&') + `\u203a ${player.uuid} Ping: [&a${player.latency}&f]`)
|
||||
}
|
||||
}else{
|
||||
|
||||
//const players = bot.players
|
||||
|
||||
bot.tellraw([{text:`Players: `,color:'dark_gray',},{text:'(',color:'blue'},{text:`${JSON.stringify(bot.players.length)}`,color:'gold'},{text:')',color:'blue'}])
|
||||
bot.tellraw(component)
|
||||
|
||||
}
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const players = bot.players
|
||||
/*
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle('help Command')
|
||||
.setDescription(`help \u203a ${command.name}`)
|
||||
.addFields(
|
||||
{ name: '', value:`` },
|
||||
)
|
||||
bot?.discord?.Message?.reply({embeds: [Embed]})
|
||||
bot?.discord?.Message.react('♋')
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s %s %s]',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`,color:'dark_green'},
|
||||
{text:'/',color:'dark_gray'},
|
||||
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
*/
|
||||
const component = []
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s %s %s]',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`,color:'dark_green'},
|
||||
{text:'/',color:'dark_gray'},
|
||||
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
|
||||
bot.discord.Message.reply({embeds: [Embed]})
|
||||
|
||||
}
|
||||
}
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -0,0 +1,42 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'memusage',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['check the bots memusage'],
|
||||
trustLevel: 0,
|
||||
aliases:['memoryusage', 'memused','memoryused'],
|
||||
usage:[
|
||||
"on",
|
||||
"off"
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
|
||||
switch (args[0]) {
|
||||
case 'on':
|
||||
bot.memusage.on()
|
||||
|
||||
bot.sendFeedback({text: 'Memusage is now enabled', color:'green'})
|
||||
break
|
||||
case 'off':
|
||||
bot.memusage.off()
|
||||
bot.sendFeedback({text:'Memusage is now disabled', color:'red'})
|
||||
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -0,0 +1,256 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const fs = require('fs/promises')
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
const path = require('path')
|
||||
const getFilenameFromUrl = require('../util/getFilenameFromUrl')
|
||||
const fileExists = require('../util/file-exists')
|
||||
const fileList = require('../util/file-list')
|
||||
const axios = require('axios')
|
||||
const os = require('os')
|
||||
|
||||
let SONGS_PATH
|
||||
|
||||
|
||||
SONGS_PATH = path.join(__dirname, '../../', 'midis')
|
||||
|
||||
let song
|
||||
async function play (bot, values, selector, config) {
|
||||
try {
|
||||
const filepath = values.join(' ')
|
||||
|
||||
const seperator = path.sep // for hosting bot on windows
|
||||
|
||||
let absolutePath
|
||||
if (filepath.includes(seperator) && filepath !== '') {
|
||||
const pathSplitted = filepath.split(seperator)
|
||||
|
||||
const songs = await fileList(
|
||||
path.join(
|
||||
SONGS_PATH,
|
||||
pathSplitted[0]
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
const lowerCaseFile = pathSplitted.pop().toLowerCase()
|
||||
const file = songs.filter((song) => song.toLowerCase().includes(lowerCaseFile))[0]
|
||||
|
||||
absolutePath = await resolve(path.join(pathSplitted.join(seperator), file))
|
||||
} else {
|
||||
const songs = await fileList(SONGS_PATH)
|
||||
const file = songs.filter((song) => song.toLowerCase().includes(filepath.toLowerCase()))[0]
|
||||
absolutePath = await resolve(file)
|
||||
}
|
||||
|
||||
song = await bot.music.load(await fs.readFile(absolutePath), path.basename(absolutePath))
|
||||
|
||||
|
||||
bot.sendFeedback([{ text: 'Added ', color: 'dark_gray' }, { text: song.name, color: '#00FFFF' }, { text: ' to the song queue', color: 'dark_gray' }])
|
||||
|
||||
|
||||
bot.music.queue.push(song)
|
||||
bot.music.play(song)
|
||||
} catch (e) {
|
||||
bot.console.error(e.stack)
|
||||
|
||||
bot.sendFeedback({ text: 'SyntaxError: Invalid file', color: 'red' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function playUrl (bot, values, selector, config) {
|
||||
let response
|
||||
try {
|
||||
const url = values.join(' ')
|
||||
response = await axios.get('http://localhost:8080', {
|
||||
params: {
|
||||
uri: url
|
||||
},
|
||||
responseType: 'arraybuffer'
|
||||
})
|
||||
|
||||
song = await bot.music.load(response.data, getFilenameFromUrl(url))
|
||||
bot.sendFeedback([{ text: 'Added ', color: 'dark_gray' }, { text: song.name, color: '#00FFFF' }, { text: ' to the song queue', color: 'dark_gray' }])
|
||||
|
||||
|
||||
bot.music.queue.push(song)
|
||||
bot.music.play(song)
|
||||
} catch (_err) {
|
||||
const e = _err.toString().includes('Bad MIDI file. Expected \'MHdr\', got: ') ? response.data.toString() : _err
|
||||
|
||||
bot.sendFeedback({ text: e, color: 'red' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function resolve (filepath) {
|
||||
if (!path.isAbsolute(filepath) && await fileExists(SONGS_PATH)) {
|
||||
return path.join(SONGS_PATH, filepath)
|
||||
}
|
||||
return filepath
|
||||
}
|
||||
|
||||
async function list (bot, discord, channeldc, prefix, selector, args, config) {
|
||||
try {
|
||||
let absolutePath
|
||||
if (args[1]) absolutePath = await resolve(path.join(SONGS_PATH, args.slice(1).join(' ')))
|
||||
else absolutePath = await resolve(SONGS_PATH)
|
||||
|
||||
if (!absolutePath.includes('midis')) throw new Error('bro trying to hack my server?!/1?!')
|
||||
|
||||
const listed = await fileList(absolutePath)
|
||||
let primary = true
|
||||
const message = []
|
||||
|
||||
for (const value of listed) {
|
||||
const isFile = (await fs.lstat(path.join(absolutePath, value))).isFile()
|
||||
message.push({
|
||||
text: value + ' ',
|
||||
color: (!((primary = !primary)) ? 'aqua' : 'blue'),
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${prefix}music ${isFile ? 'play' : 'list'} ${path.join(args.slice(1).join(' '), value)}`
|
||||
},
|
||||
hoverEvent: {
|
||||
action: 'show_text',
|
||||
contents: [
|
||||
{ text: 'Name: ', color: 'dark_gray' },
|
||||
{ text: value, color: '#00FFFF' },
|
||||
'\n',
|
||||
{ text: 'Click here to suggest the command!', color: 'green' }
|
||||
]
|
||||
}
|
||||
})
|
||||
};
|
||||
bot.sendFeedback([{ text: 'Songs ', color: 'dark_gray' },{ text: '(', color:'dark_blue' },{text: `${Object.keys(listed).length}`, color: 'gold' },{ text: ')', color: 'dark_blue' }])
|
||||
bot.sendFeedback(message)
|
||||
} catch (e) {
|
||||
|
||||
bot.sendFeedback({ text: e.toString(), color: 'red' })
|
||||
}
|
||||
|
||||
};
|
||||
module.exports = {
|
||||
name: 'music',
|
||||
description: 'Plays music',
|
||||
aliases: [],
|
||||
trustLevel: 0,
|
||||
usage: [
|
||||
'play <song|url>',
|
||||
'stop',
|
||||
'loop <all|current|off>',
|
||||
'list [directory]',
|
||||
'skip',
|
||||
'nowplaying',
|
||||
'queue'
|
||||
],
|
||||
execute (context, selector, config) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const prefix = bot.Commands.prefixes[0]
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (args[0]) {
|
||||
case 'play':
|
||||
case 'playurl': // deprecated
|
||||
|
||||
if (args.slice(1).join(' ').startsWith('http')) {
|
||||
playUrl(bot, args.slice(1), false, null, selector, config)
|
||||
} else {
|
||||
play(bot, args.slice(1), false, null, selector, config)
|
||||
}
|
||||
break
|
||||
case 'stop':
|
||||
bot.sendFeedback({ text: 'Cleared the song queue', color: 'dark_gray' })
|
||||
bot.music.stop()
|
||||
break
|
||||
case 'skip':
|
||||
try {
|
||||
bot.sendFeedback([{ text: 'Skipping ', color: 'dark_gray' }, { text: bot.music.song.name, color: '#00FFFF' }])
|
||||
bot.music.skip()
|
||||
} catch (e) {
|
||||
throw new CommandError('No music is currently playing!')
|
||||
}
|
||||
break
|
||||
case 'volume':
|
||||
if (isNaN(args.slice(1))) {
|
||||
throw new CommandError('Argument is not a number')
|
||||
} else if(args.slice(1) >= 6) {
|
||||
throw new CommandError('Too high!')
|
||||
} else {
|
||||
bot.music.volume = args.slice(1)
|
||||
bot.sendFeedback([{ text: 'Setting music volume to ', color: 'dark_gray'},{ text: `${bot.music.volume}`, color: 'gold'}])
|
||||
}
|
||||
break
|
||||
case 'loop':
|
||||
switch (args[1]) {
|
||||
case 'off':
|
||||
bot.music.loop = 0
|
||||
bot.sendFeedback([
|
||||
{
|
||||
text: 'Looping is now ',
|
||||
color: 'dark_gray',
|
||||
},
|
||||
{
|
||||
text: 'disabled',
|
||||
color: 'red'
|
||||
}
|
||||
])
|
||||
break
|
||||
case 'current':
|
||||
bot.music.loop = 1
|
||||
bot.sendFeedback([
|
||||
{
|
||||
text: 'Now Looping ',
|
||||
color: 'dark_gray'
|
||||
},
|
||||
{
|
||||
text: song.name,
|
||||
color: '#00FFFF'
|
||||
}
|
||||
])
|
||||
break
|
||||
case 'all':
|
||||
bot.music.loop = 2
|
||||
bot.sendFeedback({
|
||||
text: 'Now looping every song',
|
||||
|
||||
})
|
||||
break
|
||||
default:
|
||||
throw new SyntaxError('Invalid argument')
|
||||
}
|
||||
break
|
||||
case 'list':
|
||||
list(bot, false, null, prefix, selector, args, config)
|
||||
break
|
||||
case 'nowplaying':
|
||||
bot.sendFeedback([
|
||||
{
|
||||
text: 'Now playing ',
|
||||
color: 'dark_gray',
|
||||
},
|
||||
{
|
||||
text: bot.music.song.name,
|
||||
color: '#00FFFF'
|
||||
}
|
||||
])
|
||||
break
|
||||
case 'queue':
|
||||
const queueWithName = []
|
||||
for (const song of bot.music.queue) queueWithName.push(song.name)
|
||||
bot.sendFeedback([
|
||||
{
|
||||
text: 'Queue: ',
|
||||
color: 'dark_gray'
|
||||
},
|
||||
{
|
||||
text: queueWithName.join(', '),
|
||||
color: '#00FFFF'
|
||||
}
|
||||
])
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
module.exports = {
|
||||
name: 'netmsg',
|
||||
description:['send a message to other servers'],
|
||||
trustLevel:0,
|
||||
aliases:['networkmessage'],
|
||||
usage:["<message>"],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
|
||||
//throw new CommandError('ohio')
|
||||
const component = {
|
||||
translate: '[%s] [%s] %s \u203a %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: 'aqua'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
bold: true,
|
||||
color: 'dark_red'
|
||||
},
|
||||
],
|
||||
},
|
||||
bot.options.serverName,
|
||||
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
message
|
||||
]//command.split(' ')[0]
|
||||
}//string.replace()
|
||||
if (!message[0]) {
|
||||
bot.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
for (const eachBot of bot.bots)
|
||||
if(!bot.options.Core.enabled){
|
||||
eachBot.chat(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(context.source.player.displayName ?? context.source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${message}`)
|
||||
}else{
|
||||
eachBot.tellraw(component)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
bot.options.host + ':' + bot.options.port,
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
message
|
||||
[%s%s%s] [%s] %s \u203a %s
|
||||
*/
|
||||
@@ -1,24 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class kill extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"kill",
|
||||
[
|
||||
"suicide",
|
||||
"quit"
|
||||
],
|
||||
"kill the bots process",
|
||||
trustLevel.owner,
|
||||
[""],
|
||||
false
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
module.exports = kill;
|
||||
@@ -0,0 +1,39 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const util = require('util')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
module.exports = {
|
||||
name: 'playerinfo',
|
||||
description:[''],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"",
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
try{
|
||||
//const player = bot.players.find(player => player.profile.name === `${args.join(' ')}`)
|
||||
const player = bot.players.find(player => player.profile.name === `${args.join(' ')}`)
|
||||
//bot.players.map(pl => pl.profile.name).filter((name) => name == "Ski")
|
||||
if(player === undefined) {
|
||||
|
||||
bot.tellraw('Unknown Player')
|
||||
}else{
|
||||
bot.sendFeedback([{text:`Player Name: `,color:'dark_gray'},{text:`${player.profile.name}`}])
|
||||
bot.sendFeedback([{text:`Player UUID: `,color:'dark_gray'},{text:`${player.uuid}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:`Player Gamemode: `,color:'dark_gray'},{text:`${player.gamemode}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:`Player Latency: `,color:'dark_gray'},{text:`${player.latency}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:`Player DisplayName: `,color:'dark_gray'},{text:`${bot.getMessageAsPrismarine(player.displayName ?? player.profile.name)?.toMotd().replaceAll('§','§')}`}])
|
||||
}
|
||||
}catch(e){
|
||||
bot.tellraw(`${e}`)
|
||||
}//bot.players.find(player => player.profile.name === `Ski`); bot.getMessageAsPrismarine(e.displayName)?.toMotd().replaceAll('§','§')
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class core extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"core",
|
||||
[
|
||||
"cb",
|
||||
"cbrun",
|
||||
"corerun"
|
||||
],
|
||||
"run commands in core",
|
||||
trustLevel.public,
|
||||
[
|
||||
"$username <message>",
|
||||
"$uuid <message>",
|
||||
"<message>"
|
||||
],
|
||||
false,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
|
||||
if (args.includes("$username") || args.includes("$uuid")) {
|
||||
bot.players.forEach((eachPlayer) => {
|
||||
bot.core.runTracked(
|
||||
args
|
||||
.join(" ")
|
||||
.replaceAll("$username", eachPlayer.profile.name)
|
||||
.replaceAll("$uuid", eachPlayer.uuid),
|
||||
source,
|
||||
);
|
||||
});
|
||||
} else if (bot.options.mode === "savageFriends") {
|
||||
bot.core.run(args.join(" "));
|
||||
} else {
|
||||
bot.core.runTracked(args.join(" "), source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = core;
|
||||
@@ -1,26 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class echo extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"echo",
|
||||
[
|
||||
"say",
|
||||
"botsay"
|
||||
],
|
||||
"make me say something!",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
bot.chat.send(`${args.join(" ")}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = echo;
|
||||
@@ -1,57 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class extras extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"extras",
|
||||
[],
|
||||
"send messages via the extras channel",
|
||||
trustLevel.public,
|
||||
[
|
||||
"send",
|
||||
"register",
|
||||
"unregister",
|
||||
"unregisterall"
|
||||
],
|
||||
true,
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source
|
||||
|
||||
if (
|
||||
!args
|
||||
&&
|
||||
!args[0]
|
||||
&&
|
||||
!args[1]
|
||||
&&
|
||||
!args[2]
|
||||
) return;
|
||||
|
||||
switch (args[0]) {
|
||||
case "send":
|
||||
bot.extras.send(args[1], args.slice(2).join(" "))
|
||||
source.sendFeedback(`sent ${args.slice(2).join(" ")} to channel ${args[1]}`)
|
||||
break
|
||||
case "register":
|
||||
bot.extras.register(args[1])
|
||||
source.sendFeedback(`registered ${args[1]} channel`)
|
||||
break
|
||||
case "unregister":
|
||||
bot.extras.unregister(args[1])
|
||||
source.sendFeedback(`unregistered from ${args[1]} channel`)
|
||||
console.log(bot.extras.channels)
|
||||
break
|
||||
case "unregisterall":
|
||||
bot.extras.unregisterAll();
|
||||
source.sendFeedback("unregistered all channels")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = extras;
|
||||
@@ -1,229 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class help extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"help",
|
||||
[
|
||||
"heko",
|
||||
"?",
|
||||
"cmds",
|
||||
"commands",
|
||||
"hell"
|
||||
],
|
||||
"see a list of commands",
|
||||
trustLevel.public,
|
||||
["<command>"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const source = context.source;
|
||||
const translations = bot.translations;
|
||||
|
||||
let component = [];
|
||||
let infoComponent = [];
|
||||
let usagesComponent = [];
|
||||
let Public = [];
|
||||
let trusted = [];
|
||||
let admin = [];
|
||||
let owner = [];
|
||||
let Console = [];
|
||||
|
||||
component.push({
|
||||
translate: "%s %s \u203a\n",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.command_layout",
|
||||
fallback: translations["fnfboyfriendbot.command.help.command_layout"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ':', color: config.colors.commands.tertiary },
|
||||
{ text: '(', color: config.colors.commands.tertiary },
|
||||
{ text: `${bot.commandManager.commandlist.length}`, color: config.colors.integer },
|
||||
{ text: ')', color: config.colors.commands.tertiary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.category",
|
||||
fallback: translations["fnfboyfriendbot.command.help.category"],
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.trust_level.public",
|
||||
fallback: translations["fnfboyfriendbot.command.help.trust_level.public"],
|
||||
color: config.colors.help.public
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.trust_level.trusted",
|
||||
fallback: translations["fnfboyfriendbot.command.help.trust_level.trusted"],
|
||||
color: config.colors.help.trusted
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.trust_level.admin",
|
||||
fallback: translations["fnfboyfriendbot.command.help.trust_level.admin"],
|
||||
color: config.colors.help.admin
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.trust_level.owner",
|
||||
fallback: translations["fnfboyfriendbot.command.help.trust_level.owner"],
|
||||
color: config.colors.help.owner
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
for (const commands of bot.commandManager.commandlist) {
|
||||
switch (commands.data.trustLevel) {
|
||||
case 0:
|
||||
Public.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.public,
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
trusted.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.trusted,
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
admin.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.admin,
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
owner.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.owner,
|
||||
});
|
||||
break;
|
||||
case 4:
|
||||
Console.push({
|
||||
text: commands.data.name + " ",
|
||||
color: config.colors.help.console,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
if (
|
||||
args[0]?.toLowerCase() === commands.data.name?.toLowerCase() ||
|
||||
commands.data.aliases.find(
|
||||
(e) => e?.toLowerCase() === args[0]?.toLowerCase(),
|
||||
)
|
||||
) {
|
||||
for (const usages of commands.data.usages) {
|
||||
usagesComponent.push({
|
||||
translate: "%s%s %s",
|
||||
with: [
|
||||
{
|
||||
text: `${config.prefixes[0]}`,
|
||||
color: config.colors.commands.primary,
|
||||
},
|
||||
{
|
||||
text: `${commands.data.name}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{ text: `${usages}`, color: config.colors.commands.secondary },
|
||||
],
|
||||
});
|
||||
|
||||
usagesComponent.push("\n");
|
||||
}
|
||||
|
||||
usagesComponent.pop();
|
||||
|
||||
infoComponent.push({
|
||||
translate: "%s\n%s\n%s\n%s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.info.command",
|
||||
fallback: translations["fnfboyfriendbot.command.help.info.command"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
commands.data.name,
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.info.alias",
|
||||
fallback: translations["fnfboyfriendbot.command.help.info.alias"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
commands.data.aliases.toString().replaceAll(',',' ')
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.info.description",
|
||||
fallback: translations["fnfboyfriendbot.command.help.info.description"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
commands.data.description
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.info.trust_level",
|
||||
fallback: translations["fnfboyfriendbot.command.help.info.trust_level"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${commands.data.trustLevel}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.help.usages",
|
||||
fallback: translations["fnfboyfriendbot.command.help.info.usages"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
usagesComponent
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
})
|
||||
source.sendFeedback(infoComponent)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Public.length > 0) {
|
||||
component.push(Public);
|
||||
if (trusted.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (trusted.length > 0) {
|
||||
component.push(trusted);
|
||||
if (admin.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (admin.length > 0) {
|
||||
component.push(admin);
|
||||
if (owner.length > 0) component.push("\n");
|
||||
}
|
||||
|
||||
if (owner.length > 0) {
|
||||
component.push(owner);
|
||||
}
|
||||
|
||||
if (source.sources.console && Console.length > 0) {
|
||||
component.push(Console);
|
||||
}
|
||||
|
||||
source.sendFeedback(component)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = help;
|
||||
@@ -1,457 +0,0 @@
|
||||
const os = require("os");
|
||||
const CommandError = require("../../commandUtil/CommandError");
|
||||
const botInfo = require("../../data/info.json");
|
||||
const { execSync } = require("child_process");
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
function format(seconds) {
|
||||
function pad(s) {
|
||||
return (s < 10 ? "0" : "") + s;
|
||||
}
|
||||
var hours = Math.floor(seconds / (60 * 60));
|
||||
var minutes = Math.floor((seconds % (60 * 60)) / 60);
|
||||
var seconds = Math.floor(seconds % 60);
|
||||
return (
|
||||
pad(`${hours} Hours`) +
|
||||
" " +
|
||||
pad(`${minutes} Minutes`) +
|
||||
" " +
|
||||
pad(`${seconds} Seconds`)
|
||||
);
|
||||
}
|
||||
|
||||
class info extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"info",
|
||||
["information"],
|
||||
"check the bots info",
|
||||
trustLevel.public,
|
||||
[
|
||||
"about",
|
||||
"config",
|
||||
"contributors/credits",
|
||||
"discord",
|
||||
"loaded",
|
||||
"usages ",
|
||||
"uptimes",
|
||||
"server",
|
||||
"version",
|
||||
],
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const discordClient = context.discordClient;
|
||||
const source = context.source;
|
||||
const translations = bot.translations;
|
||||
let component = [];
|
||||
|
||||
switch (args[0]?.toLowerCase()) {
|
||||
case "about":
|
||||
component.push({
|
||||
translate: "fnfboyfriendbot.command.info.about",
|
||||
fallback: translations["fnfboyfriendbot.command.info.about"],
|
||||
color: config.colors.commands.primary,
|
||||
})
|
||||
break;
|
||||
case "config":
|
||||
component.push({
|
||||
translate: "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.server.ip",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.server.ip"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${bot.options.host}`, color: config.colors.commands.primary },
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${bot.options.port}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.server.name",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.server.name"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
bot.options.serverName
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.minecraft.username",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.minecraft.username"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${bot._client.username}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.minecraft.version",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.minecraft.version"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${bot._client.version}`, color: config.colors.commands.secondary },
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.discord.username",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.discord.username"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${discordClient?.user?.tag}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.discord.channel",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.discord.channel"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${bot.discord?.channel?.name}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.server.count",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.server.count"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${bot.bots.length}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.prefixes",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.prefixes"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${config.prefixes.map((e) => e + " ").join(' ')}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.config.mode",
|
||||
fallback: translations["fnfboyfriendbot.command.info.config.mode"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${bot.options.mode}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
break;
|
||||
case "contributors":
|
||||
case "credits":
|
||||
component.push({
|
||||
translate: "%s%s - %s\n%s:\n%s\n%s\n%s\n%s\n%s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Parker", color: "dark_red" },
|
||||
{ text: "2991", color: "black" },
|
||||
{ text: "Owner" },
|
||||
{ text: "Contributors" },
|
||||
{ text: "_ChipMC_", color: "dark_blue" },
|
||||
{ text: "chayapak", color: "yellow" },
|
||||
{ text: "_yfd", color: "light_purple" },
|
||||
{ text: "aaa/ImFloriz", color: "gold" },
|
||||
{ text: "Ploat/ImGloriz", color: "#cd8ccb" },
|
||||
{ text: "TurtleKid", color: "green" }
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "discord":
|
||||
component.push({
|
||||
translate: "fnfboyfriendbot.command.info.discord",
|
||||
fallback: translations["fnfboyfriendbot.command.info.discord"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${config.discord.invite}`, color: config.colors.commands.secondary }
|
||||
],
|
||||
hover_event: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "click here to join the discord server!",
|
||||
color: `${config.colors.commands.primary}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
click_event: {
|
||||
action: "open_url",
|
||||
url: `${config.discord.invite}`,
|
||||
}
|
||||
})
|
||||
break;
|
||||
case "loaded":
|
||||
component.push({
|
||||
translate: "%s\n%s",
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.loaded.commands",
|
||||
fallback: translations["fnfboyfriendbot.command.info.loaded.commands"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${bot.commandManager.commandlist.length}`, color: config.colors.integer}
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.loaded.modules",
|
||||
fallback: translations["fnfboyfriendbot.command.info.loaded.modules"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${bot.modules.length}`, color: config.colors.integer }
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
break;
|
||||
case "server":
|
||||
component.push({
|
||||
translate: "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.hostname",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.hostname"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${os.hostname()}`, color: config.colors.commands.secondary },
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.user",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.user"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${os.userInfo().username}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.directory",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.directory"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${require.main.path}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.arch",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.arch"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${os.arch}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.os",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.os"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${os.platform}`, color: config.colors.commands.primary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.os.version",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.os.version"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${os.version()}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.kernel_version",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.kernel_version"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${os.release()}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.cpu",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.cpu"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${os.cpus()[0].model}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.cpu.cores",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.cpu.cores"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${os.cpus().length}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.processes",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.processes"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${execSync("ps aux | wc -l").toString().replace("\n", "")}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.node_version",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.node_version"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${process.version}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.server.npm_version",
|
||||
fallback: translations["fnfboyfriendbot.command.info.server.npm_version"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${execSync("npm -v").toString().replaceAll("\n", "")}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
break;
|
||||
case "usages":
|
||||
component.push({
|
||||
translate: "%s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.usages.botmem",
|
||||
fallback: translations["fnfboyfriendbot.command.info.usages.botmem"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${Math.floor(process.memoryUsage().heapUsed / 1048576)}`, color: config.colors.integer },
|
||||
{ text: `${Math.floor(process.memoryUsage().heapTotal / 1048576)}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.usages.servermem",
|
||||
fallback: translations["fnfboyfriendbot.command.info.usages.servermem"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${Math.floor(os.totalmem() / 1048576) - Math.floor(os.freemem() / 1048576)}`, color: config.colors.integer },
|
||||
{ text: `${Math.floor(os.totalmem() / 1048576)}`, color: config.colors.integer }
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
break;
|
||||
case "uptimes":
|
||||
component.push({
|
||||
translate: "%s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.uptimes.bot",
|
||||
fallback: translations["fnfboyfriendbot.command.info.uptimes.bot"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${format(process.uptime())}`}
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.uptimes.server",
|
||||
fallback: translations["fnfboyfriendbot.command.info.uptimes.server"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${format(os.uptime())}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
}
|
||||
],
|
||||
});
|
||||
break;
|
||||
case "version":
|
||||
component.push({
|
||||
translate: "%s %s %s-%s-%s\n%s\n%s\n%s\n%s\n%s-%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Friday Night Funkin", color: "dark_blue" },
|
||||
{ text: "Boyfriend", color: "dark_aqua" },
|
||||
{ text: "Bot", color: "blue" },
|
||||
{
|
||||
text: `${botInfo.buildstring.version}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
botInfo.buildstring.codename || '',
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.version.build",
|
||||
fallback: translations["fnfboyfriendbot.command.info.version.build"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${botInfo.buildstring.build}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.version.repo_build",
|
||||
fallback: translations["fnfboyfriendbot.command.info.version.repo_build"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${execSync("git rev-list --count --all").toString().replaceAll("\n", "")}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.version.version_release_date",
|
||||
fallback: translations["fnfboyfriendbot.command.info.version.version_release_date"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${new Date(execSync("git log -1 --format=%ci").toString()).toLocaleString("en-US", { timeZone: "America/CHICAGO" })}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.info.version.commit",
|
||||
fallback: translations["fnfboyfriendbot.command.info.version.commit"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: ":", color: config.colors.commands.tertiary },
|
||||
{ text: `${execSync("git rev-parse HEAD").toString().substring(0, 10)}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
{ text: "11/22/22", color: config.colors.commands.primary },
|
||||
{
|
||||
text: `${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
],
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw new CommandError({
|
||||
translate: "command.unknown.argument",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
|
||||
source.sendFeedback(component);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = info;
|
||||
@@ -1,57 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class list extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"list",
|
||||
[
|
||||
"pl",
|
||||
"playerlist"
|
||||
],
|
||||
"check whos online on the server",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
false
|
||||
);
|
||||
}
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const source = context.source;
|
||||
let component = [];
|
||||
let playerCount = [];
|
||||
|
||||
playerCount.push({
|
||||
translate: "%s: (%s)\n",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: "Players", color: config.colors.commands.primary },
|
||||
{ text: `${bot.players.length}`, color: config.colors.integer },
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
component.push(playerCount);
|
||||
|
||||
for (const player of bot.players) {
|
||||
component.push({
|
||||
translate: "%s \u203a %s [%s: %s]",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
player.displayName ?? player.profile.name,
|
||||
{ text: `${player.uuid}`, color: config.colors.commands.primary },
|
||||
{ text: "Latency", color: config.colors.commands.primary },
|
||||
{ text: `${player.latency}`, color: config.colors.integer }
|
||||
]
|
||||
})
|
||||
component.push("\n");
|
||||
}
|
||||
component.pop();
|
||||
|
||||
source.sendFeedback(component)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = list;
|
||||
@@ -1,87 +0,0 @@
|
||||
const mc = require("minecraft-protocol");
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class mcserver extends CommandContext {
|
||||
constructor() {
|
||||
super("mcserver",
|
||||
["pingserver"],
|
||||
"pings minecraft servers",
|
||||
trustLevel.public,
|
||||
["<ip>"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
const translations = bot.translations
|
||||
const [host, port] = args[0].split(':')
|
||||
|
||||
let component = [];
|
||||
if (isNaN(port) && port) {
|
||||
source.sendFeedback({
|
||||
translate: "fnfboyfriendbot.arguments.invalid_integer",
|
||||
fallback: translations["fnfboyfriendbot.arguments.invalid_integer"],
|
||||
color: "red",
|
||||
with: [
|
||||
{ text: "Port" }
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
process.on('uncaughtException', (error) => {
|
||||
console.log(error)
|
||||
source.sendFeedback({
|
||||
translate: "fnfboyfriendbot.command.mcserver.server.unknown",
|
||||
fallback: translations["fnfboyfriendbot.command.mcserver.server.unknown"],
|
||||
color: "red",
|
||||
with: [
|
||||
{ text: `${host}` },
|
||||
{ text: `${Number(port ?? 25565)}` }
|
||||
]
|
||||
})
|
||||
})
|
||||
|
||||
const server = await mc.ping({ host, port: Number(port ?? 25565) })
|
||||
|
||||
component.push({
|
||||
translate: "%s\n%s\n%s\n%s",
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.mcserver.ip",
|
||||
fallback: translations["fnfboyfriendbot.command.mcserver.ip"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${host}`, color: config.colors.commands.secondary },
|
||||
{ text: `${Number(port ?? 25565)}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.mcserver.players",
|
||||
fallback: translations["fnfboyfriendbot.command.mcserver.players"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${server.players.online}`, color: config.colors.integer },
|
||||
{ text: `${server.players.max}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.mcserver.server.version",
|
||||
fallback: translations["fnfboyfriendbot.command.mcserver.server.version"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${server.version.name}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
},
|
||||
server.description
|
||||
]
|
||||
})
|
||||
source.sendFeedback(component)
|
||||
}
|
||||
}
|
||||
module.exports = mcserver;
|
||||
@@ -1,54 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class netmsg extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"netmsg",
|
||||
[
|
||||
"networkmessage",
|
||||
],
|
||||
"send a message to other servers that the bot is connected to",
|
||||
trustLevel.public,
|
||||
["<message>"],
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
let component = [];
|
||||
|
||||
if (bot.options.private === true) {
|
||||
component.push({
|
||||
translate: "[%s] %s \u203a %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: `${bot.options.serverName}`, color: config.colors.commands.primary },
|
||||
source?.player?.displayName ?? source?.player?.profile?.name,
|
||||
{ text: `${args.join(' ')}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
})
|
||||
} else {
|
||||
component.push({
|
||||
translate: "[%s:%s] %s \u203a %s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{ text: `${bot.options.host}`, color: config.colors.commands.primary },
|
||||
{ text: `${bot.options.port}`, color: config.colors.commands.primary },
|
||||
source.player.displayName ?? source.player.profile.name,
|
||||
{ text: `${args.join(' ')}`, color: config.colors.commands.secondary }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
eachBot.tellraw("@a", component)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = netmsg;
|
||||
@@ -1,32 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class refillcore extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"rc",
|
||||
[
|
||||
"refill",
|
||||
"refillcore"
|
||||
],
|
||||
"refill the bots core",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source
|
||||
|
||||
bot.core.move(bot.position);
|
||||
|
||||
source.sendFeedback({
|
||||
translation: "command.core.refill",
|
||||
}) // most likely wont be seen most of the time
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = refillcore;
|
||||
@@ -1,49 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
const between = require('../../util/between');
|
||||
|
||||
class rtp extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"rtp",
|
||||
[
|
||||
"randomtp",
|
||||
"tpr",
|
||||
"tprandom"
|
||||
],
|
||||
"teleport to a random place. This was ported from FNFBoyfriendBot v4.x",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
const config = context.config;
|
||||
const translations = bot.translations;
|
||||
const x = between(-1_000_000, 1_000_000);
|
||||
const y = 100;
|
||||
const z = between(-1_000_000, 1_000_000);
|
||||
let component = [];
|
||||
|
||||
bot.core.run(`essentials:tp ${source.player.uuid} ${x} ${y} ${z}`)
|
||||
|
||||
component.push({
|
||||
translate: "fnfboyfriendbot.command.rtp",
|
||||
fallback: translations["fnfboyfriendbot.command.rtp"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${source.player.profile.name}`, color: config.colors.commands.secondary },
|
||||
{ text: `${x}`, color: config.colors.integer },
|
||||
{ text: `${y}`, color: config.colors.integer },
|
||||
{ text: `${z}`, color: config.colors.integer }
|
||||
]
|
||||
})
|
||||
|
||||
bot.tellraw('@a', component)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = rtp
|
||||
@@ -1,25 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class test extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"test",
|
||||
[],
|
||||
"testing stuff",
|
||||
trustLevel.public,
|
||||
[""],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
|
||||
bot.chat.message('meow')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = test;
|
||||
@@ -1,126 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
const { request } = require('undici');
|
||||
|
||||
class urban extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"urban",
|
||||
[
|
||||
"urbandictionary"
|
||||
],
|
||||
"look up definitions on urban dictionary",
|
||||
trustLevel.public,
|
||||
["<definition>"],
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
const args = context.arguments;
|
||||
const config = context.config;
|
||||
const translations = bot.translations;
|
||||
let term = args.join(' ');
|
||||
|
||||
try {
|
||||
const prefix = {
|
||||
translate: "[%s] ",
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.urban.text",
|
||||
fallback: translations["fnfboyfriendbot.command.urban.text"],
|
||||
color: "#B72A00"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const query = new URLSearchParams({ term });
|
||||
const dictResult = await request(`https://api.urbandictionary.com/v0/define?${query}`);
|
||||
const { list } = await dictResult.body.json();
|
||||
let component = [];
|
||||
|
||||
for (const definitions of list) {
|
||||
component.push(prefix, [
|
||||
{
|
||||
text: `${definitions.definition.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray',
|
||||
underlined: false,
|
||||
italic: false,
|
||||
translate: ""
|
||||
}
|
||||
])
|
||||
}
|
||||
source.sendFeedback(component)
|
||||
} catch (e) {
|
||||
bot.console.error(e.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = urban;
|
||||
|
||||
/*
|
||||
const prefix = [
|
||||
{ text: '[', color: 'dark_gray' },
|
||||
{ text: 'Urban', color: '#B72A00' },
|
||||
{ text: '] ', color: 'dark_gray'}
|
||||
]
|
||||
let component = [];
|
||||
let term = `${args.join(' ')}`
|
||||
const query = new URLSearchParams({ term });
|
||||
const dictResult = await request(`https://api.urbandictionary.com/v0/define?${query}`);
|
||||
const { list } = await dictResult.body.json();
|
||||
|
||||
if (bot.options.mode === "savageFriends") {
|
||||
bot.chat.message('this command is disabled for this server for right now sorry!');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!list.length) {
|
||||
bot.tellraw("@a", { text: "No results found", color: "dark_red" });
|
||||
}
|
||||
|
||||
|
||||
for (definitions of list) {
|
||||
component.push(prefix, [
|
||||
{
|
||||
text: `${definitions.definition.replaceAll('\r','').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray',
|
||||
underlined: false,
|
||||
italic: false,
|
||||
translate: "",
|
||||
hover_event: {
|
||||
action:"show_text",
|
||||
value: [
|
||||
{
|
||||
text: `Example \u203a \n ${definitions.example.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray'
|
||||
},
|
||||
{
|
||||
text: `Word \u203a ${definitions.word.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray',
|
||||
},
|
||||
{
|
||||
text: `Author \u203a ${definitions.author.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray'
|
||||
},
|
||||
{
|
||||
text: `written on \u203a ${definitions.written_on.replaceAll('\r', '').replaceAll('[', '\xa71\xa7n\xa7o').replaceAll(']','\xa7r\xa77')}\n`,
|
||||
color: 'gray'
|
||||
},
|
||||
{
|
||||
text: `Rating \u203a Thumbs-Up ${definitions.thumbs_up} / Thumbs-Down ${definitions.thumbs_down}`,
|
||||
color: 'gray'
|
||||
}
|
||||
]
|
||||
},
|
||||
click_event: {
|
||||
action: 'open_url',
|
||||
value: `${definitions.permalink}`
|
||||
}
|
||||
},
|
||||
])
|
||||
*/
|
||||
@@ -1,158 +0,0 @@
|
||||
const { request } = require("undici");
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
|
||||
class weather extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"weather",
|
||||
[],
|
||||
"check the weather in locations",
|
||||
trustLevel.public,
|
||||
["<weather/zip code>"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
const translations = bot.translations;
|
||||
|
||||
let component = [];
|
||||
|
||||
try {
|
||||
const url = await request(
|
||||
`https://api.weatherapi.com/v1/current.json?key=${config.weatherApiKey}&q=${args.join(" ").replaceAll(" ", "%20")}`,
|
||||
);
|
||||
const info = await url.body.json();
|
||||
|
||||
if (info.error) source.sendFeedback({
|
||||
translate: "fnfboyfriendbot.command.weather.unknown_location",
|
||||
fallback: translations["fnfboyfriendbot.command.weather.unknown_location"],
|
||||
color: "red",
|
||||
with: [
|
||||
{ text: `${args.join(' ')}`}
|
||||
]
|
||||
})
|
||||
|
||||
component.push({
|
||||
translate: "%s\n%s\n%s\n%s\n%s\n%s\n%s",
|
||||
color: config.colors.commands.tertiary,
|
||||
with: [
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.weather.location",
|
||||
fallback: translations["fnfboyfriendbot.command.weather.location"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${info.location.name}`, color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${info.location.region}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: `${info.location.country}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.weather.coords",
|
||||
fallback: translations["fnfboyfriendbot.command.weather.coords"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{ text: `${info.location.lat}`, color: config.colors.integer },
|
||||
{ text: `${info.location.lon}`, color: config.colors.integer }
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.weather.time",
|
||||
fallback: translations["fnfboyfriendbot.command.weather.time"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{
|
||||
text: `${new Date().toLocaleTimeString("en-US", { timeZone: info.location.tz_id })}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: `${info.location.tz_id}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.weather.temp",
|
||||
fallback: translations["fnfboyfriendbot.command.weather.temp"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{
|
||||
text: `${Math.floor(info.current.temp_c)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{
|
||||
text: `${Math.floor(info.current.temp_f)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.weather.wind_speed",
|
||||
fallback: translations["fnfboyfriendbot.command.weather.wind_speed"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{
|
||||
text: `${Math.floor(info.current.wind_kph)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "kph", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${info.current.wind_dir}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
{
|
||||
text: `${Math.floor(info.current.wind_mph)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
{ text: "mph", color: config.colors.commands.secondary },
|
||||
{
|
||||
text: `${info.current.wind_dir}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.weather.condition",
|
||||
fallback: translations["fnfboyfriendbot.command.weather.condition"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{
|
||||
text: `${info.current.condition.text}`,
|
||||
color: config.colors.commands.secondary,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
translate: "fnfboyfriendbot.command.weather.humidity",
|
||||
fallback: translations["fnfboyfriendbot.command.weather.humidity"],
|
||||
color: config.colors.commands.primary,
|
||||
with: [
|
||||
{
|
||||
text: `${Math.floor(info.current.humidity)}`,
|
||||
color: config.colors.integer,
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
source.sendFeedback(component)
|
||||
} catch (e) {
|
||||
if (e.toString() === "TypeError: Cannot read properties of undefined (reading 'name')") return
|
||||
else source.sendFeedback(e.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = weather;
|
||||
@@ -1,46 +0,0 @@
|
||||
const CommandContext = require("../../commandUtil/CommandContext");
|
||||
const trustLevel = require("../../commandUtil/CommandTrustLevel");
|
||||
const wikipedia = require('wikipedia');
|
||||
|
||||
class wiki extends CommandContext {
|
||||
constructor() {
|
||||
super(
|
||||
"wiki",
|
||||
[
|
||||
"wikipedia"
|
||||
],
|
||||
"look up articles on wikipedia",
|
||||
trustLevel.public,
|
||||
["<article>"],
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
async execute(context) {
|
||||
const source = context.source;
|
||||
const args = context.arguments;
|
||||
const bot = context.bot;
|
||||
const config = context.config;
|
||||
const translations = bot.translations;
|
||||
let component = [];
|
||||
try {
|
||||
const page = await wikipedia.page(args.join(' '));
|
||||
const summary = await page.intro();
|
||||
component.push({ text: summary, color: config.colors.commands.primary })
|
||||
|
||||
source.sendFeedback(component)
|
||||
} catch (e) {
|
||||
if (e.toString().startsWith('pageError: pageError: No page with given title exists :')) {
|
||||
source.sendFeedback({
|
||||
translate: "fnfboyfriendbot.command.wiki.article_not_found",
|
||||
fallback: translations["fnfboyfriendbot.command.wiki.article_not_found"],
|
||||
color: "red"
|
||||
})
|
||||
} else {
|
||||
source.sendFeedback(e.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = wiki;
|
||||
@@ -0,0 +1,19 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'rc',
|
||||
description:['refill the bots core'],
|
||||
trustLevel: 0,
|
||||
aliases:['refillcore'],
|
||||
usages:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
if (!bot.options.Core.enabled){
|
||||
throw new CommandError('&4Could not fill core because Coreless mode is active!')
|
||||
}else {
|
||||
|
||||
bot.core.refill()
|
||||
bot.sendFeedback('Successfully Refilled Core!')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'reconnect',
|
||||
description:['reconnect the bot when?'],
|
||||
trustLevel: 1,
|
||||
aliases:['rec'],
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
bot.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
|
||||
|
||||
|
||||
bot._client.end()
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
@@ -0,0 +1,36 @@
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'reload',
|
||||
description:['Reload the bots files'],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
usage:["reload"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
try {
|
||||
bot.sendFeedback({text:'Reloading crap'});
|
||||
for (const eachBot of bot.bots)
|
||||
eachBot.reload()
|
||||
}catch(e){
|
||||
bot.sendFeedback(e.stack)
|
||||
}
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
try {
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`reloading commands`)
|
||||
bot.discord.Message.reply({embeds: [Embed]})
|
||||
for (const eachBot of bot.bots)
|
||||
eachBot.reload()
|
||||
}catch(e) {
|
||||
throw new CommandError(e.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
const buildstring = process.env["buildstring"];
|
||||
const foundation = process.env["FoundationBuildString"];
|
||||
module.exports = {
|
||||
name: "say",
|
||||
//<< this one line of code broke it lmao
|
||||
description: ["make me say something in custom chat"],
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"tellrawsay",
|
||||
"tellrawmsg",
|
||||
"trmessage",
|
||||
"tellrawmessage",
|
||||
"sourcesendfeedbacksay",
|
||||
"sourcesendfeedbackmsg",
|
||||
"sourcesendfeedbackmessage",
|
||||
"ssfbmsg",
|
||||
"ssfmessage",
|
||||
],
|
||||
usage:["<message>"],
|
||||
execute(context) {
|
||||
const message = context.arguments.join(" ");
|
||||
const bot = context.bot;
|
||||
|
||||
const prefix = {
|
||||
translate: "[%s%s%s] \u203a %s",
|
||||
bold: false,
|
||||
color: "white",
|
||||
with: [
|
||||
{
|
||||
color: "dark_purple",
|
||||
text: "FNF",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
color: "#00FFFF",
|
||||
text: "Boyfriend",
|
||||
bold: true,
|
||||
},
|
||||
{ color: "dark_red", text: "Bot", bold: true },
|
||||
|
||||
{ color: "green", text: `${message}` },
|
||||
],
|
||||
};
|
||||
//if(!bot.options.Core.enabled){
|
||||
// throw new CommandError('&4Will not work because the core is not enabled please use the echo command')
|
||||
//}else{
|
||||
bot.tellraw([prefix]);
|
||||
}
|
||||
// },
|
||||
};
|
||||
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -0,0 +1,204 @@
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
module.exports = {
|
||||
name: 'sctoggle',
|
||||
description:['toggle the selfcare'],
|
||||
aliases:['selfcaretoggle'],
|
||||
trustLevel: 1,
|
||||
usage:["vanish","mute","god","tptoggle","nickname","username","cspy","skin","gmc","op","prefix","on/off/true/false"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (args[1]) {
|
||||
case 'vanish':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.vanished = false
|
||||
bot.command('essentials:vanish off')
|
||||
return
|
||||
}else if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.vanished = true
|
||||
bot.command('essentials:vanish on')
|
||||
return
|
||||
}else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false off on',color:'dark_red'})
|
||||
return
|
||||
}
|
||||
break
|
||||
case 'mute':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.unmuted = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.unmuted = true
|
||||
|
||||
return
|
||||
}else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
}
|
||||
break
|
||||
case 'prefix':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'Prefix selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.prefix = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'Prefix selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.prefix = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
|
||||
}
|
||||
break
|
||||
case 'cspy':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'cspy selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.cspy = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'cspy selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.cspy = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
}
|
||||
break
|
||||
case 'tptoggle':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'Tptoggle selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.tptoggle = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'Tptoggle selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.tptoggle = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
|
||||
}
|
||||
break
|
||||
case 'skin':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'Skin selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.skin.enabled = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'Skin selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.skin.enabled = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
|
||||
}
|
||||
break
|
||||
case 'gmc':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'gmc selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.gmc = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'gmc selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.gmc = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
|
||||
}
|
||||
break
|
||||
case 'op':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'op selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.op = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'op selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.op = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
|
||||
}
|
||||
break
|
||||
case 'nickname':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'nickname selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.nickname = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'nickname selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.nickname = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
|
||||
}
|
||||
break
|
||||
case 'username':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'username selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.username = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'username selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.username = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
|
||||
}
|
||||
break
|
||||
case 'god':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
bot.sendFeedback([{text:'god selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.god = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
bot.sendFeedback([{text:'god selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.god = true
|
||||
return
|
||||
}
|
||||
else if (args[2] !== 'true' ?? 'false' ?? 'off' ?? 'on'){
|
||||
throw new CommandError({text:'Invalid argument! the arguments are true false on off'})
|
||||
return
|
||||
|
||||
}
|
||||
break
|
||||
default:
|
||||
bot.sendFeedback({text:'Invalid argument!',color:'dark_red'})
|
||||
bot.sendFeedback({text:'vanish mute prefix cspy skin sctoggle gmc op nickname username god',color:'dark_green'})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'selfdestruct',
|
||||
//why i put it in here probably cuz so it can be rewritten or smh idk
|
||||
trustLevel: 2,
|
||||
aliases:['sfd'],
|
||||
description:['selfdestruct server'],
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
//throw new CommandError('temp disabled')
|
||||
|
||||
//bot went brr
|
||||
|
||||
//ima just connect to your server to work on the bot ig
|
||||
// idk
|
||||
|
||||
const args = context.arguments
|
||||
|
||||
if (args[1] === 'clear' || args[1] === 'stop') {
|
||||
clearInterval(this.timer)
|
||||
this.timer = undefined
|
||||
|
||||
context.source.sendFeedback('Cloop Stopped', false)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (this.timer !== null) return
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear @a')
|
||||
bot.core.run('effect give @a nausea')
|
||||
bot.core.run('effect give @a slowness')
|
||||
bot.core.run('give @a bedrock')
|
||||
bot.core.run('give @a sand')
|
||||
bot.core.run('give @a dirt')
|
||||
bot.core.run('give @a diamond')
|
||||
bot.core.run('give @a tnt')
|
||||
bot.core.run('give @a crafting_table')
|
||||
bot.core.run('give @a diamond_block')
|
||||
bot.core.run('smite *')
|
||||
bot.core.run('kaboom')
|
||||
bot.core.run('essentials:ekill *')
|
||||
bot.core.run('nuke')
|
||||
bot.core.run('eco give * 1000')
|
||||
bot.core.run('day')
|
||||
bot.core.run('night')
|
||||
bot.core.run('clear @a')
|
||||
bot.core.run('summon fireball 115 62 -5')
|
||||
bot.core.run('sudo * /fast')
|
||||
bot.core.run('sudo * gms')
|
||||
bot.core.run('sudo * /sphere tnt 75')
|
||||
bot.core.run('sudo * kaboom')
|
||||
}, 500)
|
||||
bot.on('end',(data) =>{
|
||||
clearInterval(this.timer)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
const util = require('util')
|
||||
module.exports = {
|
||||
name: 'servereval',
|
||||
description:['run code unisolated'],
|
||||
trustLevel: 2,
|
||||
aliases:['svreval'],
|
||||
usage: ['<js code>'],
|
||||
execute (context, arguments, selector) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
const args = context.arguments;
|
||||
const script = args.slice(1).join(' ');
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
|
||||
try {
|
||||
if (bot.options.useChat) {
|
||||
bot.chat(bot.getMessageAsPrismarine({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })?.toMotd().replaceAll('§','&'))
|
||||
} else {
|
||||
bot.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
|
||||
bot.sendFeedback({ text: `Script input: ${script}` })
|
||||
}
|
||||
} catch (err) {
|
||||
bot.sendFeedback({ text: err.message, color: 'red' })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'soundbreaker',
|
||||
description:["make peoples ears bleed"],
|
||||
aliases:["earpierce","earhell"],
|
||||
usage:[""],
|
||||
trustLevel:1,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const Docker = require('dockerode')
|
||||
const stream = require('stream')
|
||||
const { exec } = require('child_process')
|
||||
const finalStream = require('final-stream')
|
||||
module.exports = {
|
||||
name: 'terminal', // command name here
|
||||
description: ['run terminal commands in a docker image'], // command desc here
|
||||
aliases: [], // command aliases here if there is any
|
||||
trustLevel: 0, // 0 = public, 1 = trusted, 2 = owner, 3 = console
|
||||
usage: [], // command usage here
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
var id = null
|
||||
const docker = new Docker()
|
||||
if(!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
|
||||
switch(args[0].toLowerCase()){
|
||||
case 'run':
|
||||
try {
|
||||
const finalStream = require('final-stream');
|
||||
|
||||
const stdout = new stream.PassThrough();
|
||||
const docker = new Docker({ socketPath: '/var/run/docker.sock' });
|
||||
|
||||
const container = await docker.run('alpine', ['sh', '-c', `${args.slice(1).join(' ')}`], stdout);
|
||||
const data = await finalStream(stdout).then(buffer => buffer.toString());
|
||||
|
||||
bot.tellraw(data);
|
||||
|
||||
|
||||
}catch(e) {
|
||||
bot.sendFeedback({text:`${e.stack}`})
|
||||
}
|
||||
break
|
||||
case "rebuild":
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
const CommandError = require('../CommandModules/command_error');
|
||||
module.exports = {
|
||||
name: 'theme',
|
||||
description:['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
usage:[":3"],
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
bot.Commands.help.pub_lickColor = args[0]
|
||||
bot.Commands.help.t_rustedColor = args[1]
|
||||
bot.Comands.help.own_herColor = args[2]
|
||||
bot.sendFeedback({text:`Set Help theme colors to ${bot.helpTheme.pub_lickColor} ${bot.helpTheme.t_rustedColor} ${bot.helpTheme.own_herColor}`})
|
||||
}
|
||||
}
|
||||
/*
|
||||
helpTheme:{
|
||||
pub_lickColor:"#00FFFF",
|
||||
t_rustedColor:"dark_purple",
|
||||
own_herColor:"dark_red",
|
||||
},
|
||||
*/
|
||||
@@ -0,0 +1,26 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'time',
|
||||
description:['check the time'],
|
||||
aliases:['clock', 'timezone'],
|
||||
trustLevel:0,
|
||||
usage:["timezone"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const moment = require('moment-timezone')
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const timezone = args.join(' ')
|
||||
|
||||
if (!moment.tz.names().map((zone) => zone.toLowerCase()).includes(timezone.toLowerCase())) {
|
||||
throw new CommandError('Invalid timezone')
|
||||
}
|
||||
|
||||
const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A')
|
||||
const component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: momented, color: 'green' }]
|
||||
|
||||
bot.sendFeedback(component)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
const between = require('../util/between')
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'tpr',
|
||||
description:['teleport to a random place'],
|
||||
trustLevel: 1,
|
||||
aliases:['rtp', 'teleportrandom', 'randomteleport'],
|
||||
usage:[""],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const sender = context.source.player
|
||||
const source = context.source
|
||||
if (!sender) return
|
||||
|
||||
const x = between(-1_000_000, 1_000_000)
|
||||
const y = 100
|
||||
const z = between(-1_000_000, 1_000_000)
|
||||
if (bot.options.useChat) {
|
||||
bot.chat(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||
await bot.chatDelay(100)
|
||||
bot.command(`tp ${sender.uuid} ${x} ${y} ${z}`)
|
||||
} else {
|
||||
bot.sendFeedback(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'tpsbar',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['tps'],
|
||||
trustLevel: 0,
|
||||
aliases:['tickspersecondbar', 'tickspersecond', 'tps'],
|
||||
usage:["on","off"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
switch (args[0]) {
|
||||
case 'on':
|
||||
bot.tps.on()
|
||||
|
||||
bot.sendFeedback({text: 'TPSBar is now enabled', color:'green'})
|
||||
|
||||
break
|
||||
case 'off':
|
||||
|
||||
bot.tps.off()
|
||||
bot.sendFeedback({text:'TPSBar is now disabled', color:'red'})
|
||||
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -0,0 +1,39 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'translate',
|
||||
//<< this one line of code broke it lmao
|
||||
usage:['<language 1> <message>'],
|
||||
aliases:['translation'],
|
||||
trustLevel: 0,
|
||||
description:["translate languages"],
|
||||
async execute (context) {
|
||||
const { translate } = require('@vitalets/google-translate-api')
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const { HttpProxyAgent } = require('http-proxy-agent');
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
try {
|
||||
const agent = new HttpProxyAgent('http://103.152.112.162:80');
|
||||
const { text } = await translate(`${args.slice(1).join(' ')}`, {
|
||||
to: 'args[0]',
|
||||
// fetchOptions: {agent}
|
||||
});
|
||||
bot.sendFeedback([{text:'Result \u203a '},{text:`${text}`,color:'gold'}])
|
||||
}catch(e){
|
||||
//if (e.name === 'TooManyRequestsError') {
|
||||
// source.sendFeedback({text:'reconnecting proxy'})
|
||||
//}else{
|
||||
bot.tellraw(`${e}`)
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user