mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-30 06:05:40 -05:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66eef33e1e |
@@ -1,4 +1,4 @@
|
||||
//samething here
|
||||
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = {
|
||||
|
||||
for (const definition of definitions) {
|
||||
bot.tellraw(selector, [{ text: '[', color: 'dark_red' }, { text: 'Urban', color: 'red' }, { text: '] ', color: 'dark_red' }, { text: definition.word, color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition, color: 'white' }])
|
||||
}//
|
||||
}
|
||||
} catch (e) {
|
||||
bot.tellraw(selector, { text: e.toString(), color: 'red' })
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ module.exports = {
|
||||
],
|
||||
commandsDir: '../commands', // this will be used by the commands.js in the plugins folder so it needs ../
|
||||
proxy: {
|
||||
enabled: false,
|
||||
enabled: true,
|
||||
version: '1.19.2'
|
||||
},
|
||||
console: true,
|
||||
|
||||
@@ -39,6 +39,7 @@ function inject (bot, dcclient, config) {
|
||||
signedPreview: false,
|
||||
messageCount: 0,
|
||||
acknowledged: Buffer.alloc(3),
|
||||
// 1.19.2 Chat Command packet also includes an array of last seen messages
|
||||
previousMessages: []
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,7 @@ const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('events')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const forge = require('minecraft-protocol-forge')
|
||||
|
||||
// "buildstring":"FNFBoyfriendBotX V4.0.8a Build:97",
|
||||
//"FoundationBuildString":"Ultimate Foundation V1.0.1 Build:31",
|
||||
function createBot(options = {}) {
|
||||
@@ -13,7 +13,7 @@ const rs = require('randomstring')
|
||||
options.host ??= 'localhost'
|
||||
options.username ??= username()
|
||||
options.hideErrors ??= false // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
options.forge ??= true
|
||||
|
||||
bot.options = options
|
||||
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
|
||||
+1
-2
@@ -4,9 +4,8 @@ function parseMessage (message, data) {
|
||||
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
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
function parseMessage (message, data) {
|
||||
if (message === null || typeof message !== 'object') return
|
||||
|
||||
if (message.with?.length < 3 || (message.translate !== '%s %s » %s' && message.translate !== '%s %s » %s')) return
|
||||
|
||||
const senderComponent = message.with[1]
|
||||
const contents = message.with[2]
|
||||
|
||||
let sender
|
||||
|
||||
const hoverEvent = senderComponent.hoverEvent
|
||||
if (hoverEvent?.action === 'show_entity') {
|
||||
const id = hoverEvent.contents.id
|
||||
//
|
||||
sender = data.players.find(player => player.uuid === id)
|
||||
} else {
|
||||
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
|
||||
|
||||
sender = data.players.find(player => player.profile.name) //=== stringusername)
|
||||
}
|
||||
|
||||
if (!sender) return undefined
|
||||
|
||||
return { sender, contents, type: 'minecraft:chat', senderComponent }
|
||||
}
|
||||
|
||||
module.exports = parseMessage
|
||||
+1
-1
@@ -2,7 +2,7 @@ const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'abotval',
|
||||
description:['console only'],
|
||||
|
||||
consoleOnly: true,
|
||||
|
||||
execute (context) {
|
||||
|
||||
@@ -2,8 +2,7 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'botdevhistory',
|
||||
description:['bots dev history'],
|
||||
execute (context) {
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
+23
-23
@@ -1,47 +1,47 @@
|
||||
// TODO: Maybe add more authors
|
||||
const bots = [
|
||||
{
|
||||
name: { text: 'HBot', color: 'aqua', bold:false },
|
||||
name: { text: 'HBot', color: 'aqua', bold:true },
|
||||
authors: ['hhhzzzsss'],
|
||||
exclaimer:'HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO',
|
||||
foundation: 'java/mcprotocollib',
|
||||
prefixes: ['#']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Evil', color: 'dark_red', bold:false }, {text:'Bot', color:'dark_purple'}],
|
||||
name: [{ text: 'Evil', color: 'dark_red' }, {text:'Bot', color:'dark_purple'}],
|
||||
authors: ['FusseligerDev'],
|
||||
exclaimer:'',
|
||||
foundation: 'Java/Custom',
|
||||
prefixes: ['!']
|
||||
},
|
||||
{
|
||||
name: { text: 'SBot Java', color: 'white', bold:false }, // TODO: Gradient
|
||||
name: { text: 'SBot Java', color: 'white', bold:true }, // TODO: Gradient
|
||||
authors: ['evkc'],
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: [':']
|
||||
},
|
||||
{
|
||||
name: { text: 'SBot Rust', color: 'white', bold:false}, // TODO: Gradient
|
||||
name: { text: 'SBot Rust', color: 'white', bold:true }, // TODO: Gradient
|
||||
authors: ['evkc'],
|
||||
foundation: 'Rust',
|
||||
prefixes: ['re:']
|
||||
},
|
||||
{
|
||||
name: { text: 'Z-Boy-Bot', color: 'dark_purple', bold:false }, // TODO: Gradient
|
||||
name: { text: 'Z-Boy-Bot', color: 'dark_purple' }, // TODO: Gradient
|
||||
exclaimer: 'Most likely skidded along with kbot that the dev used',
|
||||
authors: ['Romnci'],
|
||||
foundation: 'NodeJS/mineflayer or Java/mcprotocollib idfk',
|
||||
prefixes: ['Z]']
|
||||
},
|
||||
{
|
||||
name: { text: 'ABot', color: 'gold', bold:false }, // TODO: Gradient
|
||||
name: { text: 'ABot', color: 'gold', bold:true }, // TODO: Gradient
|
||||
exclaimer: '',
|
||||
authors: ['yfd'],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['<']
|
||||
},
|
||||
{
|
||||
name: { text: 'FardBot', color: 'light_purple', bold:false },
|
||||
name: { text: 'FardBot', color: 'light_purple' },
|
||||
authors: ['_yfd'],
|
||||
exclaimer: 'bot is dead lol',
|
||||
foundation: 'NodeJS/Mineflayer',
|
||||
@@ -49,7 +49,7 @@ const bots = [
|
||||
},
|
||||
|
||||
{
|
||||
name: { text: 'ChipmunkBot', color: 'green', bold:false },
|
||||
name: { text: 'ChipmunkBot', color: 'green' },
|
||||
authors: ['_ChipMC_'],
|
||||
exclaimer: 'chips? also shoutout to chip and chayapak for helping in the rewrite',
|
||||
|
||||
@@ -57,19 +57,19 @@ const bots = [
|
||||
prefixes: ["'", "/'"]
|
||||
},
|
||||
{
|
||||
name: { text: 'ChipmunkBot Old', color: 'green', bold:false },
|
||||
name: { text: 'ChipmunkBot Old', color: 'green' },
|
||||
authors: ['_ChipMC_'],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: 'TestBot', color: 'aqua', bold:false },
|
||||
name: { text: 'TestBot', color: 'aqua' },
|
||||
authors: ['Blackilykat'],
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ["-"]
|
||||
},
|
||||
{
|
||||
name: { text: 'UBot', color: 'grey', bold:false },
|
||||
name: { text: 'UBot', color: 'grey' },
|
||||
authors: ['HexWoman'],
|
||||
exclaimer: 'UwU OwO',
|
||||
|
||||
@@ -77,28 +77,28 @@ const bots = [
|
||||
prefixes: ['"']
|
||||
},
|
||||
{
|
||||
name: { text: 'ChomeNS Bot Java', color: 'yellow', bold:false},
|
||||
name: { text: 'ChomeNS Bot Java', color: 'yellow'},
|
||||
authors: ['chayapak'],
|
||||
exclaimer: 'wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak',
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ['*', 'cbot ', '/cbot ']
|
||||
},
|
||||
{
|
||||
name: { text: 'ChomeNS Bot NodeJS', color: 'yellow', bold:false},
|
||||
name: { text: 'ChomeNS Bot NodeJS', color: 'yellow'},
|
||||
authors: ['chayapak'],
|
||||
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['*', 'cbot', '/cbot']
|
||||
},
|
||||
{
|
||||
name: { text: 'RecycleBot', color: 'dark_green', bold:false},
|
||||
name: { text: 'RecycleBot', color: 'dark_green'},
|
||||
foundation: ['MorganAnkan'],
|
||||
exclaimer: 'nice bot',
|
||||
language: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['=']
|
||||
},
|
||||
{
|
||||
name: { text: 'ManBot', color: 'dark_green' , bold:false },
|
||||
name: { text: 'ManBot', color: 'dark_green' , },
|
||||
exclaimer: '(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT',
|
||||
authors: ['Man/LogintimedOut'],
|
||||
foundation: 'NodeJS/mineflayer',
|
||||
@@ -112,14 +112,14 @@ const bots = [
|
||||
prefixes: ['[']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Blurry', color: 'dark_purple' , bold:false}, { text: 'Bot', color: 'red' }],
|
||||
name: [{ text: 'Blurry', color: 'dark_purple'}, { text: 'Bot', color: 'red' }],
|
||||
exclaimer: '',
|
||||
authors: ['SirLennox'],
|
||||
foundation: 'Java/custom',
|
||||
prefixes: [',']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'KittyCorp', color: 'yellow', bold:false }, { text: 'Bot', color: 'yellow' }],
|
||||
name: [{ text: 'KittyCorp', color: 'yellow' }, { text: 'Bot', color: 'yellow' }],
|
||||
exclaimer: '3 words ginlang is gay',
|
||||
authors: ['ginlang , G6_, ArrayBuffer, and i guess more??'],
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
@@ -127,15 +127,15 @@ const bots = [
|
||||
},
|
||||
|
||||
{
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: false}, {text:'Boyfriend', color: 'aqua', bold:false}, {text:'Bot', color:'dark_red', bold:false}, {text:' Node-Minecraft-Protocol', color:'black', bold:false}],
|
||||
authors: [{ text:'Parker2991', color: 'dark_red'}, {text:' _ChipMC_', color: 'dark_green', bold:false}, {text:' chayapak', color:'yellow', bold:false}],
|
||||
exclaimer: 'FNFBoyfriendBot NMP Rewrite',
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: true}, {text:'Boyfriend', color: 'aqua', bold:true}, {text:'Bot', color:'dark_red', bold:true}, {text:'X', color:'black', bold:true}],
|
||||
authors: [{ text:'Parker2991', color: 'dark_red'}, {text:' _ChipMC_', color: 'dark_green', bold:true}, {text:' chayapak', color:'yellow', bold:true}],
|
||||
exclaimer: '4.0 (this Bot) also the Ultimate version of the FNFBoyfriendBot Builds',
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['~']
|
||||
},
|
||||
{
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: false}, {text:'Boyfriend', color: 'aqua', bold:false}, {text:'Bot', color:'dark_red', bold:false}, {text:' Mineflayer', color:'green', bold:false}],
|
||||
authors: [{text:'Parker2991', color:'dark_red' }, {text:' _ChipMC_', color:'dark_green', bold:false }],
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: true}, {text:'Boyfriend', color: 'aqua', bold:true}, {text:'Bot', color:'dark_red', bold:true}, {text:' Legacy', color:'green', bold:true}],
|
||||
authors: [{text:'Parker2991', color:'dark_red' }, {text:' _ChipMC_', color:'dark_green', bold:true }],
|
||||
exclaimer:'1037 LINES OF CODE WTFARD!??! also this version is in console commands only' ,
|
||||
foundation: 'NodeJS/mineflayer',
|
||||
prefixes: []
|
||||
@@ -144,7 +144,7 @@ const bots = [
|
||||
|
||||
module.exports = {
|
||||
name: 'bots',
|
||||
description:['shows a list of known bots'],
|
||||
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
|
||||
|
||||
+29
-63
@@ -1,67 +1,33 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: 'cai',
|
||||
description:['a broken asf command thats supposed to connect to beta.character.ai'],
|
||||
execute (context) {
|
||||
throw new CommandError('locked cuz of Error: Failed to fetch a lazy token')
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments;
|
||||
const CharacterAI = require("node_characterai_edited");
|
||||
const characterAI = new CharacterAI();
|
||||
|
||||
(async () => {
|
||||
// Authenticating as a guest (use `.authenticateWithToken()` to use an account)
|
||||
await characterAI.authenticateAsGuest();
|
||||
|
||||
// Place your character's id here
|
||||
const characterId = "-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE";
|
||||
|
||||
const chat = await characterAI.createOrContinueChat(characterId);
|
||||
const response = await chat.sendAndAwaitResponse(message, true);
|
||||
try {
|
||||
source.sendFeedback(response)
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
}
|
||||
|
||||
})();
|
||||
}
|
||||
const CharacterAI = require('node_characterai'); // im gonna push it to the main bot afterwards
|
||||
const characterAI = new CharacterAI();
|
||||
// ???
|
||||
async function start() {
|
||||
await characterAI.authenticateAsGuest(); //well idk how to get the bot to sign into a account
|
||||
}
|
||||
|
||||
/* try {
|
||||
const page = await wiki.page(args.join(' '))
|
||||
const summary = await page.summary()
|
||||
//const definitions = await urban.define(args.join(' '))
|
||||
async function ask(key, message) {
|
||||
const characterId = key;
|
||||
|
||||
const chat = await characterAI.createOrContinueChat('LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE');
|
||||
const response = await chat.sendAndAwaitResponse(message, true);
|
||||
|
||||
return response.text//lag real
|
||||
console.debug(message)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
start,
|
||||
ask,
|
||||
name: 'cai',
|
||||
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
|
||||
|
||||
source.sendFeedback({ text: summary.extract, color: 'green' })
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
*/
|
||||
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
|
||||
|
||||
/*const CharacterAI = require("node_characterai");
|
||||
const characterAI = new CharacterAI();
|
||||
|
||||
(async () => {
|
||||
// Authenticating as a guest (use `.authenticateWithToken()` to use an account)
|
||||
await characterAI.authenticateAsGuest();
|
||||
|
||||
// Place your character's id here
|
||||
const characterId = "8_1NyR8w1dOXmI1uWaieQcd147hecbdIK7CeEAIrdJw";
|
||||
|
||||
const chat = await characterAI.createOrContinueChat(characterId);
|
||||
|
||||
// Send a message
|
||||
const response = await chat.sendAndAwaitResponse("Hello discord mod!", true);
|
||||
|
||||
console.log(response);
|
||||
// Use `response.text` to use it as a string
|
||||
})();
|
||||
*/
|
||||
//yfd idk what im doing
|
||||
context.source.sendFeedback(start, false)
|
||||
context.source.sendFeedback(ask, false)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'calculator',
|
||||
description:['calculate maths'],
|
||||
execute (context) {
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const cmd = {//test.js
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
bold: true,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
]
|
||||
}
|
||||
const operation = args[0]
|
||||
const operation = args[0]
|
||||
const operator1 = parseFloat(args[1])
|
||||
const operator2 = parseFloat(args[2])
|
||||
|
||||
@@ -65,7 +65,7 @@ const operation = args[0]
|
||||
|
||||
break
|
||||
default:
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red' }])
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'blue' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-16
@@ -247,7 +247,7 @@ const bots = [
|
||||
exclaimer:'fixed the issue with memused cee mmm dee',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v4.1.9', color: 'green', bold:false },
|
||||
name: { text: 'v4.1.9', color: 'gray', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '10/12/23',
|
||||
@@ -260,20 +260,6 @@ const bots = [
|
||||
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',
|
||||
},
|
||||
]
|
||||
//back
|
||||
|
||||
@@ -287,7 +273,7 @@ const bots = [
|
||||
},*/
|
||||
module.exports = {
|
||||
name: 'changelog',
|
||||
description:['check the bots changelog'],
|
||||
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ module.exports = {
|
||||
name: 'chatterboxbot',
|
||||
|
||||
hashOnly:true,
|
||||
description:['please dont omfg'],
|
||||
|
||||
execute (context) {
|
||||
const mineflayer = require('mineflayer')
|
||||
const { Vec3 } = require('vec3')
|
||||
|
||||
@@ -4,7 +4,7 @@ module.exports = {
|
||||
name: 'chomeval',
|
||||
|
||||
consoleOnly: true,
|
||||
description:['console only'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ let timer = null
|
||||
module.exports = {
|
||||
name: 'ckill',
|
||||
hashOnly: true,
|
||||
|
||||
description:['cloop kill players'],
|
||||
execute (context) {
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'cloop',
|
||||
hashOnly: true,
|
||||
description:['command loop commands'],
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
|
||||
@@ -3,7 +3,6 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'cloopcrash',
|
||||
hashOnly: true,
|
||||
description:['cloop crashes a server '],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
@@ -2,7 +2,7 @@ module.exports = {
|
||||
name: 'consoleserver',
|
||||
|
||||
consoleOnly: true,
|
||||
description:['consoleserver'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'core',
|
||||
description:['make me run a command in core'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -2,7 +2,6 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'crash',
|
||||
description:['crashes a server'],
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ const CommandError = require('../CommandModules/command_error')
|
||||
//how do i stop following? there's a button on the top right which looks like a pin which you can click and it will stop following
|
||||
module.exports = {
|
||||
name: 'creator',//thx
|
||||
description:['see who worked on the bot!'],
|
||||
|
||||
execute (context, prefix) {
|
||||
const message = context.arguments.join(' ')
|
||||
const Creators = {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'discord',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const event = {
|
||||
|
||||
clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
|
||||
"color": "#5A5A5A",
|
||||
"translate": `%s`,
|
||||
"with": [
|
||||
{ "color": "green", "text": "Click here for the bots discord server link"},
|
||||
|
||||
]//
|
||||
}
|
||||
context.source.sendFeedback(event, false)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'discordmsg',
|
||||
description:['make me say something in discord'],
|
||||
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'echo',
|
||||
description:['make me say something in chat'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -2,7 +2,7 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'errortest',
|
||||
description:['test errors'],
|
||||
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
context.source.sendFeedback('hint hover your mouse over the error')
|
||||
|
||||
+8
-11
@@ -5,14 +5,13 @@ const { stylize } = require('../util/eval_colors')
|
||||
const options = {
|
||||
timeout: 1000//?
|
||||
}
|
||||
let isolate = new ivm.Isolate({ memoryLimit: 50 }) // 32 seems fine
|
||||
let isolate = new ivm.Isolate({ memoryLimit: 32 }) // 32 seems fine
|
||||
|
||||
module.exports = {
|
||||
name: 'evaljs',
|
||||
hashOnly:true, // vm owners please dont get mad at me ;-;
|
||||
description:['run code in a vm note: amcforum members had a sh##fit over this command'],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
hashOnly:false, // vm owners please dont get mad at me ;-;
|
||||
async execute (context) {
|
||||
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const util = require('util')
|
||||
@@ -28,10 +27,8 @@ hashOnly:true, // vm owners please dont get mad at me ;-;
|
||||
} catch (err) {
|
||||
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
|
||||
*/
|
||||
//let hash = bot.hash
|
||||
|
||||
switch (args[0]) {
|
||||
case `run`:
|
||||
case 'run':
|
||||
try {//context.eval()
|
||||
/*
|
||||
let kitty
|
||||
@@ -63,12 +60,12 @@ try {
|
||||
source.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
|
||||
} catch (reason) {
|
||||
nerd = reason;
|
||||
source.sendFeedback([cmd, { text: String(reason.stack), color: 'white' }]);
|
||||
source.sendFeedback([cmd, { text: String(reason.message), color: 'white' }]);
|
||||
console.log(`AAA at ${reason}\n${reason.stack}`);
|
||||
}
|
||||
})();
|
||||
} catch (reason) {
|
||||
source.sendFeedback([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]);
|
||||
source.sendFeedback([cmd, { text: String("UwU OwO ewwor" + reason.message), color: 'white' }]);
|
||||
console.log(`AAA at ${reason}\n${reason.stack}`);
|
||||
}
|
||||
|
||||
@@ -81,7 +78,7 @@ try {
|
||||
case 'reset':
|
||||
|
||||
isolate = null
|
||||
isolate = new ivm.Isolate({ memoryLimit: 50 }) // 32 seems fine
|
||||
isolate = new ivm.Isolate({ memoryLimit: 32 }) // 32 seems fine
|
||||
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
|
||||
|
||||
break
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'fard',
|
||||
description:['fart'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
throw new CommandError('disabled until owner hash is added')
|
||||
context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@ fs.readdir(testFolder, (err, files) => {
|
||||
module.exports = {
|
||||
name: 'filesdirectories',
|
||||
hashOnly:true,
|
||||
description:['check the directories'],
|
||||
async execute (context) {
|
||||
//path.join(__dirname, 'config.js'
|
||||
const main = '../FNFBoyfriendBotX-V40';
|
||||
|
||||
@@ -3,7 +3,6 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'filter',
|
||||
hashOnly: true,
|
||||
description:['filter players (not functional)'],
|
||||
execute (context) {
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
|
||||
@@ -5,7 +5,6 @@ let timer = null
|
||||
module.exports = {
|
||||
name: 'freeze',
|
||||
hashOnly: true,
|
||||
description:['freeze a player'],
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
|
||||
|
||||
+16
-128
@@ -3,19 +3,15 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
aliases:['heko'],
|
||||
description:['shows the command list'],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
execute (context) {
|
||||
const commandList = []
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Help Cmd'},
|
||||
{ color: 'dark_blue', text: 'Help Cmd'},
|
||||
]
|
||||
}
|
||||
const category = {
|
||||
@@ -25,129 +21,21 @@ module.exports = {
|
||||
with: [
|
||||
{ color: 'green', text: 'Public'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'red', text: 'Trusted'},
|
||||
{ color: 'dark_red', text: 'Trusted'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Owner'},
|
||||
{ color: 'red', text: 'Owner'},
|
||||
]
|
||||
}
|
||||
|
||||
if (args[0]) {
|
||||
let valid
|
||||
for (const fard in bot.commandManager.amogus) { // i broke a key woops
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
if (args[0].toLowerCase() === command.name) {
|
||||
valid = true
|
||||
source.sendFeedback([cmd, `Description: ${command.description}`])
|
||||
break
|
||||
} else valid = false
|
||||
}//source is defined btw
|
||||
//source.sendFeedback([cmd, 'This command is ' + valid + ' to this for loop'])
|
||||
if (valid) {
|
||||
|
||||
} else {
|
||||
source.sendFeedback([cmd, {text: 'Unknown command.', color: 'dark_red'}])
|
||||
}//i will add the descriptions reading as tests and action add the descriptions for the commands after
|
||||
const length = context.bot.commandManager.amogus.length // ok
|
||||
//i guess i did delete smh woops
|
||||
for (const command of context.bot.commandManager.getCommands()) {
|
||||
if (command.consoleOnly && !context.console) continue
|
||||
|
||||
if (commandList.length !== 0) commandList.push(' ')
|
||||
commandList.push({ text: String(command.name), color: command.hashOnly ? 'dark_red' : 'green' })
|
||||
|
||||
}
|
||||
|
||||
//context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
|
||||
} else {
|
||||
let pub_lick = []
|
||||
let t_rust = []
|
||||
let own_her = []
|
||||
for (const fard in bot.commandManager.amogus) {
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
if (command.hashOnly) {
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'red'
|
||||
}
|
||||
)
|
||||
} else {
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'green'
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
const length = context.bot.commandManager.amogus.length
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust], false)
|
||||
const length = context.bot.commandManager.getCommands().length
|
||||
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (args[0]) {
|
||||
for (const command of bot.command_handler.commands) {
|
||||
function run () {
|
||||
let alias = command.name
|
||||
|
||||
if (command.alias.toString() !== '') {
|
||||
alias = command.alias.join(', ')
|
||||
}
|
||||
|
||||
const usage = []
|
||||
if (typeof command.usage === 'string') {
|
||||
usage.push({ text: `${prefix}${command.name} `, color: 'gold' })
|
||||
usage.push({ text: command.usage, color: 'aqua' })
|
||||
} else {
|
||||
for (const value of command.usage) {
|
||||
usage.push({ text: `${prefix}${command.name} `, color: 'gold' })
|
||||
usage.push({ text: value, color: 'aqua' })
|
||||
usage.push('\n')
|
||||
}
|
||||
usage.pop()
|
||||
}
|
||||
|
||||
const component = []
|
||||
component.push({ text: prefix + command.name, color: 'gold' })
|
||||
component.push({ text: ` (${alias})`, color: 'white' })
|
||||
component.push({ text: ' - ', color: 'gray' })
|
||||
component.push({ text: command.description, color: 'gray' })
|
||||
|
||||
component.push('\n')
|
||||
|
||||
component.push({ text: 'Trust level: ', color: 'green' })
|
||||
component.push({ text: command.trusted, color: 'yellow' })
|
||||
|
||||
component.push('\n')
|
||||
|
||||
component.push({ text: 'Supported on Discord: ', color: 'green' })
|
||||
component.push({ text: command.discordExecute ? 'true' : 'false', color: 'gold' })
|
||||
|
||||
component.push('\n')
|
||||
|
||||
component.push(usage)
|
||||
|
||||
bot.tellraw(selector, component)
|
||||
}
|
||||
|
||||
if (command.name === args[0]) run()
|
||||
for (const alias of command.alias) {
|
||||
if (alias === args[0]) run()
|
||||
}
|
||||
};
|
||||
} else {
|
||||
const generalCommands = []
|
||||
const trustedCommands = []
|
||||
const ownerCommands = []
|
||||
function component (command, color) {
|
||||
return {
|
||||
text: command.name + ' ',
|
||||
color,
|
||||
hoverEvent: {
|
||||
action: 'show_text',
|
||||
contents: [{
|
||||
text: 'Click here to see the information for this command',
|
||||
color: 'green'
|
||||
}]
|
||||
},
|
||||
clickEvent: {
|
||||
action: 'run_command',
|
||||
value: `${prefix}help ${command.name}`
|
||||
}
|
||||
}
|
||||
};
|
||||
*/
|
||||
@@ -5,7 +5,6 @@ let timer = null
|
||||
module.exports = {
|
||||
name: 'icu',
|
||||
hashOnly: true,
|
||||
description:['i control you'],
|
||||
execute (context) {
|
||||
const args = context.arguments
|
||||
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const fs = require('fs/promises')
|
||||
const packageJSON = require("../package.json")
|
||||
async function getCpuModelName () {
|
||||
const cpuInfo = await fs.readFile('/proc/cpuinfo')
|
||||
const lines = cpuInfo.toString().split('\n')
|
||||
// among us way of doing it
|
||||
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
|
||||
return modelName[1]
|
||||
}
|
||||
module.exports = {
|
||||
name: 'info',
|
||||
description:['check the bots info. the args are version, discord, serverinfo, logininfo, uptime, memused, creators'],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'gold', text: 'Info Cmd'},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
/*context.source.sendFeedback(`${buildstring}`, false)
|
||||
context.source.sendFeedback(`${foundationbuildstring}`)
|
||||
context.source.sendFeedback('BotEngine:Node-Minecraft-Protocol', false)
|
||||
*/
|
||||
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundationbuildstring = process.env['FoundationBuildString']
|
||||
|
||||
switch (args[0]) {
|
||||
case 'version':
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s ',
|
||||
with: [
|
||||
{ color: "green", text: `${buildstring}`},
|
||||
{ color: "green", text: `${foundationbuildstring}`},
|
||||
{ color: "green", text: 'BotEngine:Node-Minecraft-Protocol'},
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
case 'discord':
|
||||
context.source.sendFeedback({
|
||||
clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
|
||||
translate: '%s',
|
||||
with: [
|
||||
{ color: "green", text: `${context.bot.discord.invite}`},
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
case 'serverinfo':
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: "green", text: `Hostname: ${os.hostname()}`},
|
||||
{ color: "green", text: `Working Directory: ${path.join(__dirname, '..')}`},
|
||||
{ color: "green", text: `OS architecture: ${os.arch()}`},
|
||||
{ color: "green", text: `OS platform: ${os.platform()}`},
|
||||
{ color: "green", text: `OS name: ${os.version()}`},
|
||||
{ color: "green", text: `CPU cores: ${os.cpus().length}`},
|
||||
{ color: "green", text: `CPU model: ${await getCpuModelName()}`},
|
||||
{ color: "green", text: `Node js Version @${process.version}`},
|
||||
{ color: "green", text: `Minecraft-Protocol Version @${MinecraftProtocolVersion}`},
|
||||
{ color: "green", text: `Discord.js @${discordJSVersion}`},
|
||||
|
||||
]
|
||||
});
|
||||
break
|
||||
case 'logininfo':
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: "green", text: `Bot Username: ${bot.username}`},
|
||||
{ color: "green", text: `Minecraft Java Version: ${context.bot.options.version}`},
|
||||
{ color: "green", text: `Server: ${context.bot.options.host}`},
|
||||
{ color: "green", text: `Port: ${context.bot.options.port}`},
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
break
|
||||
case 'uptime':
|
||||
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(`Mins: ${minutes}`) + ' ' + pad(`Seconds: ${seconds}`);
|
||||
}
|
||||
|
||||
var uptime = process.uptime();
|
||||
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s',
|
||||
with: [
|
||||
{ color: "green", text: `Bot Uptime: ${format(uptime)}`},
|
||||
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
case 'memused':
|
||||
const os = require('os')
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s',
|
||||
with: [
|
||||
{ color: "green", text: `§aMem §aused §a${Math.floor(os.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os.totalmem() / 1048576)} MiB`},
|
||||
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
break
|
||||
|
||||
case 'creators':
|
||||
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: 'green', text: 'Thank you to all that helped!' },
|
||||
{ color: 'dark_red', text: 'Parker' },
|
||||
{ color: 'black', text: '2991' },
|
||||
|
||||
{ color: 'dark_green', text: '_ChipMC_' },
|
||||
|
||||
{ color: 'yellow', text: 'chayapak' },
|
||||
|
||||
{ color: 'light_purple', text: '_yfd' },
|
||||
{ color: 'green', text: 'ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4' },
|
||||
{ color: 'green', text: 'FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux' },
|
||||
{ color: 'green', text: '(sadly chip doesnt have a discord server) _ChipMC_s Website https://chipmunk.land' },
|
||||
{ color: 'green', text: '_yfds discord server: https://discord.gg/BKYKBxfDrs' },
|
||||
{ color: 'green', text: 'chayapaks discord username: chayapak' },
|
||||
{ color: 'green', text: '_ChipMC_s discord username: chipmunkmc' },
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
default:
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
context.source.sendError([cmd, { text: 'the args for the info command is version, discord, serverinfo, logininfo, uptime, memused, creators', color: 'green', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ let timer = null
|
||||
module.exports = {
|
||||
name: 'kick',
|
||||
hashOnly:true,//now its not
|
||||
description:['kicks a player(not functional)'],
|
||||
execute(context) {
|
||||
const bot = context.bot
|
||||
//throw new CommandError('command temporarily disabled until hashing is implemented')
|
||||
|
||||
+2
-3
@@ -2,7 +2,7 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'list',
|
||||
description:['check the player list'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
@@ -11,9 +11,8 @@ module.exports = {
|
||||
const component = []
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s ',
|
||||
translate: '%s \u203a %s',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid
|
||||
]
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
name: 'logininfo',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
//context.bot.options.port
|
||||
context.source.sendFeedback(`Bot Username: ${bot.username}`)
|
||||
context.source.sendFeedback(`Minecraft Java Version: ${context.bot.options.version}`)
|
||||
context.source.sendFeedback(`Server: ${context.bot.options.host}`)
|
||||
context.source.sendFeedback(`Port: ${context.bot.options.port}`)
|
||||
}
|
||||
}
|
||||
+22
-3
@@ -4,9 +4,28 @@ const os = require('os')
|
||||
|
||||
module.exports = {
|
||||
name: 'lol',
|
||||
description:['idfk dont ask'],
|
||||
|
||||
execute (context) {
|
||||
throw new CommandError('idfk lmao')
|
||||
const prefix = {
|
||||
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"},
|
||||
"color": "#5A5A5A",
|
||||
"translate": ` %s %s %s %s`,
|
||||
"with": [
|
||||
{ "color": "dark_red", text: "Incorrect argument for command"},
|
||||
{ "color": "dark_red", text: " <--[HERE]"},
|
||||
{ "color": "dark_red", text: "Unknown or incomplete command, see below for error"},
|
||||
{ "color": "dark_red", "text": "An unexpected error occurred trying to execute that command"},
|
||||
]//
|
||||
}//how i add a hover event??
|
||||
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
|
||||
context.source.sendFeedback(prefix)
|
||||
context.source.sendFeedback('[object Object]')
|
||||
context.source.sendFeedback('NaN')
|
||||
context.source.sendFeedback('null')
|
||||
context.source.sendFeedback('undefined')
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const fs = require('fs/promises')
|
||||
const packageJSON = require("../package.json")
|
||||
async function getCpuModelName () {
|
||||
const cpuInfo = await fs.readFile('/proc/cpuinfo')
|
||||
const lines = cpuInfo.toString().split('\n')
|
||||
// among us way of doing it
|
||||
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
|
||||
return modelName[1]
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: 'serverinfo',
|
||||
|
||||
async execute (context) {
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
context.source.sendFeedback(`Hostname: ${os.hostname()}`, false)
|
||||
context.source.sendFeedback(`Working Directory: ${path.join(__dirname, '..')}`, false)
|
||||
context.source.sendFeedback(`OS architecture: ${os.arch()}`, false)
|
||||
context.source.sendFeedback(`OS platform: ${os.platform()}`, false)
|
||||
context.source.sendFeedback(`OS name: ${os.version()}`, false)
|
||||
context.source.sendFeedback(`CPU cores: ${os.cpus().length}`, false)
|
||||
context.source.sendFeedback(`CPU model: ${await getCpuModelName()}`, false)
|
||||
context.source.sendFeedback(`Node js Version @${process.version}`, false)
|
||||
context.source.sendFeedback(`Minecraft-Protocol Version @${MinecraftProtocolVersion}`, false)
|
||||
context.source.sendFeedback(`Discord.js @${discordJSVersion}`, false)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
name: 'memused',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const os = require('os')
|
||||
context.source.sendFeedback(`§aMem §aused §a${Math.floor(os.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os.totalmem() / 1048576)} MiB`, false)
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
var os = require('os');
|
||||
|
||||
console.log(os.cpus());
|
||||
console.log(os.totalmem());
|
||||
console.log(os.freemem())
|
||||
*/
|
||||
@@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'mineflayerbot',
|
||||
hashOnly:true,
|
||||
description:['spawns a mineflayer bot'],
|
||||
execute (context) {
|
||||
const mineflayer = require('mineflayer')
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
module.exports = {
|
||||
name: 'netmsg',
|
||||
description:['send a message to other servers'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
@@ -13,7 +13,7 @@ module.exports = {
|
||||
{ color: 'dark_purple', text: 'FNF',bold: true },
|
||||
{ color: 'aqua', text: 'Boyfriend',bold: true },
|
||||
{ color: 'dark_red', text: 'Bot',bold: true },
|
||||
bot.options.host + ':' + bot.options.port,
|
||||
bot.options.host,
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
message
|
||||
]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'ping',
|
||||
description:['Pong!'],
|
||||
|
||||
execute (context) {
|
||||
if (context.arguments.length !== 0) {
|
||||
const argumentList = []
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'rc',
|
||||
description:['refill the bots core'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ const randomstring = require('randomstring')
|
||||
|
||||
module.exports = {
|
||||
name: 'reconnect',
|
||||
description:['reconnect the bot to the server'],
|
||||
|
||||
hashOnly: true,
|
||||
|
||||
execute (context) {
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@ 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'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
@@ -14,7 +13,7 @@ const bot = context.bot
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'gray',
|
||||
with: [
|
||||
{ text: 'FNFBoyfriendBot Console', color:'#00FFFF'},
|
||||
{ text: 'FNFBoyfriendBot', color:'#00FFFF'},
|
||||
{ selector: `${bot.username}`, color:'#00FFFF'},
|
||||
{ text: '', extra: [`${message}`], color:'white'},
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ module.exports = {
|
||||
name: 'selfdestruct',
|
||||
//why i put it in here probably cuz so it can be rewritten or smh idk
|
||||
hashOnly: true,
|
||||
description:['selfdestruct server'],
|
||||
execute (context) {
|
||||
|
||||
//bot went brr
|
||||
|
||||
@@ -2,7 +2,6 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'skin',
|
||||
description:['make everyone wear the same skin'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'spambot',
|
||||
hashOnly:true,
|
||||
description:['dont'],
|
||||
|
||||
execute (context) {
|
||||
const randomstring = require('randomstring')
|
||||
const mineflayer = require('mineflayer')
|
||||
|
||||
@@ -2,7 +2,6 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'sudo',
|
||||
description:['make a player say or run something'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
|
||||
+13
-10
@@ -1,18 +1,21 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
|
||||
module.exports = {
|
||||
name: 'test',
|
||||
description:['very 1st command in the bot to test to see if things are working'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
if (context.arguments.length !== 0) {
|
||||
const argumentList = []
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
context.source.sendFeedback(`§aHello, §aWorld!, §aPlayer: §a${player}, §auuid:§a ${uuid}, §aArgument: §a${message}`, false)
|
||||
|
||||
for (const argument of context.arguments) {
|
||||
if (argumentList.length !== 0) argumentList.push(' ')
|
||||
argumentList.push(argument)
|
||||
}
|
||||
|
||||
context.source.sendFeedback({ text: 'Hello, world! Arguments: ', extra: argumentList }, false)
|
||||
return
|
||||
}
|
||||
|
||||
context.source.sendFeedback('Hello, world!', false)
|
||||
}
|
||||
}
|
||||
//context.source.player.displayName ?? context.source.player.profile.name,
|
||||
|
||||
@@ -3,8 +3,6 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'testbench',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['represents a actual error'],
|
||||
|
||||
execute (context) {
|
||||
//const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -2,7 +2,6 @@ const between = require('../util/between')
|
||||
|
||||
module.exports = {
|
||||
name: 'tpr',
|
||||
description:['teleport to a random place'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
@@ -5,8 +5,6 @@ let timer = null
|
||||
module.exports = {
|
||||
name: 'troll',
|
||||
hashOnly: true,
|
||||
description:['troll a player or the whole server'],
|
||||
|
||||
execute (context) {
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
module.exports = {
|
||||
name: 'uptime',
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
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(`Mins: ${minutes}`) + ' ' + pad(`Seconds: ${seconds}`);
|
||||
}
|
||||
|
||||
var uptime = process.uptime();
|
||||
|
||||
context.source.sendFeedback(format(uptime))
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -2,7 +2,6 @@ const urban = require('urban-dictionary')
|
||||
|
||||
module.exports = {
|
||||
name: 'urban',
|
||||
description:['urban dictionary'],
|
||||
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
@@ -20,8 +19,8 @@ module.exports = {
|
||||
const definitions = await urban.define(args.join(' '))
|
||||
|
||||
for (const definition of definitions) {
|
||||
source.sendFeedback([cmd, { text: definition.word.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
|
||||
}//text: definition.word text: definition.definition
|
||||
source.sendFeedback([cmd,{ text: definition.word.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
|
||||
}
|
||||
} catch (e) {
|
||||
source.sendFeedback([cmd,{ text: e.toString(), color: 'red' }])
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'validate',
|
||||
description:['validate in the bot'],
|
||||
|
||||
|
||||
hashOnly: true,
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundationbuildstring = process.env['FoundationBuildString']
|
||||
const packageJSON = require("../package.json")
|
||||
module.exports = {
|
||||
name: 'version',
|
||||
|
||||
execute (context) {
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion = packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
context.source.sendFeedback(`${buildstring}`, false)
|
||||
context.source.sendFeedback(`${foundationbuildstring}`)
|
||||
context.source.sendFeedback('BotEngine:Node-Minecraft-Protocol', false)
|
||||
|
||||
}
|
||||
}//idfk
|
||||
//i cant get it to show the npm version
|
||||
// where the fard are you gonna get that info from the process or whatever
|
||||
@@ -1,25 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'weather',
|
||||
description:['test'],
|
||||
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const source = context.source
|
||||
|
||||
const weather = require('weather-js');
|
||||
|
||||
// Options:
|
||||
// search: location name or zipcode
|
||||
// degreeType: F or C
|
||||
|
||||
weather.find({search: 'San Francisco, CA', degreeType: 'F'}, function(err, result) {
|
||||
if(err) console.log(err);
|
||||
|
||||
source.sendFeedback(JSON.stringify(result, null, 2));
|
||||
});
|
||||
[
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
const wiki = require('wikipedia') //
|
||||
module.exports = {
|
||||
name: 'wiki',
|
||||
description:['wikipedia'],
|
||||
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
@@ -15,7 +14,7 @@ module.exports = {
|
||||
source.sendFeedback({ text: summary.extract, color: 'green' })
|
||||
|
||||
} catch (e) {
|
||||
source.sendFeedback({ text: e.stack, color: 'red' })
|
||||
source.sendFeedback({ text: e.toString(), color: 'red' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+21
-8
@@ -3,7 +3,7 @@
|
||||
"bots": [
|
||||
{
|
||||
"host": "kaboom.pw",
|
||||
|
||||
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
@@ -13,34 +13,43 @@
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
"CustomChat": {
|
||||
|
||||
"text":"FNFBoyfriendBot",
|
||||
"color":"#00FFFF"
|
||||
},
|
||||
"discord": {
|
||||
"channelId": "1106441703046529084",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"host": "24.69.170.247",
|
||||
"version":"1.20.1",
|
||||
|
||||
|
||||
"reconnectDelay": 10000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
|
||||
"CustomChat": {
|
||||
|
||||
"text":"FNFBoyfriendBot",
|
||||
"color":"#00FFFF"
|
||||
},
|
||||
"discord": {
|
||||
"channelId": "1155826836954157136",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
"commandPrefix": "~"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"host": "kaboom.fusselig.xyz",
|
||||
"version":"1.20.1",
|
||||
@@ -48,12 +57,16 @@
|
||||
|
||||
"commands": {
|
||||
"prefix": "~"
|
||||
|
||||
|
||||
},
|
||||
"Core": {
|
||||
"customName":"https://doin-your.mom"
|
||||
},
|
||||
|
||||
"CustomChat": {
|
||||
|
||||
"text":"FNFBoyfriendBot",
|
||||
"color":"#00FFFF"
|
||||
},
|
||||
"discord": {
|
||||
"channelId": "1106393124110086174",
|
||||
"invite": "https://discord.gg/GCKtG4erux",
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
{
|
||||
"bots": [
|
||||
{
|
||||
"host": "localhost",
|
||||
|
||||
"version":"1.20.1",
|
||||
"reconnectDelay": 6000,
|
||||
|
||||
"commands": {
|
||||
"prefix": "default~"
|
||||
},
|
||||
"Core": {
|
||||
"customName":"CoreCustomNameHere"
|
||||
},
|
||||
|
||||
"discord": {
|
||||
"channelId": "discordchannelidhere",
|
||||
"invite": "discordlinkhere",
|
||||
"commandPrefix": "default~"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4,7 +4,8 @@ const createBot = require('./bot.js')
|
||||
// TODO: Load a default config
|
||||
const config = require('./config.json')
|
||||
const readline = require('readline')
|
||||
|
||||
var buildstring = 'FNFBoyfriendBotX V4.0.8A Build:97'
|
||||
var foundationbuildstring = 'Ultimate Foundation V1.0.1 Build:31'
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
@@ -19,5 +20,4 @@ for (const options of config.bots) {
|
||||
|
||||
bot.on('error', console.error)
|
||||
}
|
||||
|
||||
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ const kaboomChatParser = require('../chat/kaboom')
|
||||
const chipmunkmodChatParser = require('../chat/chipmunkmod')
|
||||
const chipmunkmodblackilykatverChatParser = require('../chat/chipmunkmodBlackilyKatVer')
|
||||
const lang = require('../lolus.json')
|
||||
|
||||
const popbobChatParser = require('../chat/popbob')
|
||||
function tryParse (json) {
|
||||
try {
|
||||
return JSON.parse(json)
|
||||
@@ -18,7 +18,7 @@ function inject (bot) {
|
||||
ChatMessage = loadPrismarineChat(registry)
|
||||
})
|
||||
|
||||
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser]
|
||||
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser, popbobChatParser]
|
||||
|
||||
bot.on('packet.profileless_chat', packet => {
|
||||
const message = tryParse(packet.message)
|
||||
|
||||
@@ -6,20 +6,17 @@ function inject (bot, options) {
|
||||
bot.commandManager = {
|
||||
prefix: options.commands?.prefix ?? 'default',
|
||||
commands: {},
|
||||
amogus: [],
|
||||
//ohio
|
||||
|
||||
execute (source, commandName, args) {
|
||||
const command = this.getCommand(commandName.toLowerCase())
|
||||
//Unknown command. Type "/help" for help
|
||||
try {
|
||||
if (!command || !command.execute) throw new CommandError({ translate: 'Unknown command %s. Type "~help" for help', with: [commandName]})
|
||||
if (!command || !command.execute) throw new CommandError({ translate: 'Unknown command %s . Type "~help" for help', with: [commandName]})
|
||||
//command.unknown.argument command.unknown.command
|
||||
//command.context.here
|
||||
let hash = 1
|
||||
let owner = 2
|
||||
if (command.consoleOnly && !source.sources.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'dark_red' })
|
||||
if (command.hash && args.length === 0 && source.hash) throw new CommandError({ translate: 'Please provide a hash', color: 'red' })
|
||||
if (command.owner && args.length === 0 && source.owner) throw new CommandError({ translate: 'Please provide a OwnerHash', color: 'dark_red' })
|
||||
if (command.hashOnly && args.length === 0 && source.hash) throw new CommandError({ translate: 'Please provide a hash', color: 'dark_red' })
|
||||
|
||||
if (command.hashOnly && source.hash) {
|
||||
// debug
|
||||
// console.log(`${args} args0 ${args[0]}`) //too sus
|
||||
@@ -77,16 +74,15 @@ if (error instanceof CommandError) source.sendError(error._message)
|
||||
}
|
||||
}
|
||||
//
|
||||
amogus = []
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
|
||||
try {
|
||||
const command = require(path.join(__dirname, '../commands', filename))
|
||||
bot.commandManager.register(command)
|
||||
bot.commandManager.amogus.push(command)
|
||||
} catch (error) {
|
||||
console.error('Failed to load command', filename, ':', error)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
|
||||
@@ -19,7 +19,7 @@ function inject (bot) {
|
||||
})
|
||||
|
||||
bot.on('player_remove', packet => {
|
||||
|
||||
// TODO: Add player removal (with validation)
|
||||
})
|
||||
|
||||
function addPlayer (entry) {
|
||||
|
||||
Generated
+14
-2847
File diff suppressed because it is too large
Load Diff
+2
-11
@@ -1,26 +1,19 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@npmcli/arborist": "^7.2.0",
|
||||
"@npmcli/metavuln-calculator": "^7.0.0",
|
||||
"@tonejs/midi": "^2.0.28",
|
||||
"@vitalets/google-translate-api": "^9.2.0",
|
||||
"axios": "^1.5.1",
|
||||
"chromium": "^3.0.3",
|
||||
"color-convert": "^2.0.1",
|
||||
"cowsay2": "^2.0.4",
|
||||
"discord.js": "^14.12.1",
|
||||
"discord.js": "^14.13.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"isolated-vm": "^4.6.0",
|
||||
"minecraft-data": "^3.46.2",
|
||||
"minecraft-protocol": "^1.44.0",
|
||||
"minecraft-protocol-forge": "^1.0.0",
|
||||
"mineflayer": "^4.14.0",
|
||||
"mineflayer-cmd": "^1.1.3",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"node_characterai": "^1.1.3",
|
||||
"node_characterai_edited": "^1.1.5",
|
||||
"node-weatherunderground": "^1.2.0",
|
||||
"openweather-api-node": "^3.1.2",
|
||||
"prismarine-chat": "^1.9.1",
|
||||
"prismarine-nbt": "^2.2.1",
|
||||
"prismarine-registry": "^1.7.0",
|
||||
@@ -32,8 +25,6 @@
|
||||
"vec3": "^0.1.8",
|
||||
"vm2": "^3.9.19",
|
||||
"vm2-fixed": "^0.0.1",
|
||||
"weather-js": "^2.0.0",
|
||||
"wikipedia": "^2.1.1",
|
||||
"wunderground-api": "^1.1.4"
|
||||
"wikipedia": "^2.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
const fs = require('fs/promises')
|
||||
|
||||
/**
|
||||
* check if file exists
|
||||
* @param {String} filepath the file path
|
||||
* @return {boolean} if file exists true else false
|
||||
*/
|
||||
async function fileExists (filepath) {
|
||||
try {
|
||||
await fs.access(filepath)
|
||||
return true
|
||||
} catch (error) {
|
||||
if (error.code !== 'ENOENT') throw error
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = fileExists
|
||||
Reference in New Issue
Block a user