Compare commits

..
1 Commits
Author SHA1 Message Date
Parker2991 6baf4c623b v4.2.1 2024-02-20 17:01:13 +00:00
53 changed files with 2102 additions and 2384 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
// TODO: Improve how messages are stringified
const ChatMessage = require('prismarine-chat')('1.20.2')
const ChatMessage = require('prismarine-chat')('1.20.1')
const stringify = message => new ChatMessage(message).toString()
class CommandError extends Error {
+2 -5
View File
@@ -29,11 +29,10 @@ options.forge ??= true
})
client.on('end', reason => bot.emit('end', reason))
client.on('error', error => bot.emit('error', error))
})
const buildstring = process.env['buildstring']
const client = options.client ?? mc.createClient(options)
@@ -51,7 +50,6 @@ const buildstring = process.env['buildstring']
bot.loadModule(module)
} catch (error) {
console.error('Failed to load module', filename, ':', error)
}
}
@@ -69,5 +67,4 @@ function username() {
return username;
}
module.exports = createBot
module.exports = createBot
+57
View File
@@ -0,0 +1,57 @@
const crypto = require('crypto')
module.exports = {
name: 'abotval',
description:['console only'],
consoleOnly: true,
execute (context) {
const bot = context.bot
const prefix = '<' // mabe not hardcode the prefix
const args = context.arguments
let hashlol
const key = process.env['abot_key']
const date = new Date();
const min = date.getMinutes();
const md5 = crypto.createHash('md5').update(`${min}--_${key}`).digest('hex');
const basehash = crypto.createHash('sha256').update(md5).digest('hex');
const hashe = btoa(basehash)
const fullhash = crypto.createHash('sha256').update(hashe).digest('hex');
hashlol = fullhash.substring(0, 16);
//already have to token ready
const hash = hashlol
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
const peefix = {
clickEvent: { action:"open_url", value: "https://doin-your.mom"},
"color": "#5A5A5A",
"translate": '[%s] %s \u203a %s',
"with": [
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
{ "color": "aqua", "text": `${bot.username}`},
{ "color": "white", "text": command},
]// why name it that?? xD
}
context.bot.tellraw([peefix])
}//this isnt how..
}//./commands/tellraw.js
// Done!
//are ya able to help with the validation/hashing in mine?
// Make a copy of this
//ahh ok
//whos not
// Can cars fly?
//fr
// look at the console
// watch console rq
// Rip our ram lmao
+18 -32
View File
@@ -1,40 +1,33 @@
// 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: '64Bot', color: 'gold', bold:false },
authors: ['64Will64'],
exclaimer:'NINTENDO 64?!?!??!?! 69Bot when??????',
foundation: 'NodeJS/Mineflayer',
prefixes: ['w=']
},
{
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',
@@ -42,20 +35,13 @@ const bots = [
},
{
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: ['<']
},
{
name: { text: 'ABot-V2', color: 'gold', bold:true }, // TODO: Gradient
exclaimer: '',
authors: [{text: '_yfd', color: 'light_purple'}],
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',
@@ -63,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',
@@ -71,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',
@@ -91,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',
@@ -126,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',
@@ -148,7 +134,7 @@ const bots = [
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}],
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:true}],
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',
+2 -2
View File
@@ -6,11 +6,11 @@ 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')
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");
const CharacterAI = require("node_characterai_edited");
const characterAI = new CharacterAI();
(async () => {
+1 -1
View File
@@ -2,7 +2,7 @@ const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'calculator',
description:['calculate maths'],
execute (context) {
execute (context) { // also theres a bomb under my house rn and i can hear it beepingidfk
const bot = context.bot
const args = context.arguments
const cmd = {//test.js
-21
View File
@@ -267,27 +267,6 @@ const bots = [
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',
},
]
//back
+3 -3
View File
@@ -59,7 +59,7 @@ bot.on('chat', (username, message) => {
quit(username)
break
default:
bot.chat("i am https://doin-your.mom")
bot.chat("That's nice")
}
function canSee (pos) {
@@ -142,7 +142,7 @@ bot.on('kicked', (reason) => {
})
bot.on('time', () => {
bot.chat('i am https://doin-your.mom')
bot.chat('Current time: ' + bot.time.timeOfDay)
})
bot.on('rain', () => {
if (bot.isRaining) {
@@ -175,7 +175,7 @@ bot.on('playerLeft', (player) => {
bot.on('playerCollect', (collector, collected) => {
if (collector.type === 'player') {
const item = collected.getDroppedItem()
bot.chat(`${collector.username !== bot.username ? ("I'm so jealous. " + collector.username) : 'I '} collected`)
bot.chat(`${collector.username !== bot.username ? ("I'm so jealous. " + collector.username) : 'I '} collected ${item.count} ${item.displayName}`)
}
})
+42
View File
@@ -0,0 +1,42 @@
const crypto = require('crypto')
module.exports = {
name: 'chomeval',
consoleOnly: true,
description:['console only'],
execute (context) {
const bot = context.bot
const prefix = '*' // mabe not hardcode the prefix
const args = context.arguments
const key = process.env['chomens_bot_key']
const time = Math.floor(Date.now() / 5_000)
const value = bot.uuid + args[0] + time + key
const hash = crypto.createHash('sha256').update(value).digest('hex').substring(0, 16)
const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
const message = context.arguments.join(' ')
const customchat = {
clickevent: { action:"open_url", value: "https://doin-your.mom"},
"color": "#5A5A5A",
"translate": `[%s] %s \u203a %s`,
"with": [
{ "color": "aqua", "text": "FNFBoyfriendBotX"},
{ "color": "aqua", "text": `${bot.username}`},
{ "color": "#5A5A5A", "text": `${command}`},
]//
}//how i add a hover event??
// clickEvent: bot.discord.invite ? { action: 'open_url', value: bot.discord.invite }
context.bot.tellraw([customchat])
}
}
//
+28
View File
@@ -0,0 +1,28 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'ckill',
hashOnly: true,
description:['cloop kill players'],
execute (context) {
const target = context.arguments.join(' ')
const bot = context.bot
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(timer)
timer = null
return
}
if (timer !== null) return
setInterval(function () {
bot.core.run('sudo ' + target + ' suicide')
}, 1)
}
}
+9 -9
View File
@@ -2,17 +2,17 @@ module.exports = {
name: 'cloop',
hashOnly: true,
description:['command loop commands'],
execute (context, selector) {
execute (context) {
const args = context.arguments
const bot = context.bot
const source = context.source
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
switch (selector, args[1]) {
switch (args[0]) {
case 'add':
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
const interval = parseInt(args[2])
const command = args.slice(3).join(' ')
const interval = parseInt(args[1])
const command = args.slice(2).join(' ')
bot.cloop.add(command, interval)
@@ -23,9 +23,9 @@ hashOnly: true,
break
case 'remove':
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' }, false)
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' })
const index = parseInt(args[2])
const index = parseInt(args[1])
bot.cloop.remove(index)
@@ -38,7 +38,7 @@ hashOnly: true,
case 'clear':
bot.cloop.clear()
source.sendFeedback({ text: 'Cleared all cloops' }, false)
source.sendFeedback({ text: 'Cleared all cloops' })
break
case 'list':
+20
View File
@@ -0,0 +1,20 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cloopcrash',
hashOnly: true,
description:['cloop crashes a server '],
execute (context) {
const bot = context.bot
timer = setInterval(function () {
bot.core.run(``)
}, 1)
}
}
//what is wi
// IDK
-72
View File
@@ -1,72 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'cowsay',
description:['mooooo'],
execute (context, selector) {
const bot = context.bot
const args = context.arguments.join(' ')
const component = ['']
// const args = context.arguments
const source = context.source
const cowsay = require('cowsay2')
const cows = require('cowsay2/cows')
throw new CommandError('too lazy to work on it right now')
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: `${context.bot.options.commands.prefix}cowsay ${value} `
}
})
}
source.sendFeedback(`${source} ${message}`)
} else {
source.sendFeedback(`\n ${cowsay.say(args)} ${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)
}
*/
+3 -28
View File
@@ -5,38 +5,13 @@ module.exports = {
description:['crashes a server'],
hashOnly: true,
execute (context) {
const bot = context.bot
const args = context.arguments
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
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'},
]
}
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
context.source.sendError([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
bot.core.run(``) // yfd: make it dotenv or whatever it is. I have a sus crash exploit that can be used I guess ☆*: .。. o(≧▽≦)o .。.:*☆
}
}
}
+32
View File
@@ -0,0 +1,32 @@
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 = {
translate: '%s%s%s%s%s%s%s%s',
bold: false,
color: 'white',
with: [
{ color: 'dark_red', text: 'Parker' },
{ color: 'black', text: '2991' },
{ color: 'white', text: ',' },
{ color: 'dark_green', text: ' _ChipMC_' },
{ color: 'white', text: ',' },
{ color: 'yellow', text: ' chayapak' },
{ color: 'white', text: ',' },
{ color: 'light_purple', text: ' _yfd' },
]
}
context.source.sendFeedback(['Thank you to all that helped! ', Creators])
context.source.sendFeedback(['ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4'])
context.source.sendFeedback(['FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux'])
context.source.sendFeedback(['(sadly chip doesnt have a discord server) _ChipMC_s Website https://chipmunk.land'])
context.source.sendFeedback(['_yfds discord server: https://discord.gg/BKYKBxfDrs'])
context.source.sendFeedback(['Parker2991 discord username: parker2991'])
context.source.sendFeedback(['chayapaks discord username: chayapak'])
context.source.sendFeedback(['_ChipMC_s discord username: chipmunkmc'])
}
}//https://discord.gg/GCKtG4erux
+20
View File
@@ -0,0 +1,20 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'discord',
description:['discord link'],
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
View File
@@ -7,6 +7,5 @@ module.exports = {
const player = context.player
bot.discord.channel.send(args.join(' '))
}
}
+1 -1
View File
@@ -9,4 +9,4 @@ module.exports = {
throw new Error(message)
}
}
}
+3 -3
View File
@@ -29,8 +29,8 @@ hashOnly:true, // vm owners please dont get mad at me ;-;
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
*/
//let hash = bot.hash
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
switch (args[0]) {
case `run`:
try {//context.eval()
/*
@@ -51,7 +51,7 @@ hashOnly:true, // vm owners please dont get mad at me ;-;
//fr
try {
let nerd = "";
const script = args.slice(2).join(' '); // Ensure script is a string
const script = args.slice(1).join(' '); // Ensure script is a string
const cOmtext = isolate.createContext();
(async () => {
+12
View File
@@ -0,0 +1,12 @@
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)
}
}
+86
View File
@@ -0,0 +1,86 @@
const CommandError = require('../CommandModules/command_error')
const os = require('os')
const path = require('path')
const fs = require('fs')
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]
}
/*
const testFolder = './tests/';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {
files.forEach(file => {
console.log(file);
});
});
*/
module.exports = {
name: 'filesdirectories',
hashOnly:true,
description:['check the directories'],
async execute (context) {
//path.join(__dirname, 'config.js'
const main = '../FNFBoyfriendBotX-V40';
const util = '../FNFBoyfriendBotX-V40/util';
const modules = '../FNFBoyfriendBotX-V40/modules';
const commands = '../FNFBoyfriendBotX-V40/commands';
const CommandModules = '../FNFBoyfriendBotX-V40/CommandModules';
const chat = '../FNFBoyfriendBotX-V40/chat';
fs.readdir(main, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/' + file);
});
});
fs.readdir(util, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/util/' + file);
});
});
fs.readdir(modules, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/modules/' + file);
});
});
fs.readdir(commands, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/commands/' + file);
});
});
fs.readdir(CommandModules, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/CommandModules/' + file);
});
});
fs.readdir(chat, (err, files) => {
files.forEach(file => {
context.source.sendFeedback('/home/runner/FNFBoyfriendBotX-V40/chat/' + file);
});
});
}
}
/*const fs = require('fs');
const path = require('path');
const directory = './';
// use readdir method to read the files of the direcoty
fs.readdir(directory, (err, files) => {
files.forEach(file => {
// get the details of the file
let fileDetails = fs.lstatSync(path.resolve(directory, file));
// check if the file is directory
if (fileDetails.isDirectory()) {
console.log('Directory: ' + file);
} else {
console.log('File: ' + file);
}
});
});
*/
+31
View File
@@ -0,0 +1,31 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'freeze',
hashOnly: true,
description:['freeze a player'],
execute (context) {
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(this.timer)
this.timer = null
context.source.sendFeedback('Cloop Stopped', false)
return
}
if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
const target = context.arguments.join(' ')
const bot = context.bot
this.timer = setInterval(function () {
bot.core.run('tp ' + target)
}, 1)
}
}
+3 -10
View File
@@ -55,7 +55,6 @@ module.exports = {
let pub_lick = []
let t_rust = []
let own_her = []
let cons_ole = []
for (const fard in bot.commandManager.amogus) {
const command = bot.commandManager.amogus[fard]
if (command.hashOnly) {
@@ -70,16 +69,10 @@ module.exports = {
{
text: command.name + ' ',
color: 'green'
}
}
)
}
}
for (const command of context.bot.commandManager.getCommands()) {
if (command.consoleOnly && !context.console) continue
}
}
}
const length = context.bot.commandManager.amogus.length
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust], false)
}
+29
View File
@@ -0,0 +1,29 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'icu',
hashOnly: true,
description:['i control you'],
execute (context) {
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(timer)
timer = null
return
}
if (timer !== null) return
const target = context.arguments.join(' ')
const bot = context.bot
setInterval(function () {
bot.core.run('tp ' + target + ' '+ target + ' ')
}, 1)
}
}
-162
View File
@@ -1,162 +0,0 @@
const CommandError = require('../CommandModules/command_error')
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"];
const os = require('os')
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 \n %s',
with: [
{ color: "green", text: `Bot Username: ${bot.username}`},
{ color: "green", text: `Bot uuid: ${context.bot.uuid}`, clickEvent: {action:"copy_to_clipboard", value: `${context.bot.uuid}`}},
{ 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}`},
]
});// clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
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)}`},
]
});
break
case 'memused':
const os2 = require('os')
context.source.sendFeedback({
translate: '\n %s',
with: [
{ color: "green", text: `§aMem §aused §a${Math.floor(os2.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os2.totalmem() / 1048576)} MiB`},
]
});
break
case 'creators':
context.source.sendFeedback({
translate: '\n %s \n %s%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 }])
}
}
}
+6 -8
View File
File diff suppressed because one or more lines are too long
+14
View File
@@ -0,0 +1,14 @@
module.exports = {
name: 'logininfo',
description:['check the bots logininfo for minecraft'],
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}`)
}
}
+33
View File
@@ -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',
description:['check server info'],
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)
}
}
+18
View File
@@ -0,0 +1,18 @@
module.exports = {
name: 'memused',
description:['check mem used'],
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())
*/
+90
View File
@@ -0,0 +1,90 @@
module.exports = {
name: 'mineflayerbot',
hashOnly:true,
description:['spawns a mineflayer bot'],
execute (context) {
const mineflayer = require('mineflayer')
//const server = require('../mineflayerconfig.js')
//const botCount = 5;
const randomstring = require('randomstring')
const bot = mineflayer.createBot({
host: context.bot.options.host,
port: context.bot.options.port,
username:'FNFBFBotMinion' + randomstring.generate(2),
version: '1.19.2', // ohio ahh
})
//fr
var sleep = t => new Promise(a => setTimeout(a, t)),
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
function runInCore(cmd) {
bot._client.write('update_command_block', { location: { x: between(Math.floor(bot.entity.position.x) + 1, Math.floor(bot.entity.position.x) - 15), y: between(0, 3), z: between(Math.floor(bot.entity.position.z) + 1, Math.floor(bot.entity.position.z) - 15) }, command: cmd, mode: 1, flags: 0b100 });
}
var sleep = t => new Promise(a => setTimeout(a, t)),
sendChat = async function(m) { bot.chat(m.slice(0, 256)); await sleep(300); }
function between(min, max) {
return Math.floor(
Math.random() * (max - min) + min
)
}
bot.on('login', async () => {
})
const cmd = require('mineflayer-cmd').plugin
cmd.allowConsoleInput = false // Optional config argument
bot.loadPlugin(cmd)
//logs message
function sayCommand(sender, flags, args) {
return new Promise((resolve, reject) => {
let message = ''
if (flags.showsender) message += sender + ': '
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
bot.chat(message)
resolve()
})
}
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('say', sayCommand,
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
bot.on('chat', (username, message) => {
if (message.startsWith('!')) {
const command = message.substring(1)
bot.cmd.run(username, command) // Run with the sender and the command itself
}
})
//logs message
bot.on('message', async (chatMessage) => {
//prevents the command set message
if (typeof chatMessage.translate === 'string' && chatMessage.translate.startsWith('advMode.')) return
//console.log(chatMessage.toAnsi())
})
}
}
+19
View File
@@ -0,0 +1,19 @@
module.exports = {
name: 'ping',
description:['Pong!'],
execute (context) {
if (context.arguments.length !== 0) {
const argumentList = []
for (const argument of context.arguments) {
if (argumentList.length !== 0) argumentList.push(' ')
argumentList.push(argument)
}
context.source.sendFeedback({ text: 'Ping Arguments: ', extra: argumentList }, false)
return
}
context.source.sendFeedback('Pong!', false)
}
}
-45
View File
@@ -1,45 +0,0 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'recend',
description:['reconnect or end the bot the usages are end, and reconnect'],
hashOnly:true,
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
const args = context.arguments
//throw new CommandError('disabled until owner hash is added')
if (!args && !args[0] && !args[1] && !args[2]) return
switch (args[1]) {
case `end`:
context.source.sendFeedback('farding right now....')
process.exit(1)
break
case `reconnect`:
const randomstring = require('randomstring')
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot.chat(randomstring.generate(300))
break
default:
const cmd = {//test.js
translate: '[%s] ',
bold: false,
color: 'white',
with: [
{ color: 'gold', text: 'recend Cmd'},
]
}
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
context.source.sendError([cmd, { text: 'the args for the info command is reconnect, and end', color: 'green', bold:false }])
}
}
}
/*context.source.sendFeedback('farding right now....')
process.exit(1)
*/
+19
View File
@@ -0,0 +1,19 @@
const randomstring = require('randomstring')
module.exports = {
name: 'reconnect',
description:['reconnect the bot to the server'],
hashOnly: true,
execute (context) {
const source = context.source
const bot = context.bot
const randomstring = require('randomstring')
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
bot.chat(randomstring.generate(300))
}
}
//red sus
+1 -1
View File
@@ -14,7 +14,7 @@ const bot = context.bot
translate: '[%s] %s \u203a %s',
color:'gray',
with: [
{ text: 'FNFBoyfriendBot', color:'#00FFFF'},
{ text: 'FNFBoyfriendBot Console', color:'#00FFFF'},
{ selector: `${bot.username}`, color:'#00FFFF'},
{ text: '', extra: [`${message}`], color:'white'},
+1 -1
View File
@@ -52,6 +52,6 @@ hashOnly: true,
bot.core.run('sudo * gms')
bot.core.run('sudo * /sphere tnt 75')
bot.core.run('sudo * kaboom')
}, 500)
}, 10)
}
}
+16
View File
@@ -0,0 +1,16 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'skin',
description:['make everyone wear the same skin'],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
bot.core.run('sudo * skin ' + message)
bot.core.run('sudo fnfboyfriendbotx c:oh look we got little ' + message + '"s running around now great', false)
}
}
+29
View File
@@ -0,0 +1,29 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'spambot',
hashOnly:true,
description:['dont'],
execute (context) {
const randomstring = require('randomstring')
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
host: context.bot.options.host,
username: randomstring.generate(16),
})
bot.on('login', async () => {
setInterval(function () {
bot.chat(`${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1}.${Math.floor(Math.random() * 255) + 1} anyone like doxing?`)
return
}, 100)
});
}
}
+16
View File
@@ -0,0 +1,16 @@
const CommandError = require('../CommandModules/command_error')
module.exports = {
name: 'sudo',
description:['make a player say or run something'],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
bot.core.run('sudo ' + message)
}
}
+2 -2
View File
@@ -5,14 +5,14 @@ module.exports = {
description:['very 1st command in the bot to test to see if things are working'],
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!!
context.source.sendFeedback(`§aHello, §aWorld!, §aPlayer: §a${player}, §auuid:§a ${uuid}, §aArgument: §a${message}`, false)
}
}
//context.source.player.displayName ?? context.source.player.profile.name,
+56
View File
@@ -0,0 +1,56 @@
const CommandError = require('../CommandModules/command_error')
let timer = null
module.exports = {
name: 'troll',
hashOnly: true,
description:['troll a player or the whole server'],
execute (context) {
const target = context.arguments.join(' ')
const bot = context.bot
const args = context.arguments
if (args[0] === 'clear' || args[0] === 'stop') {
clearInterval(this.timer)
this.timer = null
context.source.sendFeedback('Cloop Stopped', false)
return
}
if (this.timer !== null)
this.timer = setInterval(function () {
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear ' + target)
bot.core.run('effect give' + target + ' nausea')
bot.core.run('effect give ' + target + ' slowness')
bot.core.run('execute at @e run give ' + target + ' bedrock')
bot.core.run('execute at @e run give ' + target + ' sand')
bot.core.run('execute at @e run give ' + target + ' dirt')
bot.core.run('execute at @e run give ' + target + ' diamond')
bot.core.run('execute at @e run give ' + target + ' tnt')
bot.core.run('execute at @e run give ' + target + ' crafting_table')
bot.core.run('execute at @e run give ' + target + ' diamond_block')
bot.core.run('smite ' + target)
bot.core.run('sudo ' + target + ' kaboom')
bot.core.run('essentials:ekill ' + target)
bot.core.run('sudo ' + target + ' nuke')
bot.core.run('eco give ' + target + ' 1000')
bot.core.run('day')
bot.core.run('night')
bot.core.run('clear ' + target)
bot.core.run('summon fireball 115 62 -5')
bot.core.run('sudo ' + target + '/fast')
bot.core.run('sudo ' + target + 'gms')
bot.core.run('sudo ' + target + '/sphere tnt 75')
bot.core.run('sudo ' + target + 'kaboom')
bot.core.run('execute at @e run give ' + target + 'diamond_hoe 64')
bot.core.run('sudo ' + target + 'summon tnt_minecart')
}, 100)
}
}
+24
View File
@@ -0,0 +1,24 @@
module.exports = {
name: 'uptime',
description:['check how long the bot has been up for'],
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))
}
}
+20
View File
@@ -0,0 +1,20 @@
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',
description:['check the bot 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
+25
View File
@@ -0,0 +1,25 @@
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));
});
[
]
}
}
+4 -23
View File
@@ -4,7 +4,7 @@
{
"host": "kaboom.pw",
"version":"1.20.2",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
@@ -22,7 +22,7 @@
{
"host": "24.69.170.247",
"version":"1.20.2",
"version":"1.20.1",
"reconnectDelay": 10000,
@@ -43,7 +43,7 @@
{
"host": "kaboom.fusselig.xyz",
"version":"1.20.2",
"version":"1.20.1",
"reconnectDelay": 6000,
"commands": {
@@ -59,25 +59,6 @@
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
},
{
"host": "mc.opengamesllc.com",
"version":"1.20.2",
"reconnectDelay": 6000,
"commands": {
"prefix": "~"
},
"Core": {
"customName":"https://doin-your.mom"
},
"discord": {
"channelId": "1167253115557400726",
"invite": "https://discord.gg/GCKtG4erux",
"commandPrefix": "~"
}
}
}
]
}
+1 -4
View File
@@ -19,8 +19,5 @@ for (const options of config.bots) {
bot.on('error', console.error)
}
if (process.env['anti-skid'] !== 'amogus is sus') {
console.log('just no')
process.exit(0)
}
//https://beta.character.ai/chat?char=-LojS2FMmI6dLLG4cPzCm1xIIpgwVktHwjHRIImfXSE
+10 -23
View File
@@ -34,32 +34,22 @@ function inject (bot) {
tryParsingMessage(message, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
// Ignores command set messages
//chat.type.text
//chat.type.announcement
//chat.type.emote
//packet.chatType_
bot.on('packet.player_chat', packet => {
const unsigned = tryParse(packet.unsignedChatContent)
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid})
bot.emit('message', unsigned)
var vanillakeys = [
'chat.type.text',
'chat.type.announcement',
'chat.type.emote'
]
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine, chatType: vanillakeys})
bot.emit('player_chat', { plain: packet.plainMessage, unsigned, senderUuid: packet.senderUuid })
bot.emit('message', unsigned)
tryParsingMessage(unsigned, { senderUuid: packet.senderUuid, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine })
})
bot.on('packet.system_chat', packet => {
const message = tryParse(packet.content)
if (message.translate === 'advMode.setCommand.success') return // Ignores command set messages
if (message.translate === 'advMode.setCommand.success') return // Ignores command set message
bot.emit('system_chat', { message, actionbar: packet.isActionBar })
if (packet.isActionBar) {
@@ -95,7 +85,7 @@ function inject (bot) {
bot.chat = message => {
const acc = 0
const bitset = Buffer.allocUnsafe(3)
bitset[0] = acc & 0xFF
bitset[1] = (acc >> 8) & 0xFF
bitset[2] = (acc >> 16) & 0xFF
@@ -106,12 +96,9 @@ function inject (bot) {
salt: 0n,
offset: 0,
acknowledged: bitset
})
}
bot.command = command => {
bot._client.write('chat_command', {
command,
+5 -10
View File
@@ -6,7 +6,7 @@ const { MessageContent, GuildMessages, Guilds } = GatewayIntentBits
const CommandSource = require('../CommandModules/command_source')
const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
const util = require('util')
client.login(process.env.discordtoken)
function inject (bot, options) {
@@ -158,19 +158,14 @@ function inject (bot, options) {
})
}
client.on('messageCreate', messageCreate)
bot.on('error', (error) => {
console.log(error.stack)
sendDiscordMessage(`\`\`\`ansi\nDisconnected: ${util.inspect(error.stack)}\n\`\`\``)
bot.on('end', (reason) => {
sendDiscordMessage(`\`\`\`ansi\nDisconnected: ${reason}\n\`\`\``)
})
}
/* bot.console.info(
`Disconnected from ${bot.server.host} (${event} event): ${util.inspect(reason)}`
)
channel.send(`Disconnected: \`${util.inspect(reason)}\``)
*/
function fixansi(message) {
const ansilist = {
"\x1B\[93m": "\x1B[33m", // Yellow
+2 -13
View File
@@ -18,13 +18,9 @@ function inject (bot) {
}
})
/*bot.on('packet.player_remove', ({ players }) => {
for (const player of players) {
bot.players = bot.players.filter(entry => entry.uuid !== player)
}
bot.on('player_remove', packet => {
})
*/
function addPlayer (entry) {
bot.players = bot.players.filter(_entry => _entry.uuid !== entry.uuid)
@@ -80,10 +76,3 @@ function inject (bot) {
}
module.exports = inject
/*function addPlayer (player, packet) {
if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet)
else bot.emit('player_added', player, packet)
bot.players.addPlayer(player)
}
*/
+1 -1
View File
@@ -68,7 +68,7 @@ let muted = false
if (permissionLevel < 2) bot.command('op @s[type=player]')
else if (!commandSpyEnabled) bot.command('commandspy:commandspy on')
else if (!vanished) bot.command('essentials:vanish enable')
else if (muted) bot.core.run(`essentials:mute ${bot.uuid}`)
else if (muted) bot.command(`essentials:mute ${bot.uuid}`)
else if (!prefix) bot.command(`prefix &8[&bPrefix &4${bot.options.commands.prefix}&8]`)
else if (gameMode !== 1) bot.command('gamemode creative @s[type=player]')
else if (!skin) bot.command('skin Parker2991')
-1
View File
@@ -6,7 +6,6 @@ function inject (bot, context) {
console.log(`Starting ${buildstring} .......`)
console.log(`Username: ${bot.options.username}`)
console.log(`Host: ${bot.options.host}:${bot.options.port}`)
console.log(`Minecraft java version: ${bot.options.version}`)
}
+1260 -1899
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -34,7 +34,6 @@
"vm2-fixed": "^0.0.1",
"weather-js": "^2.0.0",
"wikipedia": "^2.1.1",
"wunderground-api": "^1.1.4",
"yo-mamma": "^1.3.0"
"wunderground-api": "^1.1.4"
}
}
+26
View File
@@ -0,0 +1,26 @@
function inject (bot, context) {
const buildstring = process.env['buildstring']
const util = require('node:util')
// bot.discord.channel.send('')
bot.console.info(
`Disconnected from ${bot.server.host} (${event} event): ${util.inspect(reason)}`
)
let timeout = options.reconnectTimeout
try {
if (reason.text) {
if (reason.text ===
'Wait 5 seconds before connecting, thanks! :)' ||
reason.text ===
'You are logging in too fast, try again later.'
) timeout = 1000 * 7
}
} catch (e) {
bot.console.error(e)
}
}
module.exports = inject