finished filter and made the bot send vanish in chat instead of core. v6.0.5, Build: 1050
This commit is contained in:
parent
0b264d7aaf
commit
e75576a488
20 changed files with 172 additions and 77 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,4 +4,6 @@ config.yml
|
||||||
src/modules/exploits.js
|
src/modules/exploits.js
|
||||||
logs/*
|
logs/*
|
||||||
src/data/filter.json
|
src/data/filter.json
|
||||||
|
data/filter.json
|
||||||
prototyping-crap
|
prototyping-crap
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ module.exports = {
|
||||||
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`)
|
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`)
|
||||||
} else if (!bot.console.customChat.enabled) {
|
} else if (!bot.console.customChat.enabled) {
|
||||||
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`)
|
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`)
|
||||||
|
// bot.chat.message(`${config.prefixes[0]}${args.slice(2)} ${args.slice(3).shift()}${bot.validation.trusted}`)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case "admin":
|
case "admin":
|
||||||
|
@ -67,7 +68,7 @@ module.exports = {
|
||||||
if (bot.console.customChat.enabled) {
|
if (bot.console.customChat.enabled) {
|
||||||
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(' ')}`)
|
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(' ')}`)
|
||||||
} else if (!bot.console.customChat.enabled) {
|
} else if (!bot.console.customChat.enabled) {
|
||||||
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(' ')}`)
|
// bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.admin} ${args.slice(3).join(' ')}`)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case "trusted":
|
case "trusted":
|
||||||
|
|
|
@ -22,37 +22,23 @@ module.exports = {
|
||||||
const args = context.arguments;
|
const args = context.arguments;
|
||||||
const config = context.config;
|
const config = context.config;
|
||||||
let component = [];
|
let component = [];
|
||||||
|
if (bot.options.isCreayun || bot.options.isSavage) throw new CommandError('this command is meant for kaboom.pw and its clones')
|
||||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4]) return
|
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4]) return
|
||||||
switch (args[1]?.toLowerCase()) {
|
switch (args[1]?.toLowerCase()) {
|
||||||
case 'list':
|
case 'list':
|
||||||
// bot.tellraw(`@a`, JSON.stringify(bot.filter.list().length));
|
// bot.tellraw(`@a`, JSON.stringify(bot.filter.list().length));
|
||||||
if (bot.filter.list().length === 0) {
|
if (bot.filter.list().length === 0) {
|
||||||
component.push({
|
component.push({
|
||||||
translate: '%s%s %s%s%s',
|
translate: '%s: (%s)',
|
||||||
color: 'blue',
|
color: 'dark_gray',
|
||||||
with: [
|
with: [
|
||||||
{ text: 'Players', color: 'dark_blue' },
|
{ text: 'Players', color: 'dark_blue' },
|
||||||
{ text: ':', color: 'dark_blue' },
|
|
||||||
{ text: '(', color: 'blue' },
|
|
||||||
{ text: JSON.stringify(bot.filter.list().length), color: 'gold' },
|
{ text: JSON.stringify(bot.filter.list().length), color: 'gold' },
|
||||||
{ text: ')', color: 'blue' },
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
let listComponent = []
|
let listComponent = []
|
||||||
/*component.push({
|
|
||||||
translate: '%s%s %s%s%s\n %s',
|
|
||||||
color: 'blue',
|
|
||||||
with: [
|
|
||||||
{ text: 'Players', color: 'dark_blue' },
|
|
||||||
{ text: ':', color: 'dark_blue' },
|
|
||||||
{ text: '(', color: 'blue' },
|
|
||||||
{ text: JSON.stringify(bot.filter.list().length), color: 'gold' },
|
|
||||||
{ text: ')', color: 'blue' },
|
|
||||||
|
|
||||||
]
|
|
||||||
})*/
|
|
||||||
for (const players of bot.filter.list()) {
|
for (const players of bot.filter.list()) {
|
||||||
listComponent.push({
|
listComponent.push({
|
||||||
translate: '%s \u203a %s',
|
translate: '%s \u203a %s',
|
||||||
|
@ -69,14 +55,18 @@ module.exports = {
|
||||||
listComponent.pop()
|
listComponent.pop()
|
||||||
|
|
||||||
component.push({
|
component.push({
|
||||||
translate: 'Players (%s):',
|
translate: '%s: (%s)',
|
||||||
color: 'dark_blue',
|
color: 'dark_gray',
|
||||||
with: [ { text: `${bot.filter.list().length}`, color: 'gold' } ]
|
with: [
|
||||||
|
{ text: 'Players', color: 'dark_blue' },
|
||||||
|
{ text: `${bot.filter.list().length}`, color: 'gold' }
|
||||||
|
]
|
||||||
})
|
})
|
||||||
component.push('\n')
|
component.push('\n')
|
||||||
component.push(listComponent)
|
component.push(listComponent)
|
||||||
bot.tellraw("@a", component)
|
// bot.tellraw("@a", component)
|
||||||
}
|
}
|
||||||
|
bot.tellraw("@a", component)
|
||||||
break;
|
break;
|
||||||
case "--regex":
|
case "--regex":
|
||||||
case "-r":
|
case "-r":
|
||||||
|
|
|
@ -111,11 +111,19 @@ module.exports = {
|
||||||
commandComponent.push("\n");
|
commandComponent.push("\n");
|
||||||
commandComponent.push(usagesComponent);
|
commandComponent.push(usagesComponent);
|
||||||
for (const aliases of command.aliases) {
|
for (const aliases of command.aliases) {
|
||||||
if (args[0] === command.name) {
|
if (args[0]?.toLowerCase() === command.name) {
|
||||||
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, commandComponent)
|
if (bot.options.isSavage) {
|
||||||
|
bot.chat.message(`${bot.getMessageAsPrismarine(commandComponent)?.toMotd().replaceAll('§','&')}`);
|
||||||
|
} else {
|
||||||
|
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, commandComponent)
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} if (args[0] === aliases) {
|
} if (args[0]?.toLowerCase() === aliases) {
|
||||||
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, commandComponent)
|
if (bot.options.isSavage) {
|
||||||
|
bot.chat.message(`${bot.getMessageAsPrismarine(commandComponent)?.toMotd().replaceAll('§','&')}`)
|
||||||
|
} else {
|
||||||
|
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, commandComponent)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,7 +270,7 @@ module.exports = {
|
||||||
color: "light_purple"
|
color: "light_purple"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "aaa - FBot, SnifferBot, Xbot\n",
|
text: "aaa - FBot, SnifferBot, Xbot, Hydra\n",
|
||||||
color: "gold",
|
color: "gold",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,8 +15,8 @@ module.exports = {
|
||||||
const component = []
|
const component = []
|
||||||
for (const player of players) {
|
for (const player of players) {
|
||||||
component.push({
|
component.push({
|
||||||
translate: `%s \u203a %s [%s %s %s %s %s]`,
|
translate: `%s \u203a %s [%s: %s %s %s: %s]`,
|
||||||
color: 'blue',
|
color: 'dark_gray',
|
||||||
with: [
|
with: [
|
||||||
player.displayName ?? player.profile.name,
|
player.displayName ?? player.profile.name,
|
||||||
{
|
{
|
||||||
|
@ -34,10 +34,10 @@ module.exports = {
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ text: `Ping:`, color: 'dark_blue' },
|
{ text: `Ping`, color: 'dark_blue' },
|
||||||
{ text: `${player.latency}`, color: 'gold' },
|
{ text: `${player.latency}`, color: 'gold' },
|
||||||
{ text: '/', color: 'dark_aqua' },
|
{ text: '/', color: 'dark_gray' },
|
||||||
{ text: `Gamemode:`, color: 'dark_blue' },
|
{ text: `Gamemode`, color: 'dark_blue' },
|
||||||
{ text: `${player.gamemode}`, color: 'gold' },
|
{ text: `${player.gamemode}`, color: 'gold' },
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -53,10 +53,11 @@ module.exports = {
|
||||||
}, 300)
|
}, 300)
|
||||||
} else if (bot.options.isKaboom) {
|
} else if (bot.options.isKaboom) {
|
||||||
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
|
bot.tellraw(`@a[name="${source.player.profile.name}"]`, [
|
||||||
{ text: `Players: `, color:'gray' },
|
{ text: `Players`, color: 'dark_blue' },
|
||||||
{ text: '(' , color: 'gray' },
|
{ text: ': ', color: 'dark_gray' },
|
||||||
|
{ text: '(' , color: 'dark_gray' },
|
||||||
{ text: `${JSON.stringify(bot.players.length)}`, color: 'gold' },
|
{ text: `${JSON.stringify(bot.players.length)}`, color: 'gold' },
|
||||||
{ text: ')\n', color: 'gray' },
|
{ text: ')\n', color: 'dark_gray' },
|
||||||
component
|
component
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,32 @@ module.exports = {
|
||||||
const discordClient = context.discordClient;
|
const discordClient = context.discordClient;
|
||||||
const args = context.arguments;
|
const args = context.arguments;
|
||||||
const source = context.source;
|
const source = context.source;
|
||||||
|
let component = [];
|
||||||
try {
|
try {
|
||||||
const [host, port] = args[0].split(':')
|
const [host, port] = args[0].split(':')
|
||||||
const server = await mc.ping({ host, port: Number(port ?? 25565) })
|
const server = await mc.ping({ host, port: Number(port ?? 25565) })
|
||||||
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
|
component.push({
|
||||||
|
translate: '%s %s %s:%s\n%s %s %s / %s\n%s %s %s\n%s %s %s',
|
||||||
|
color: 'dark_gray',
|
||||||
|
with: [
|
||||||
|
{ text: 'Ip', color: 'dark_blue' },
|
||||||
|
{ text: '\u203a' },
|
||||||
|
{ text: `${host}`, color: 'dark_blue' },
|
||||||
|
{ text: `${Number(port ?? 25565)}`, color: 'gold' },
|
||||||
|
{ text: 'Players', color: 'dark_blue' },
|
||||||
|
{ text: '\u203a' },
|
||||||
|
{ text: `${server.players.online}`, color: 'gold' },
|
||||||
|
{ text: `${server.players.max}`, color: 'gold' },
|
||||||
|
{ text: 'Version', color: 'dark_blue' },
|
||||||
|
{ text: '\u203a' },
|
||||||
|
{ text: `${server.version.name}`, color: 'blue' },
|
||||||
|
{ text: 'Motd', color: 'dark_blue' },
|
||||||
|
{ text: '\u203a' },
|
||||||
|
server.description
|
||||||
|
]
|
||||||
|
})
|
||||||
|
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, component);
|
||||||
|
/* bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
|
||||||
{
|
{
|
||||||
text: `Ip \u203a ${host}:${Number(port ?? 25565)}\n`,
|
text: `Ip \u203a ${host}:${Number(port ?? 25565)}\n`,
|
||||||
color: 'gray',
|
color: 'gray',
|
||||||
|
@ -62,7 +84,7 @@ module.exports = {
|
||||||
color: 'gray',
|
color: 'gray',
|
||||||
},
|
},
|
||||||
server.description,
|
server.description,
|
||||||
])
|
])*/
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
bot.chat.message(`${e.toString()}`)
|
bot.chat.message(`${e.toString()}`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const CommandError = require('../util/command_error.js')
|
const CommandError = require('../util/command_error.js')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'netmsg',
|
name: 'netmsg',
|
||||||
trustLevel: 1,
|
trustLevel: 0,
|
||||||
aliases: [
|
aliases: [
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
|
@ -14,11 +14,11 @@ module.exports = {
|
||||||
// if (!source.player) return
|
// if (!source.player) return
|
||||||
if (bot.options.isKaboom) {
|
if (bot.options.isKaboom) {
|
||||||
x = between(-30_000_000, 30_000_000)
|
x = between(-30_000_000, 30_000_000)
|
||||||
y = between(-30_000_000, 30_000_000)
|
y = 100
|
||||||
z = between(-30_000_000, 30_000_000)
|
z = between(-30_000_000, 30_000_000)
|
||||||
} else if (bot.options.isSavage) {
|
} else if (bot.options.isSavage) {
|
||||||
x = between(-4096, 4096);
|
x = between(-4096, 4096);
|
||||||
y = between(-4096, 4096);
|
y = 100
|
||||||
z = between(-4096, 4096);
|
z = between(-4096, 4096);
|
||||||
}
|
}
|
||||||
// bot.tellraw("@a", `Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
// bot.tellraw("@a", `Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||||
|
|
|
@ -13,20 +13,6 @@ module.exports = {
|
||||||
const bot = context.bot;
|
const bot = context.bot;
|
||||||
const args = context.arguments;
|
const args = context.arguments;
|
||||||
const source = context.source;
|
const source = context.source;
|
||||||
/* if (args[0] === bot.validation.trusted) {
|
|
||||||
if (bot.options.isSavage) {
|
|
||||||
bot.chat.message('&2Valid Trusted hash');
|
|
||||||
} else {
|
|
||||||
bot.tellraw(`@a`, { text: "Valid Trusted hash", color: "dark_green" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (args[0] === bot.validation.owner) {
|
|
||||||
if (bot.options.isSavage) {
|
|
||||||
bot.chat.message("&2Valid Owner hash");
|
|
||||||
} else {
|
|
||||||
bot.tellraw(`@a`, { text: "Valid Owner hash", color: "dark_green" });
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
if (args[0] === bot.validation.trusted) {
|
if (args[0] === bot.validation.trusted) {
|
||||||
bot.chat.message('&2Valid Trusted hash');
|
bot.chat.message('&2Valid Trusted hash');
|
||||||
}
|
}
|
||||||
|
@ -42,7 +28,6 @@ module.exports = {
|
||||||
const event = bot?.discord?.message
|
const event = bot?.discord?.message
|
||||||
const roles = event?.member?.roles?.cache
|
const roles = event?.member?.roles?.cache
|
||||||
const source = context.source;
|
const source = context.source;
|
||||||
console.log(Object.keys(bot.discord.message.member.user.username));
|
|
||||||
if (roles?.some(role => role.name === `${config.discord.roles.trusted}`)) {
|
if (roles?.some(role => role.name === `${config.discord.roles.trusted}`)) {
|
||||||
bot.discord.message.reply('Valid trusted user')
|
bot.discord.message.reply('Valid trusted user')
|
||||||
bot.chat.message(`Valid trusted user [${bot.discord.message.member.user.username}]`)
|
bot.chat.message(`Valid trusted user [${bot.discord.message.member.user.username}]`)
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# FNFBoyfriendBot v6.0.0-alpha config
|
|
||||||
|
|
||||||
prefixes:
|
prefixes:
|
||||||
- "!"
|
- "!"
|
||||||
- "fnfbfbot!"
|
- "fnfbfbot!"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
[{"ignoreCase":false,"regexed":false,"name":"e"},{"ignoreCase":false,"regexed":false,"name":"sladkjf"},{"ignoreCase":true,"regexed":true,"name":"amogus"}]
|
[]
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"bot": {
|
"bot": {
|
||||||
"buildstring": {
|
"buildstring": {
|
||||||
"version": "v6.0.4",
|
"version": "v6.0.5",
|
||||||
"build":"1035",
|
"build":"1050",
|
||||||
"codename":""
|
"codename":""
|
||||||
},
|
},
|
||||||
"source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/"
|
"source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/"
|
||||||
|
|
|
@ -67,7 +67,7 @@ function core (bot, options, config) {
|
||||||
const location = bot.core.currentBlock()
|
const location = bot.core.currentBlock()
|
||||||
if (!location) return
|
if (!location) return
|
||||||
if (bot.options.isSavage || bot.options.isCreayun || bot.options.useChat) {
|
if (bot.options.isSavage || bot.options.isCreayun || bot.options.useChat) {
|
||||||
bot.chat.command(`${command?.substring(0, 256)}`)
|
return
|
||||||
} else {
|
} else {
|
||||||
bot._client.write('update_command_block', { command: command.substring(0, 32767), location, mode: 1, flags: 0b100 })
|
bot._client.write('update_command_block', { command: command.substring(0, 32767), location, mode: 1, flags: 0b100 })
|
||||||
bot.core.incrementCurrentBlock()
|
bot.core.incrementCurrentBlock()
|
||||||
|
|
|
@ -58,7 +58,7 @@ function command_manager (bot, options, config, discordClient) {
|
||||||
const event = bot.discord.message;
|
const event = bot.discord.message;
|
||||||
const roles = event?.member?.roles?.cache;
|
const roles = event?.member?.roles?.cache;
|
||||||
if (command?.trustLevel === 1 && !source?.sources?.discord) {
|
if (command?.trustLevel === 1 && !source?.sources?.discord) {
|
||||||
const hash = args[0]
|
// const hash = args[0]
|
||||||
if (args.length === 0 && bot.validation.trusted && bot.validation.admin && bot.validation.owner && !source?.sources?.console) throw new CommandError({ text: "Please provide an trusted or an admin or an owner hash" })
|
if (args.length === 0 && bot.validation.trusted && bot.validation.admin && bot.validation.owner && !source?.sources?.console) throw new CommandError({ text: "Please provide an trusted or an admin or an owner hash" })
|
||||||
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or admin or owner hash', color: 'dark_red' })
|
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.admin && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or admin or owner hash', color: 'dark_red' })
|
||||||
} else if (command?.trustLevel === 1 && source?.sources.discord) {
|
} else if (command?.trustLevel === 1 && source?.sources.discord) {
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
//const json = require('../data/filter.json');
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
//const json = fs.readFileSync(path.join(__dirname, '../data/filter.json'));
|
|
||||||
function filter (bot, options, config, discordClient) {
|
function filter (bot, options, config, discordClient) {
|
||||||
if (options.isSavage || options.isCreayun) return;
|
if (options.isSavage || options.isCreayun) return;
|
||||||
|
// filter v5 (not to be confused with the bot version)
|
||||||
bot.filter = {
|
bot.filter = {
|
||||||
list () {
|
list () {
|
||||||
try {
|
try {
|
||||||
|
@ -12,33 +11,117 @@ function filter (bot, options, config, discordClient) {
|
||||||
console.log(e.stack)
|
console.log(e.stack)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
add (ignoreCase, regexed, player) {
|
add (ignoreCase, regexed, player) {
|
||||||
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
|
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
|
||||||
var arrayadd = { ignoreCase: ignoreCase, regexed: regexed, name: player }
|
var arrayadd = { ignoreCase: ignoreCase, regexed: regexed, name: player }
|
||||||
data.push(arrayadd);
|
data.push(arrayadd);
|
||||||
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data))
|
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data))
|
||||||
|
this.doAll();
|
||||||
},
|
},
|
||||||
|
|
||||||
remove (index) {
|
remove (index) {
|
||||||
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
|
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
|
||||||
data.splice(index, 1);
|
data.splice(index, 1);
|
||||||
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data));
|
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data));
|
||||||
},
|
},
|
||||||
|
|
||||||
clear () {
|
clear () {
|
||||||
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
|
var data = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')));
|
||||||
data = [];
|
data = [];
|
||||||
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data))
|
fs.writeFileSync(path.join(__dirname, '../data/filter.json'), JSON.stringify(data))
|
||||||
},
|
},
|
||||||
gamemodeCheck () {
|
|
||||||
|
|
||||||
},
|
|
||||||
joinMsg () {
|
|
||||||
|
|
||||||
},
|
|
||||||
check () {
|
|
||||||
|
|
||||||
|
doAll () {
|
||||||
|
for (const filteredPlayers of JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')))) {
|
||||||
|
if (filteredPlayers.ignoreCase) {
|
||||||
|
check = bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayers.name.toLowerCase())
|
||||||
|
} else if (filteredPlayers.regexed) {
|
||||||
|
let regex = new RegExp(filteredPlayers.name);
|
||||||
|
check = bot.players.find((players) => regex.test(players.profile.name))
|
||||||
|
} else if (filteredPlayers.ignoreCase && filteredPlayers.regexed) {
|
||||||
|
let regex = new RegExp(filteredPlayers.name.toLowerCase());
|
||||||
|
check = bot.players.find((players) => regex.test(players.profile.name.toLowerCase()))
|
||||||
|
} else {
|
||||||
|
check = bot.players.find((players) => players.profile.name === filteredPlayers.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!check) return;
|
||||||
|
bot.core.run(`execute run gamemode adventure @a[name="${check?.profile?.name}"]`)
|
||||||
|
bot.core.run(`execute run deop @a[name="${check?.profile?.name}"]`);
|
||||||
|
bot.core.run(`essentials:mute ${check?.uuid} 10y`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bot.on('message', (message) => {
|
||||||
|
try {
|
||||||
|
const stringMessage = bot.getMessageAsPrismarine(message)?.toString()
|
||||||
|
for (const filteredPlayers of JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')))) {
|
||||||
|
if (filteredPlayers.ignoreCase) {
|
||||||
|
if (!bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayers.name.toLowerCase())) return;
|
||||||
|
else if (bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayers.name.toLowerCase()).gamemode !== 2) {
|
||||||
|
bot.core.run(`execute run gamemode adventure @a[name="${bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayers.name.toLowerCase()).profile.name}"]`);
|
||||||
|
} else if (stringMessage.includes('op')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
bot.core.run(`execute run deop @a[name="${bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayers.name.toLowerCase()).profile.name}"]`)
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
} else if (filteredPlayers.regexed) {
|
||||||
|
let regex = new RegExp(filteredPlayers.name);
|
||||||
|
if (!bot.players.find((players) => regex.test(players.profile.name))) return;
|
||||||
|
else if (bot.players.find((players) => regex.test(players.profile.name)).gamemode !== 2) {
|
||||||
|
bot.core.run(`execute run gamemode adventure @a[name="${bot.players.find((players) => regex.test(players.profile.name)).profile.name}"]`);
|
||||||
|
} else if (stringMessage.includes('op')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
bot.core.run(`execute run deop @a[name="${bot.players.find((players) => regex.test(players.profile.name)).profile.name}"]`);
|
||||||
|
}, 10)
|
||||||
|
}
|
||||||
|
} else if (filteredPlayers.ignoreCase && filteredPlayers.regexed) {
|
||||||
|
let regex = new RegExp(filteredPlayers.name.toLowerCase());
|
||||||
|
if (!bot.players.find((players) => regex.test(players.profile.name.toLowerCase()))) return;
|
||||||
|
else if (bot.players.find((players) => regex.test(players.profile.name.toLowerCase())).gamemode !== 2) {
|
||||||
|
bot.core.run(`execute run gamemode adventure @a[name="${bot.players.find((players) => regex.test(players.profile.name.toLowerCase())).profile.name}"]`);
|
||||||
|
} else if (stringMessage.includes('op')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
bot.core.run(`execute run deop @a[name="${bot.players.find((players) => regex.test(players.profile.name.toLowerCase())).profile.name}"]`);
|
||||||
|
}, 10)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!bot.players.find((players) => players.profile.name === filteredPlayers.name)) return;
|
||||||
|
else if (bot.players.find((players) => players.profile.name === filteredPlayers.name).gamemode !== 2) {
|
||||||
|
bot.core.run(`execute run gamemode adventure @a[name="${bot.players.find((players) => players.profile.name === filteredPlayers.name).profile.name}"]`);
|
||||||
|
} else if (stringMessage.includes('op')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
bot.core.run(`execute run deop @a[name="${bot.players.find((players) => players.profile.name === filteredPlayers.name).profile.name}"]`);
|
||||||
|
}, 10)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
bot.console.warn(e.stack);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
bot.on('parsed_message', (message) => {
|
||||||
|
const stringMessage = bot.getMessageAsPrismarine(message)?.toString();
|
||||||
|
for (const filteredPlayers of JSON.parse(fs.readFileSync(path.join(__dirname, '../data/filter.json')))) {
|
||||||
|
if (filteredPlayers.ignoreCase) {
|
||||||
|
check = bot.players.find((players) => players.profile.name.toLowerCase() === filteredPlayers.name.toLowerCase())
|
||||||
|
} else if (filteredPlayers.regexed) {
|
||||||
|
let regex = new RegExp(filteredPlayers.name);
|
||||||
|
check = bot.players.find((players) => regex.test(players.profile.name))
|
||||||
|
} else if (filteredPlayers.ignoreCase && filteredPlayers.regexed) {
|
||||||
|
let regex = new RegExp(filteredPlayers.name.toLowerCase());
|
||||||
|
check = bot.players.find((players) => regex.test(players.profile.name.toLowerCase()))
|
||||||
|
} else {
|
||||||
|
check = bot.players.find((players) => players.profile.name === filteredPlayers.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bot.filter.list().length === 0) return;
|
||||||
|
if (!check) return;
|
||||||
|
if (!bot.players) return;
|
||||||
|
if (message.sender.profile.name === check?.profile?.name) {
|
||||||
|
bot.core.run(`essentials:mute ${check?.uuid} 10y`);
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
module.exports = filter;
|
module.exports = filter;
|
||||||
// let e = new RegExp('Parker.*'); bot.players.find((a) => e.test(a.profile.name))
|
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ You already have registered this username!
|
||||||
else if (username) bot.chat.command(`username ${bot.options.username}`)
|
else if (username) bot.chat.command(`username ${bot.options.username}`)
|
||||||
else if (nickname) bot.chat.command(`nick off`)
|
else if (nickname) bot.chat.command(`nick off`)
|
||||||
else if (!prefix) bot.chat.command(`prefix &8[&bPrefix&8: &3${config.prefixes[0]}&8]`);
|
else if (!prefix) bot.chat.command(`prefix &8[&bPrefix&8: &3${config.prefixes[0]}&8]`);
|
||||||
else if (!vanished) bot.core.run(`vanish ${bot.options.username} on`);
|
else if (!vanished) bot.chat.command(`essentials:vanish on`);
|
||||||
else if (unmuted) bot.core.run(`essentials:mute ${bot.uuid}`);
|
else if (unmuted) bot.core.run(`essentials:mute ${bot.uuid}`);
|
||||||
else if (!god) bot.core.run(`god ${bot.options.username} enable`);
|
else if (!god) bot.core.run(`god ${bot.options.username} enable`);
|
||||||
else if (!teleportToggle) bot.core.run(`tptoggle ${bot.options.username} disable`);
|
else if (!teleportToggle) bot.core.run(`tptoggle ${bot.options.username} disable`);
|
||||||
|
|
7
src/output.txt
Normal file
7
src/output.txt
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
27 util/ChatParsers/ChipmunkMod.js
|
||||||
|
25 util/ChatParsers/Creayun.js
|
||||||
|
41 util/ChatParsers/Kaboom.js
|
||||||
|
23 util/ChatParsers/VanillaChat.js
|
||||||
|
26 util/ChatParsers/sayConsole.js
|
||||||
|
25 util/ChatParsers/yfdCustomChat.js
|
||||||
|
167 total
|
|
@ -17,7 +17,7 @@ function creayun (messageobj, data) {
|
||||||
// console.log(data.players.find(player => player.profile.name === match[2]))
|
// console.log(data.players.find(player => player.profile.name === match[2]))
|
||||||
sender = data.players.find(player => player.profile.name === match[2])
|
sender = data.players.find(player => player.profile.name === match[2])
|
||||||
// sender = data.players.find(player => util.isDeepStrictEqual(player.displayName, playerListDisplayName))
|
// sender = data.players.find(player => util.isDeepStrictEqual(player.displayName, playerListDisplayName))
|
||||||
if (!sender) return;
|
// if (!sender) return;
|
||||||
// console.log(sender)
|
// console.log(sender)
|
||||||
return { sender, contents: match[3], type: 'minecraft:chat'};
|
return { sender, contents: match[3], type: 'minecraft:chat'};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
function usernameGen (bot, config) {
|
function usernameGen (bot, config) {
|
||||||
// const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
// const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
||||||
const unicode = "▄".codePointAt(0).toString(16);
|
|
||||||
const unicodeGen = "\\u" + "0000".substring(0, 4 - unicode.length) + unicode;
|
|
||||||
if (bot.options.isSavage || bot.options.isCreayun && !bot.options.isKaboom) {
|
if (bot.options.isSavage || bot.options.isCreayun && !bot.options.isKaboom) {
|
||||||
characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue