forked from afspiegeling/NitoriBot
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da8246636f |
@@ -0,0 +1 @@
|
||||
.git
|
||||
@@ -0,0 +1,11 @@
|
||||
# chomens-bot-js
|
||||
***(originally named chomens-bot-mc)***\
|
||||
\
|
||||
Archive of ChomeNS Bot Javascript source code.\
|
||||
\
|
||||
Some of the code are messy and hardcoded so you might wanna change some of it.\
|
||||
\
|
||||
Explore the code and see how it works!\
|
||||
Also note that the core is broken sometimes.
|
||||
|
||||
R.I.P ChomeNS Bot Javascript
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('node:events')
|
||||
const { EventEmitter } = require('events')
|
||||
const { loadPlugins } = require('./util/loadPlugins')
|
||||
const util = require('node:util')
|
||||
const randomstring = require('randomstring')
|
||||
|
||||
@@ -8,7 +8,6 @@ module.exports = {
|
||||
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
||||
bot.tellraw(selector, [{ text: 'The bot\'s username is: ', color: 'white' }, { text: bot.username, color: 'gold', clickEvent: { action: 'copy_to_clipboard', value: bot.username }, hoverEvent: { action: 'show_text', contents: [{ text: 'Click here to copy the username to your clipboard', color: 'green' }] } }, { text: ' and the UUID is: ' }, { text: bot.uuid, color: 'aqua', clickEvent: { action: 'copy_to_clipboard', value: bot.uuid }, hoverEvent: { action: 'show_text', contents: [{ text: 'Click here to copy the UUID to your clipboard', color: 'green' }] } }])
|
||||
},
|
||||
|
||||
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor(config.discord.embedsColors.normal)
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
const randomstring = require('randomstring')
|
||||
module.exports = {
|
||||
version: '1.19.2',
|
||||
prefixes: [
|
||||
'3*',
|
||||
'cbot3 ',
|
||||
'/cbot3 '
|
||||
],
|
||||
commandsDir: '../commands', // this will be used by the commands.js in the plugins folder so it needs ../
|
||||
proxy: {
|
||||
enabled: false,
|
||||
version: '1.10'
|
||||
},
|
||||
console: true,
|
||||
chat: {
|
||||
messageLength: 100
|
||||
},
|
||||
core: {
|
||||
layers: 3,
|
||||
refillInterval: 1000 * 60,
|
||||
|
||||
customName: [
|
||||
{
|
||||
text: 'https://doin-your.mom',
|
||||
color: 'dark_red'
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
self_care: {
|
||||
prefix: true,
|
||||
op: true,
|
||||
cspy: true,
|
||||
vanish: true,
|
||||
nickname: true,
|
||||
socialspy: true,
|
||||
gamemode: true,
|
||||
mute: true,
|
||||
endCredits: true
|
||||
},
|
||||
eval: {
|
||||
serverUrl: 'http://localhost:4445/'
|
||||
},
|
||||
reconnectTimeout: 15000, // idk mabe
|
||||
timeoutInterval: 1000 * 40,
|
||||
self_care_check_interval: 2000,
|
||||
discord: {
|
||||
prefix: '!',
|
||||
servers: {
|
||||
|
||||
|
||||
'mc.opengamesllc.com:25565': '1152807355000565871',
|
||||
'kaboom.pw:25565': '1152807462836109402',
|
||||
'168.100.232.7:25565':'1155838188586283109',
|
||||
},
|
||||
embedsColors: {
|
||||
normal: '#FFFF00',
|
||||
error: '#FF0000'
|
||||
}
|
||||
},
|
||||
servers: [
|
||||
// logging means log to console
|
||||
|
||||
|
||||
{
|
||||
host: 'mc.opengamesllc.com',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
{
|
||||
host: '168.100.232.7',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
|
||||
{
|
||||
host: 'kaboom.pw',
|
||||
port: 25565,
|
||||
username: randomstring.generate(8),
|
||||
kaboom: true,
|
||||
logging: true,
|
||||
useChat: false
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
@@ -1,13 +1,11 @@
|
||||
class CommandSource {
|
||||
constructor (player, sources, hash = false, owner = false, discordMessageEvent = null, consoleOnly = sources) {
|
||||
constructor (player, sources, hash = false, discordMessageEvent = null, consoleOnly = sources) {
|
||||
this.player = player
|
||||
this.sources = sources
|
||||
this.hash = hash
|
||||
this.owner = owner
|
||||
this.consoleOnly = consoleOnly
|
||||
this.discordMessageEvent = discordMessageEvent
|
||||
this.displayName = player
|
||||
|
||||
}
|
||||
|
||||
sendFeedback () {}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# FNFBoyfriendBot-V4.0
|
||||
|
||||
|
||||
Final Build of v4.0 (v4.3.4) but not the final build of the Ultimate Foundation code base of FNFBoyfriendBot
|
||||
+6802
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('events')
|
||||
const { EventEmitter } = require('node:events')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const util = require('node:util')
|
||||
@@ -78,15 +78,13 @@ options.input ??= true
|
||||
client.on('end', reason => { bot.emit('end', reason)
|
||||
|
||||
})
|
||||
client.on('end', reason => { bot.emit('end', reason)
|
||||
|
||||
})
|
||||
/*client.on('keep_alive', ({ keepAliveId }) => {
|
||||
client.on('keep_alive', ({ keepAliveId }) => {
|
||||
bot.emit('keep_alive', { keepAliveId })
|
||||
})*/
|
||||
})
|
||||
client.on('error', error => bot.emit('error', error), )
|
||||
|
||||
})
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
|
||||
const client = options.client ?? mc.createClient(options)
|
||||
@@ -94,8 +92,6 @@ const buildstring = process.env['buildstring']
|
||||
bot.emit('init_client', client)
|
||||
|
||||
bot.bots = options.bots ?? [bot]
|
||||
bot.setMaxListeners(Infinity)
|
||||
bot._client.setMaxListeners(Infinity)
|
||||
|
||||
// Modules
|
||||
bot.loadModule = module => module(bot, options)
|
||||
|
||||
@@ -5,7 +5,6 @@ module.exports = {
|
||||
description:['bots dev history'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -195,10 +195,8 @@ const bots = [
|
||||
module.exports = {
|
||||
name: 'bots',
|
||||
description:['shows a list of known bots'],
|
||||
aliases:['knownbots'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
const bot = context.bot
|
||||
|
||||
@@ -3,15 +3,12 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'bruhify',
|
||||
description:['bruhify text'],
|
||||
aliases:['bruhifytext', 'bruh'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
bot.bruhifyText = args.join(' ')
|
||||
|
||||
context.source.sendFeedback(JSON.stringify(bot.bruhifyText))
|
||||
|
||||
@@ -4,8 +4,6 @@ module.exports = {
|
||||
description:['calculate maths'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['calc'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
@@ -346,8 +346,6 @@ module.exports = {
|
||||
description:['check the bots changelog'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['cl', 'changes'],
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'cloop',
|
||||
hashOnly: true,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
description:['command loop commands, the args are add, remove, clear, and list'],
|
||||
aliases:['commandloop'],
|
||||
execute (context, selector) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
|
||||
// throw new CommandError('temp disabled')
|
||||
switch (selector, args[1]) {
|
||||
case 'add':
|
||||
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
|
||||
|
||||
+1
-2
@@ -4,8 +4,7 @@ const foundation = process.env['FoundationBuildString']
|
||||
module.exports = {
|
||||
name: 'console',
|
||||
consoleOnly:true,
|
||||
hashOnly:false,
|
||||
ownerOnly:false,
|
||||
hashOnly:true,
|
||||
description:['no :)'],
|
||||
// description:['make me say something in custom chat'],
|
||||
execute (context) {
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'consoleserver',
|
||||
|
||||
consoleOnly: true,
|
||||
hashOnly:false,
|
||||
ownerOnly:false,
|
||||
hashOnly:true,
|
||||
description:['consoleserver'],
|
||||
aliases:['csvr'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
if (args.length === 0){
|
||||
source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
} else if (args.length === 2){
|
||||
source.sendFeedback({translate:"Too many Arguments!", color:"red"})
|
||||
}
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
|
||||
const servers = bot.bots.map(eachBot => eachBot.options.host)
|
||||
|
||||
+1
-10
@@ -3,21 +3,12 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'core',
|
||||
description:['make me run a command in core'],
|
||||
aliases:['cb','corerun','run','commandblockrun','cbrun'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
// const client = context.client
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const client = context.client
|
||||
const message = context.arguments.join(' ')
|
||||
// if (args.length === 0){
|
||||
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
if (args[0] === undefined){
|
||||
source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
}
|
||||
if (message.startsWith('/')) {
|
||||
bot.core.run(message.substring(1))
|
||||
return
|
||||
|
||||
+1
-3
@@ -3,10 +3,8 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'cowsay',
|
||||
description:['mooooo'],
|
||||
aliases:['cws', 'cow'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context, selector) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
@@ -15,7 +13,7 @@ module.exports = {
|
||||
const source = context.source
|
||||
const cowsay = require('cowsay2')
|
||||
const cows = require('cowsay2/cows')
|
||||
if (args[0].toLowerCase() === 'list') {
|
||||
if (args[0] === 'list') {
|
||||
const listed = Object.keys(cows)
|
||||
|
||||
let primary = true
|
||||
|
||||
@@ -5,12 +5,9 @@ module.exports = {
|
||||
description:['crashes a server'],
|
||||
hashOnly: true,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['crashserver', '69'],//69 cuz yes
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
// throw new CommandError('temp disabled')
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
|
||||
@@ -5,8 +5,6 @@ module.exports = {
|
||||
description:['make me say something in discord'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['discordmessage', 'ddmsg'],
|
||||
execute (context) {
|
||||
//const args = context.args
|
||||
const bot = context.bot
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
module.exports = {
|
||||
name: 'echo',
|
||||
description:['make me say something in chat'],
|
||||
aliases:['chatsay'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'end',
|
||||
description:['/kill the bot or make it /suicide'],
|
||||
hashOnly:true,
|
||||
ownerOnly:false,
|
||||
consoleOnly:false,
|
||||
aliases:['kys','kill','suicide'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
source.sendFeedback(`${bot.username} fell out of the world`)
|
||||
process.exit('amongus')
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
@@ -3,10 +3,8 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'errortest',
|
||||
description:['test errors'],
|
||||
aliases:['error', 'errtest', 'errtst'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
//context.source.sendFeedback('hint hover your mouse over the error')
|
||||
|
||||
@@ -8,8 +8,6 @@ module.exports = {
|
||||
name: 'evaljs',
|
||||
hashOnly:true,
|
||||
consoleOnly:false,// vm owners please dont get mad at me ;-;
|
||||
ownerOnly:false,
|
||||
aliases:['evaljsisolatedvm', 'evaljsnew', 'evaljsivm', 'eval', 'evalivm', 'evalisolatedvm', 'evaljsnew'],
|
||||
description:['run code in a vm note: amcforum members had a sh##fit over this command'],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
@@ -24,7 +22,6 @@ hashOnly:true,
|
||||
{ color: 'dark_green', text: 'EvalJS'},
|
||||
]
|
||||
}
|
||||
// throw new CommandError('temp disabled')
|
||||
/* bot.tellraw(selector, { text: util.inspect(bot.vm.run(args.slice(1).join(' ')), { stylize }).substring(0, 32000) })
|
||||
} catch (err) {
|
||||
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'Parker2991'), color: 'red' })
|
||||
|
||||
@@ -11,9 +11,7 @@ module.exports = {
|
||||
name: 'evaljsvm2',
|
||||
hashOnly:true,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
description:['old evaljs code'],
|
||||
aliases:['evaljsold', 'evalvm2', 'evalold'],
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
@@ -25,7 +23,6 @@ hashOnly:true,
|
||||
{ color: 'dark_green', text: 'EvalJS Cmd'},
|
||||
]
|
||||
}
|
||||
// throw new CommandError('temp disabled')
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (args[1]) {
|
||||
case 'run':
|
||||
|
||||
+1
-2
@@ -4,10 +4,9 @@ module.exports = {
|
||||
name: 'filter',
|
||||
hashOnly: true,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
description:['filter players (not functional)'],
|
||||
execute (context) {
|
||||
//throw new CommandError('temp disabled')
|
||||
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = {
|
||||
name: 'botval',
|
||||
name: 'val',
|
||||
|
||||
consoleOnly: true,
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = {
|
||||
|
||||
const args = context.arguments
|
||||
|
||||
const key = process.env['FNFBoyfriendBot_Owner_key']
|
||||
const key = process.env['FNFBoyfriendBot_key']
|
||||
//al
|
||||
const time = Math.floor(Date.now() / 11000)
|
||||
|
||||
|
||||
+26
-83
@@ -2,11 +2,10 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
|
||||
aliases:['heko'],
|
||||
description:['shows the command list'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const commandList = []
|
||||
@@ -38,22 +37,18 @@ module.exports = {
|
||||
for (const fard in bot.commandManager.amogus) { // i broke a key woops
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
|
||||
if (args[0].toLowerCase() === command.name )
|
||||
// if (args[0].toLowerCase() === command.aliases)
|
||||
{
|
||||
if (args[0].toLowerCase() === command.name) {
|
||||
valid = true
|
||||
source.sendFeedback([cmd, `Description: ${command.description}`])
|
||||
source.sendFeedback([cmd, `aliases: ${command.aliases}`])
|
||||
break
|
||||
} else valid = false
|
||||
}
|
||||
//source is defined btw
|
||||
}//source is defined btw
|
||||
//source.sendFeedback([cmd, 'This command is ' + valid + ' to this for loop'])
|
||||
if (valid) {
|
||||
|
||||
} else {
|
||||
const args = context.arguments
|
||||
source.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`,color:'red', with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help` } : undefined}])
|
||||
source.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`, with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help`, color:'red' } : undefined}])
|
||||
// bot.tellraw([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`, with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help`, color:'red' } : undefined}])
|
||||
}//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
|
||||
@@ -67,13 +62,13 @@ module.exports = {
|
||||
let cons_ole = []
|
||||
for (const fard in bot.commandManager.amogus) {
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
|
||||
if (command.hashOnly) {
|
||||
// if (command.consoleOnly == true) return console.log(command);
|
||||
if(command.consoleOnly) {
|
||||
cons_ole.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'blue',
|
||||
color: 'red',
|
||||
|
||||
|
||||
translate:"",
|
||||
@@ -90,55 +85,13 @@ module.exports = {
|
||||
{text:'consoleOnly:',color:'white'},
|
||||
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
}
|
||||
}
|
||||
)// copypasted from below, and removed stuff that wont work in the console
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
if (command.ownerOnly) {
|
||||
own_her.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'dark_red',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:"HashOnly:",
|
||||
color:'white'},
|
||||
{text:`${command.hashOnly}\n`,color:'red'},
|
||||
{text:'consoleOnly:',color:'white'},
|
||||
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
|
||||
{text:'ownerOnly:', color:'white'},
|
||||
{text:`${command.ownerOnly}\n`, color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.options.commands.prefix}${command.name}`
|
||||
},
|
||||
// ${command.name}\nhashOnly:§c${command.hashOnly}§r\nconsoleOnly:§c${command.consoleOnly && !context.console}§r\n${command.description}
|
||||
|
||||
///tellraw @a {"translate":"","hoverEvent":{"action":"show_text","value":[{"text":""},{"text":""}]},"clickEvent":{"action":"run_command","value":"a"}}
|
||||
clickEvent: command.name ? { action: 'suggest_command', value: `~${command.name}` } : undefined,
|
||||
}
|
||||
)//my w
|
||||
}
|
||||
// let valid
|
||||
else if (command.hashOnly && !command.ownerOnly && !command.consoleOnly){
|
||||
}
|
||||
else {
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
@@ -158,10 +111,7 @@ module.exports = {
|
||||
{text:`${command.hashOnly}\n`,color:'red'},
|
||||
{text:'consoleOnly:',color:'white'},
|
||||
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
|
||||
{text:'ownerOnly:', color:'white'},
|
||||
{text:`${command.ownerOnly}\n`, color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
@@ -170,14 +120,13 @@ module.exports = {
|
||||
// ${command.name}\nhashOnly:§c${command.hashOnly}§r\nconsoleOnly:§c${command.consoleOnly && !context.console}§r\n${command.description}
|
||||
|
||||
///tellraw @a {"translate":"","hoverEvent":{"action":"show_text","value":[{"text":""},{"text":""}]},"clickEvent":{"action":"run_command","value":"a"}}
|
||||
// clickEvent: command.name ? { action: 'suggest_command', value: `~${command.name}` },
|
||||
|
||||
clickEvent: command.name ? { action: 'suggest_command', value: `~${command.name}` } : undefined,
|
||||
}
|
||||
)
|
||||
//my w
|
||||
}
|
||||
else if (!command.hashOnly && !command.ownerOnly && !command.consoleOnly){
|
||||
pub_lick.push(
|
||||
)//my w
|
||||
}
|
||||
} else {
|
||||
//if (command.consoleOnly) return;
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'green',
|
||||
@@ -194,21 +143,16 @@ module.exports = {
|
||||
{text:`${command.hashOnly}\n`,color:'red'},
|
||||
{text:'consoleOnly:',color:'white'},
|
||||
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
|
||||
{text:'ownerOnly:', color:'white'},
|
||||
{text:`${command.ownerOnly}\n`,color:'red'},
|
||||
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"suggest_command",value:`${bot.options.commands.prefix}${command.name}`}
|
||||
|
||||
})
|
||||
|
||||
// copypasted from below, and removed stuff that wont work in the console
|
||||
}
|
||||
//{command.consoleOnly && !source.sources.console
|
||||
action:"suggest_command",value:`${bot.options.commands.prefix}${command.name}`
|
||||
},
|
||||
|
||||
}
|
||||
)
|
||||
} //{command.consoleOnly && !source.sources.console
|
||||
//${command.description}
|
||||
|
||||
// for (const command of context.bot.commandManager.getCommands()) {
|
||||
@@ -226,16 +170,15 @@ module.exports = {
|
||||
// mabe idk
|
||||
const length = context.bot.commandManager.amogus.length
|
||||
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole], false)
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, cons_ole], false)
|
||||
} else {
|
||||
const length = context.bot.commandManager.amogus.filter(c => !c.consoleOnly).length
|
||||
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust ,own_her], false)
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust], false)
|
||||
}
|
||||
|
||||
|
||||
// bot.tellraw([own_her])
|
||||
//console.log(pub_lick)
|
||||
//console.log(t_rust)
|
||||
}//
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
-39
@@ -13,10 +13,8 @@ async function getCpuModelName () {
|
||||
module.exports = {
|
||||
name: 'info',
|
||||
description:['check the bots info. the args are version, discord, serverinfo, logininfo, uptime, memused, creators'],
|
||||
aliases:['information'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
async execute (context, client) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
@@ -139,23 +137,7 @@ module.exports = {
|
||||
|
||||
const os = require('os')
|
||||
context.source.sendFeedback({
|
||||
color:'gray',text:`Hostname: ${os.hostname()}`})
|
||||
context.source.sendFeedback({
|
||||
color: "gray", text: `Working Directory: ${path.join(__dirname, '..')}`})
|
||||
context.source.sendFeedback( { color: "gray", text: `OS architecture: ${os.arch()}`})
|
||||
context.source.sendFeedback({ color: "gray", text: `OS platform: ${os.platform()}`})
|
||||
context.source.sendFeedback({ color: "gray", text: `OS name: ${os.version()}`})
|
||||
context.source.sendFeedback({ color: "gray", text: `CPU cores: ${os.cpus().length}`})
|
||||
/*if (os.platform() === 'win32')
|
||||
context.source.sendFeedback( { color: "gray", text: `CPU model: ${await getCpuModelName()}`})
|
||||
return*/
|
||||
if (os.platform() !== 'linux'){
|
||||
source.sendFeedback({text:'cannot find the cpu model are you sure the bot is running on linux?', color:'red'})
|
||||
}
|
||||
else if (os.platform() === 'linux') {
|
||||
source.sendFeedback({ color: "gray", text: `CPU model: ${await getCpuModelName()}`})
|
||||
}
|
||||
/*translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s',//lazy fix
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s',//lazy fix
|
||||
with: [
|
||||
{ color: "gray", text: `Hostname: ${os.hostname()}`},
|
||||
{ color: "gray", text: `Working Directory: ${path.join(__dirname, '..')}`},
|
||||
@@ -168,7 +150,7 @@ module.exports = {
|
||||
|
||||
|
||||
]
|
||||
});*/
|
||||
});
|
||||
break
|
||||
case 'logininfo':
|
||||
source.sendFeedback({text:`Bot Username: "${bot.username}"`, color:'gray'})
|
||||
@@ -195,20 +177,6 @@ module.exports = {
|
||||
|
||||
|
||||
source.sendFeedback({ color: "gray", text: `ConsoleServer:"${bot.console.consoleServer}"`})
|
||||
const amonger = bot.bots.map(eachBot => eachBot.options.host + '\n')
|
||||
const port = bot.bots.map(eachBot => eachBot.options.port)
|
||||
|
||||
if (amonger.length === 0){
|
||||
const list = [];
|
||||
for (const host of bots){
|
||||
if (list.length !== 0) {
|
||||
list.push(host.name)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
source.sendFeedback('Servers:' + amonger.length)
|
||||
|
||||
/*context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
@@ -229,12 +197,20 @@ if (amonger.length === 0){
|
||||
break
|
||||
case 'test':
|
||||
// bot.tellraw('test')
|
||||
// const porta = bot.bots.map(eachBot => eachBot.options.port)
|
||||
const amongerus = bot.bots.map(eachBot => eachBot.options.host + ':' + eachBot.options.port + '\n')
|
||||
|
||||
const amonger = bot.bots.map(eachBot => eachBot.options.host + '\n')
|
||||
const port = bot.bots.map(eachBot => eachBot.options.port)
|
||||
|
||||
|
||||
source.sendFeedback(amongerus)
|
||||
if (amonger.length === 0){
|
||||
const list = [];
|
||||
for (const host of bots){
|
||||
if (list.length !== 0) {
|
||||
list.push(host.name)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
source.sendFeedback('Servers:' + amonger.length)
|
||||
source.sendFeedback(``)
|
||||
// source.sendFeedback(amonger)
|
||||
break
|
||||
case 'uptime':
|
||||
|
||||
+2
-4
@@ -6,12 +6,10 @@ module.exports = {
|
||||
name: 'kick',
|
||||
hashOnly:true,//now its not
|
||||
description:['kicks a player'],
|
||||
|
||||
hashOnly:true,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:[],
|
||||
execute(context) {
|
||||
// throw new CommandError('temp disabled')
|
||||
|
||||
//throw new CommandError('command temporarily disabled until hashing is implemented')
|
||||
const args = context.arguments
|
||||
|
||||
|
||||
+2
-8
@@ -5,19 +5,13 @@ module.exports = {
|
||||
description:['check the player list'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['playerlist', 'plist'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
const players = bot.players
|
||||
const source = context.source
|
||||
const component = []
|
||||
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
if (args.length !== 0){
|
||||
throw new CommandError({translate:"Too many Arguments!", color:"red"})
|
||||
}
|
||||
for (const player of players) {
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s] %s',
|
||||
with: [
|
||||
|
||||
@@ -5,10 +5,8 @@ const os = require('os')
|
||||
module.exports = {
|
||||
name: 'lol',
|
||||
description:['idfk dont ask'],
|
||||
aliases:['ohio'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
throw new CommandError('idfk lmao')
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ module.exports = {
|
||||
description:['tps'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['memoryusage', 'memused','memoryused'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
|
||||
@@ -4,10 +4,8 @@ module.exports = {
|
||||
name: 'music',
|
||||
//<< this one line of code broke it lmao
|
||||
description:[''],
|
||||
aliases:[],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -4,8 +4,6 @@ module.exports = {
|
||||
description:['send a message to other servers'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['networkmessage', 'netmessage', 'networkmsg'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -3,8 +3,6 @@ module.exports = {
|
||||
description:['refill the bots core'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['refillcore'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
+1
-4
@@ -3,15 +3,12 @@ module.exports = {
|
||||
name: 'recend',
|
||||
description:['reconnect or end the bot the usages are end, and reconnect'],
|
||||
hashOnly:true,
|
||||
ownerOnly:false,
|
||||
consoleOnly:false,
|
||||
aliases:['reconnectend'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
//throw new CommandError('disabled until owner hash is added')
|
||||
// throw new CommandError('temp disabled')
|
||||
//throw new CommandError('disabled until owner hash is added')
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case `end`:
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'reconnect',
|
||||
description:['reconnect the bot when?'],
|
||||
hashOnly:true,
|
||||
ownerOnly:false,
|
||||
consoleOnly:false,
|
||||
aliases:['rec'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
|
||||
|
||||
|
||||
bot._client.end()
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
@@ -7,8 +7,6 @@ module.exports = {
|
||||
description:['make me say something in custom chat'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['tellrawsay', 'tellrawmsg', 'trmessage', 'tellrawmessage', 'sourcesendfeedbacksay','sourcesendfeedbackmsg','sourcesendfeedbackmessage', 'ssfbmsg', 'ssfmessage'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -3,11 +3,9 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'sctoggle',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['selfcare toggle'],
|
||||
aliases:['selfcaretoggle'],
|
||||
description:['tps'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
|
||||
@@ -5,13 +5,10 @@ let timer = null
|
||||
module.exports = {
|
||||
name: 'selfdestruct',
|
||||
//why i put it in here probably cuz so it can be rewritten or smh idk
|
||||
hashOnly: false,
|
||||
ownerOnly:true,
|
||||
hashOnly: true,
|
||||
consoleOnly:false,
|
||||
aliases:['sfd'],
|
||||
description:['selfdestruct server'],
|
||||
execute (context) {
|
||||
//throw new CommandError('temp disabled')
|
||||
|
||||
//bot went brr
|
||||
|
||||
|
||||
@@ -2,16 +2,14 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'servereval',
|
||||
description:['no'],
|
||||
hashOnly:false,
|
||||
//ownerOnly:true,
|
||||
ownerOnly:true,
|
||||
hashOnly:true,
|
||||
ownerOnly:true,
|
||||
consoleOnly:false,
|
||||
aliases:['svreval'],
|
||||
execute (context, arguments, selector) {
|
||||
const bot = context.bot
|
||||
// const args = context.arguments.join(' ')
|
||||
const source = context.source
|
||||
// throw new CommandError('temp disabled')
|
||||
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
const util = require('util')
|
||||
const args = context.arguments
|
||||
|
||||
@@ -5,8 +5,6 @@ module.exports = {
|
||||
description:['very 1st command in the bot to test to see if things are working'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['tst'],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
@@ -4,7 +4,6 @@ module.exports = {
|
||||
name: 'testbench',
|
||||
//<< this one line of code broke it lmao
|
||||
description:[''],
|
||||
aliases:['tstbench'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
execute (context) {
|
||||
|
||||
@@ -3,10 +3,8 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'time',
|
||||
description:['check the time'],
|
||||
aliases:['clock', 'timezone'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -5,8 +5,6 @@ module.exports = {
|
||||
description:['teleport to a random place'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['rtp', 'teleportrandom', 'randomteleport'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const sender = context.source.player
|
||||
|
||||
@@ -6,8 +6,6 @@ module.exports = {
|
||||
description:['tps'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['tickspersecondbar', 'tickspersecond', 'tps'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
|
||||
@@ -4,10 +4,8 @@ module.exports = {
|
||||
name: 'translate',
|
||||
//<< this one line of code broke it lmao
|
||||
description:['<language 1> <language 2> <message>'],
|
||||
aliases:['translation'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
async execute (context) {
|
||||
const { translate } = require('@vitalets/google-translate-api')
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
@@ -3,9 +3,7 @@ const urban = require('urban-dictionary')
|
||||
module.exports = {
|
||||
name: 'urban',
|
||||
description:['urban dictionary'],
|
||||
aliases:['urbandictionary'],
|
||||
hashOnly:false,
|
||||
ownerOnly:false,
|
||||
consoleOnly:false,
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
|
||||
+3
-13
@@ -2,22 +2,12 @@ module.exports = {
|
||||
name: 'validate',
|
||||
description:['validate in the bot'],
|
||||
|
||||
hashOnly: true,
|
||||
hashOnly: true,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['val'],
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const bot = context.bot
|
||||
const hash = bot.hash
|
||||
const args = context.arguments
|
||||
const ownerhash = bot.owner
|
||||
|
||||
if (args[0] === hash) {
|
||||
|
||||
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
|
||||
} else if (args[0] === ownerhash) {
|
||||
source.sendFeedback({text: 'Valid OwnerHash', color:'green'})
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (args[0] === hash) {
|
||||
@@ -4,8 +4,6 @@ module.exports = {
|
||||
description:['wikipedia'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
aliases:['wikipedia'],
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const util = require('util')
|
||||
|
||||
const createBot = require('./bot.js')
|
||||
//const chomensjs = require('./ChomensJS')
|
||||
// TODO: Load a default config
|
||||
@@ -18,10 +18,8 @@ const bots = []
|
||||
bot.options.username
|
||||
bot.console.useReadlineInterface(rl)
|
||||
|
||||
// bot.on('error', (error), util.inspect(error))
|
||||
bot.on('error', error => {
|
||||
console.log((error))
|
||||
})
|
||||
bot.on('error', console.error)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6217
File diff suppressed because it is too large
Load Diff
+14
-69
@@ -18,79 +18,42 @@ const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
//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: 'blue' })
|
||||
//command.hashOnly && command.ownerOnly && args.length !== 0 && source.hash && source.owner
|
||||
if (command.hashOnly && args.length === 0) throw new CommandError({ translate: 'Please provide a hash or a OwnerHash', color: 'red' })
|
||||
|
||||
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 && source.hash) {
|
||||
// debug
|
||||
// console.log(`${args} args0 ${args[0]}`) //too sus
|
||||
const hash = `${args[0]}` // this is undefined
|
||||
const owner = `${args[0]}`
|
||||
|
||||
//\x1b[0m\x1b[91m
|
||||
//console.log(hash)
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
const player = source.player.profile.name
|
||||
const uuid = source.player.uuid
|
||||
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
|
||||
|
||||
bot.console.hash = function (error, source) {
|
||||
console.log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `[\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[92mHash\x1b[0m:${bot.hash}\x1b[0m]` )
|
||||
bot.console.hash = function (error, source) {
|
||||
console.log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer: ${player}, UUID:${uuid}, Hash:${bot.hash}\x1b[0m]` )
|
||||
}
|
||||
bot.console.ownerHash = function (error, source) {
|
||||
console.log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` + `[\x1b[0m\x1b[31mOwnerHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[31mOwnerHash\x1b[0m:${bot.owner}\x1b[0m]` )
|
||||
}
|
||||
if (args[0] === bot.hash) {
|
||||
bot.console.hash()
|
||||
} else if (args[0] === bot.owner) {
|
||||
bot.console.ownerHash()
|
||||
}
|
||||
bot.console.hash()
|
||||
console.log(bot.hash) // actual hash
|
||||
//but look in hashing.js
|
||||
if (hash !== bot.hash && owner !== bot.owner) throw new CommandError({ translate: 'Invalid hash or Invalid OwnerHash', color: 'red' }) // so true
|
||||
if (hash !== bot.hash) throw new CommandError({ translate: 'Invalid hash', color: 'dark_red' }) // so true
|
||||
//message?.member?.displayName
|
||||
bot.updatehash
|
||||
bot.updateowner
|
||||
}else if (command.hashOnly && source.sources.discord) {
|
||||
//const event = source.discordMessageEvent
|
||||
const event = source.discordMessageEvent
|
||||
|
||||
const roles = null.member?.roles?.cache
|
||||
const roles = event.member?.roles?.cache
|
||||
|
||||
const hasRole = roles.some(role => role.name === 'trusted'|| role.name === 'FNFBoyfriendBot Owner')
|
||||
|
||||
if (!hasRole) throw new CommandError({ translate: 'You are not trusted!' })
|
||||
}//source.discordMessageEvent.event.member.roles?.cache
|
||||
|
||||
/*
|
||||
else if (command.owner === bot.hash === true){
|
||||
throw new CommandError({ translate: 'THATS A TRUSTED HASH NOT A OWNER HASH!', color: 'dark_red' })
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if (command.ownerOnly && !source.owner) {
|
||||
// debug
|
||||
// console.log(`${args} args0 ${args[0]}`) //too sus
|
||||
const owner = `${args[0]}` // this is undefined
|
||||
if (owner && args.length === 0) throw new CommandError({ translate: 'Please provide a OwnerHash', color: 'dark_red' })
|
||||
console.log(bot.owner)
|
||||
if (owner === bot.hash){
|
||||
throw new CommandError({ translate: 'THATS A TRUSTED HASH NOT A OWNER HASH!', color: 'dark_red' })
|
||||
}
|
||||
if (owner !== bot.owner) throw new CommandError({ translate: 'Invalid Owner hash', color: 'dark_red' })
|
||||
bot.updateowner
|
||||
}
|
||||
|
||||
else if (command.owner && source.sources.discord) {
|
||||
// const event = source.discordMessageEvent
|
||||
|
||||
const roles = message.member?.roles?.cache
|
||||
|
||||
const hasRole = roles.some(role => role.name === 'FNFBoyfriendBot Owner')
|
||||
|
||||
if (!hasRole) throw new CommandError({ translate: 'You are not the Owner!' })
|
||||
}
|
||||
return command.execute({ bot, source, arguments: args })
|
||||
} catch (error) {
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
@@ -106,9 +69,6 @@ if (error instanceof CommandError) source.sendError(error._message)
|
||||
//
|
||||
// else source.sendError({ text:String(error.stack), color:'red' })
|
||||
else source.sendError({ translate: 'command.failed', color:'red', hoverEvent: { action: 'show_text', contents: String(error.stack) } })
|
||||
if (source.sources.discord) {
|
||||
source.sendError(error.stack)
|
||||
}
|
||||
}
|
||||
},
|
||||
// else source.sendError({ translate: 'command.failed', hoverEvent: { action: 'show_text', contents: String(error.message) } })
|
||||
@@ -117,13 +77,10 @@ if (error instanceof CommandError) source.sendError(error._message)
|
||||
return this.execute(source, commandName, args)
|
||||
},
|
||||
|
||||
register (command) {
|
||||
register (command) {
|
||||
this.commands[command.name] = command
|
||||
|
||||
if(command.aliases) {
|
||||
command.aliases.map(a => this.commands[a] = command)
|
||||
}
|
||||
},
|
||||
|
||||
getCommand (name) {
|
||||
return this.commands[name]
|
||||
},
|
||||
@@ -134,26 +91,14 @@ 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)
|
||||
}
|
||||
bot.commandManager.reload
|
||||
const amongerus = Object.keys(require.cache).filter(r => r.startsWith(path.resolve(`../commands`)));
|
||||
bot.commandManager.fileReload = amongerus.forEach(f => { // I guess too mabe forEach
|
||||
console.log(`Unloaded: ${f}`);
|
||||
delete require.cache[f];
|
||||
|
||||
bot.commandManager.register(command)
|
||||
})
|
||||
|
||||
if (process.env['anti-skid'] !== 'amogus is sus') {
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
+31
-47
@@ -22,30 +22,23 @@ if (line.startsWith('.')) {
|
||||
bot.console.source,
|
||||
|
||||
line.substring(1),
|
||||
//null
|
||||
`${process.env["FNFBoyfriendBot_Owner_key"]}`
|
||||
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
if (line === ',kill') process.exit()
|
||||
if (line === ',reconnect') bot._client.end()
|
||||
|
||||
|
||||
|
||||
if (line.startsWith('')){
|
||||
return bot.commandManager.executeString(
|
||||
bot.console.source,
|
||||
'console ' + line.substring(0)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//bot.commandManager.executeString(bot.console.source, line)
|
||||
if (!bot.options.input) return
|
||||
if (!bot.options.console) return
|
||||
bot.commandManager.executeString(bot.console.source, line)
|
||||
|
||||
})
|
||||
|
||||
@@ -72,29 +65,25 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
|
||||
|
||||
const prefix = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `
|
||||
|
||||
function log (...args) {
|
||||
rl.output.write('\x1b[2K\r')
|
||||
console.log(args.toString())
|
||||
rl._refreshLine()
|
||||
};
|
||||
|
||||
|
||||
bot.console.warn = function (error) {
|
||||
log(prefix + `[\x1b[0m\x1b[93mWARN\x1b[0m]: ${error}`)
|
||||
console.log(prefix + `[\x1b[0m\x1b[93mWARN\x1b[0m]: ${error}`)
|
||||
}
|
||||
bot.console.error = function (error) {
|
||||
log(prefix + `[\x1b[0m\x1b[31mERROR\x1b[0m]: ${error}`)
|
||||
console.log(prefix + `[\x1b[0m\x1b[31mERROR\x1b[0m]: ${error}`)
|
||||
}
|
||||
|
||||
bot.console.info = function (message) {
|
||||
log(prefix + `[\x1b[0m\x1b[32mInfo\x1b[0m]:` + message)
|
||||
console.log(prefix + `[\x1b[0m\x1b[32mInfo\x1b[0m]:` + message)
|
||||
}
|
||||
bot.console.log = function (message, ansi) {
|
||||
bot.console.logs = function (message, ansi) {
|
||||
|
||||
log(prefix + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
|
||||
console.log(prefix + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
|
||||
}
|
||||
bot.console.debug = function (message, ansi) {
|
||||
|
||||
log(prefix + `[\x1b[0m\x1b[33mDEBUG\x1b[0m]: ` + message)
|
||||
console.log(prefix + `[\x1b[0m\x1b[33mDEBUG\x1b[0m]: ` + message)
|
||||
}
|
||||
/*
|
||||
const player = source.player.profile.name
|
||||
@@ -102,7 +91,7 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
|
||||
|
||||
console.log(`[${now} \x1b[0m\x1b[91mHash\x1b[0m] [\x1b[0m\x1b[92mSender: ${player}, uuid:${uuid}, hash:${bot.hash}\x1b[0m]`)
|
||||
*/
|
||||
/* const ansimap = {
|
||||
const ansimap = {
|
||||
0: '\x1b[0m\x1b[30m',
|
||||
1: '\x1b[0m\x1b[34m',
|
||||
2: '\x1b[0m\x1b[32m',
|
||||
@@ -125,7 +114,7 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
|
||||
n: '\x1b[4m',
|
||||
m: '\x1b[9m',
|
||||
k: '\x1b[6m'
|
||||
}*/ /*return bot.commandManager.executeString(
|
||||
}/*return bot.commandManager.executeString(
|
||||
bot.username,
|
||||
options.commands.prefix + line.substring(1),
|
||||
bot.uuid,
|
||||
@@ -140,39 +129,34 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
|
||||
bot.console.source.sendFeedback = message => {
|
||||
//profile:{displayName:bot.username}
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi()
|
||||
|
||||
if (!bot.options.input) return
|
||||
if (!bot.options.console) return
|
||||
bot.console.log(ansi)
|
||||
|
||||
}
|
||||
|
||||
bot.on('message', message => {
|
||||
function log (...args) {
|
||||
function log (...args) {
|
||||
rl.output.write('\x1b[2K\r')
|
||||
console.log(args.toString())
|
||||
rl._refreshLine()
|
||||
};
|
||||
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const prefixy = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `
|
||||
|
||||
bot.console.logs = function (message, ansi) {
|
||||
|
||||
log(prefixy + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
|
||||
|
||||
log(ansi)
|
||||
|
||||
}
|
||||
|
||||
bot.on('message', message => {
|
||||
|
||||
const lang = require(`../util/language/${bot.options.language}.json`)
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
|
||||
const string = bot.getMessageAsPrismarine(message)?.toString()
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
// const logtag = (JSON.stringify({"text":"[LOGS]", "color":"#00FF00"}))
|
||||
|
||||
|
||||
if (!bot.options.input) return
|
||||
if (!bot.options.console) return
|
||||
bot.console.logs(`${ansi}`)
|
||||
|
||||
function log (...args) {
|
||||
rl.output.write('\x1b[2K\r')
|
||||
console.log(args.toString())
|
||||
rl._refreshLine()
|
||||
};
|
||||
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
|
||||
|
||||
log(`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] [\x1b[0m\x1b[33mLOGS\x1b[0m]: ${ansi}`)
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+5
-12
@@ -28,7 +28,7 @@ function inject (bot, options) {
|
||||
bot.discord.channel.send(`\`\`\`\nStarting ${process.env["buildstring"]}......\n\`\`\``)
|
||||
bot.discord.channel.send(`\`\`\`\nFoundation: ${process.env["FoundationBuildString"]}\n\`\`\``)
|
||||
bot.discord.channel.send(`\`\`\`\nSuccessfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}\n\`\`\``)
|
||||
bot.console.info(`Successfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}`)
|
||||
console.log(`Successfully logged into discord as ${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}`)
|
||||
})
|
||||
|
||||
// I feel like this is a modified version of ChomeNS Bot's discord plugin (the js one ofc) lol - chayapak
|
||||
@@ -168,21 +168,14 @@ function inject (bot, options) {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
client.on('messageCreate', messageCreate)
|
||||
bot.on('error', (error, reason, data) => {
|
||||
bot.on('error', (error) => {
|
||||
|
||||
sendDiscordMessage(`Disconnected: ${error.stack}`)
|
||||
|
||||
//sendDiscordMessage(reason)
|
||||
sendDiscordMessage(`Disconnected: ${util.inspect(error.stack)}`)
|
||||
|
||||
|
||||
})
|
||||
|
||||
/*bot.on('end', (reason, event) => {
|
||||
sendDiscordMessage('event:' + event)
|
||||
sendDiscordMessage('Reason:' + util.inspect(reason))
|
||||
|
||||
})*/
|
||||
|
||||
//client.on('end', reason => { bot.emit('end', reason)
|
||||
//client.on('keep_alive', ({ keepAliveId }) => {
|
||||
//bot.emit('keep_alive', { keepAliveId })
|
||||
|
||||
+7
-9
@@ -1,26 +1,24 @@
|
||||
|
||||
// * Not real hashing
|
||||
const crypto = require('crypto')
|
||||
const ownerkey = process.env['FNFBoyfriendBot_Owner_key']
|
||||
const trustedkey = process.env['FNFBoyfriendBot_key']
|
||||
const key = process.env['FNFBoyfriendBot_key']
|
||||
function inject(bot) {
|
||||
bot.hash = ''
|
||||
bot.owner = ''
|
||||
bot.ownerhash = ''
|
||||
bot.updatehashes = update
|
||||
|
||||
let hash
|
||||
let owner
|
||||
let interval = setInterval(() => {
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + trustedkey).digest('hex').substring(0, 16)
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
|
||||
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
|
||||
bot.hash = hash
|
||||
bot.owner = owner
|
||||
bot.ownerhash = owner
|
||||
}, 2000)
|
||||
function update() {
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + trustedkey).digest('hex').substring(0, 16)
|
||||
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
|
||||
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
|
||||
bot.hash = hash
|
||||
bot.owner = owner
|
||||
bot.ownerhash = owner
|
||||
}
|
||||
//this should work right?
|
||||
|
||||
@@ -40,4 +38,4 @@ const ownerHashKey = process.env['chomensjs_owner_key']
|
||||
}, 2000)
|
||||
bot.on('end', () => {
|
||||
clearInterval(interval)
|
||||
*/
|
||||
*/
|
||||
@@ -1,13 +0,0 @@
|
||||
function messagelimit (bot, options) {
|
||||
let spamCount = 0
|
||||
setInterval(() => spamCount = 0, 1000 * 2)
|
||||
|
||||
bot.on('message', message => {
|
||||
if (message == (`${bot.options.commands.prefix} `) && spamCount > 300) {
|
||||
bot.tellraw('WTF spam detected rate limiting')
|
||||
return
|
||||
}
|
||||
spamCount++
|
||||
})
|
||||
}
|
||||
module.exports = messagelimit
|
||||
+1
-1
@@ -140,7 +140,7 @@ function inject (bot) {
|
||||
noteIndex = 0
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`) // maybe not a good place to put it here but idk
|
||||
}
|
||||
if (process.env["buildstring"] != "§5FridayNightFunkin§bBoyfriend§4Bot §8v5.0.0-Beta §8Build:290 Codename:§8Mono§fchrome")
|
||||
if (process.env["buildstring"] != "§5FridayNightFunkin§bBoyfriend§4Bot §8V4.3.4 §8Build:240 Codename:§4Suffering §4§ksiblings")
|
||||
{
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ function inject (bot) {
|
||||
target.removePlayer = entry.removePlayer
|
||||
}
|
||||
}
|
||||
if (process.env["Ultimate Foundation v2.0.0-Beta Build:190"])
|
||||
if (process.env["Ultimate Foundation V1.2.4 Build:150"])
|
||||
{
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
@@ -9,9 +9,7 @@ function reconnect (bot, options) {
|
||||
setTimeout(() => {
|
||||
bot._client = mc.createClient(options)
|
||||
bot.emit('init_client', bot._client)
|
||||
bot.setMaxListeners(Infinity)
|
||||
bot._client.setMaxListeners(Infinity)
|
||||
|
||||
|
||||
}, bot.reconnectDelay)
|
||||
|
||||
})
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"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",
|
||||
"cli": "^1.0.1",
|
||||
"color-convert": "^2.0.1",
|
||||
"cowsay2": "^2.0.4",
|
||||
"discord.js": "^14.14.1",
|
||||
"dotenv": "^16.3.1",
|
||||
"https": "^1.0.0",
|
||||
"isolated-vm": "^4.6.0",
|
||||
"minecraft-data": "^3.48.0",
|
||||
"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",
|
||||
"net": "^1.0.2",
|
||||
"node_characterai": "^1.1.3",
|
||||
"node_characterai_edited": "^1.1.5",
|
||||
"node-weatherunderground": "^1.2.0",
|
||||
"npm": "^9.5.1",
|
||||
"openweather-api-node": "^3.1.2",
|
||||
"prismarine-chat": "^1.9.1",
|
||||
"prismarine-nbt": "^2.2.1",
|
||||
"prismarine-proxy": "^1.1.4",
|
||||
"prismarine-registry": "^1.7.0",
|
||||
"project-version": "^2.0.0",
|
||||
"randombytes": "^2.1.0",
|
||||
"randomstring": "^1.3.0",
|
||||
"readline": "^1.3.0",
|
||||
"sharp": "^0.32.6",
|
||||
"urban-dictionary": "^3.0.2",
|
||||
"uuid-1345": "^1.0.2",
|
||||
"uuid-by-string": "^4.0.0",
|
||||
"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",
|
||||
"yo-mamma": "^1.3.0",
|
||||
"zlib": "^1.0.5"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ const styles = {
|
||||
boolean: '\xa76',
|
||||
date: '\xa75',
|
||||
module: '\xa7n',
|
||||
name: undefined,//undefined
|
||||
name: undefined,
|
||||
null: '\xa7l',
|
||||
number: '\xa76',
|
||||
regexp: '\xa74',
|
||||
|
||||
Reference in New Issue
Block a user