Compare commits

...
10 Commits
25 changed files with 272 additions and 57 deletions
View File
+3 -2
View File
@@ -25,7 +25,8 @@ function createBot(options = {}, config) {
bot.username = client.username
})
client.on('disconnect', (data) => {
bot.emit("disconnect", JSON.stringify(data.reason))
bot.emit("disconnect", data)
// bot.console.info(JSON.stringify(data))
// bot?.discord?.channel?.send(util.inspect(data.reason))
if (config.console.filelogger) {
// bot?.console?.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ` + '[Client Reconnect] ' + util.inspect(data.reason))
@@ -49,7 +50,7 @@ function createBot(options = {}, config) {
client.on('kick_disconnect', (data) => {
bot.emit("kick_disconnect", data.reason)
bot.console?.warn(ChatMessage.fromNotch('§8[§bClient Reconnect§8]§r ')?.toAnsi() + util.inspect(data.reason))
bot.console?.warn(ChatMessage.fromNotch(`§8[§bClient Reconnect§8]§r `)?.toAnsi() + util.inspect(data.reason))
bot?.discord?.channel?.send(util.inspect(data.reason))
if (config.console.filelogger) {
// bot?.console?.filelogging(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ` + '[Client Reconnect] ' + util.inspect(data.reason))
+1 -1
View File
@@ -75,7 +75,7 @@ module.exports = {
if (bot.console.customChat.enabled) {
bot.console.customChat.chat(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.owner} ${args.slice(3).join(' ')}`);
} else if (!bot.console.customChat.enabled) {
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(' ')}`)
bot.chat.message(`${config.prefixes[0]}${args.slice(2).shift()} ${bot.validation.trusted} ${args.slice(3).join(' ')}`);
}
break
default:
+1 -1
View File
@@ -15,7 +15,7 @@ module.exports = {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (args[0] === "list") {
if (args[0]?.toLowerCase() === "list") {
const list = Object.keys(cows);
let content = [];
let color = true;
+13 -2
View File
@@ -40,7 +40,18 @@ module.exports = {
const source = context.source;
switch (args[0]?.toLowerCase()) {
case 'version':
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}-${botInfo.bot.buildstring.codename}\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`);
if (botInfo.bot.buildstring.codename === '') {
if (bot.options.isSavage) {
bot.chat.message(`&9Friday &9Night &9Funkin &3Boyfriend &1Bot&8&r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}`)
setTimeout(() => {
bot.chat.message(`11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`)
}, 300)
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`);
}
} else {
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, `§9Friday §9Night §9Funkin §3Boyfriend §1Bot§8§r-${botInfo.bot.buildstring.version}-#${botInfo.bot.buildstring.build}-${botInfo.bot.buildstring.codename}\n11/22/22 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO" })}`);
}
break
case 'config':
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
@@ -275,7 +286,7 @@ module.exports = {
case "about":
bot.tellraw(`@a[name="${source?.player?.profile?.name}"]`, [
{
text: `FNFBoyfriendBot is a open source kaboom bot created by Parker2991\nThe source can be found here ${botInfo.bot.source}`,
text: `FNFBoyfriendBot is a open source kaboom bot created by Parker2991\nThe source code and changelog can be found here ${botInfo.bot.source}`,
color: "gray",
translate: "",
hoverEvent: {
+1 -1
View File
@@ -35,7 +35,7 @@ module.exports = {
}
}
bot.bots.filter((eachBot) => {
if (eachBot.options.serverName === "Savage Friends" && eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {
if (eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom || eachBot.options.isCreayun && !eachBot.options.isSavage && !eachBot.options.useChat && !eachBot.options.isKaboom) {
eachBot.chat.message(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(source.player.displayName ?? source.player.profile.name)?.toMotd().replaceAll('§','&')} \u203a ${args.join(' ')}`)
} else if (!eachBot.options.serverName !== "Savage Friends" && !eachBot.options.isSavage && !eachBot.options.useChat && eachBot.options.isKaboom) {
eachBot.tellraw("@a", component);
+4 -4
View File
@@ -5,7 +5,7 @@ const fixansi = require('../util/ansi');
const CommandError = require('../util/command_error')
module.exports = {
name: 'website',
trustLevel: 4,
trustLevel: 1,
aliases: [
],
description: 'look up website data',
@@ -15,8 +15,8 @@ module.exports = {
execute (context) {
const bot = context.bot
const args = context.arguments;
if (args.join(' ').toLowerCase().startsWith("http://")) {
http.get(args.join(' '), (res) => {
if (args.slice(1).join(' ').toLowerCase().startsWith("http://")) {
http.get(args.slice(1).join(' '), (res) => {
const { statusCode } = res;
const contentType = res.headers['content-type'];
res.setEncoding('utf8');
@@ -33,7 +33,7 @@ module.exports = {
bot.chat.message(`&4${e.toString()}`);
});
} else {
https.get(args.join(' '), (res) => {
https.get(args.slice(1).join(' '), (res) => {
res.on('data', (d) => {
bot.tellraw("@a", { text: util.inspect(d.toString().substring(0, 32750)), color: "dark_green", })
// console.log(Object.keys(d.toString().length));
+19
View File
@@ -30,6 +30,25 @@
"+"
]
},
{
"name": [
{
"text": "Hydra",
"color": "dark_red"
}
],
"authors": [
"popbob/aaa"
],
"exclaimer": "",
"foundation": "nodejs/node-minecraft-protocol",
"prefixes": [
"+",
"$",
"h:",
"hydra:"
]
},
{
"name": [
{
+2
View File
@@ -25,6 +25,8 @@ core:
y: 0
z: 15
commandSetMessage: true
keys:
trusted: "trusted key here"
admin: "admin key here"
+1
View File
@@ -0,0 +1 @@
[]
+2 -2
View File
@@ -1,8 +1,8 @@
{
"bot": {
"buildstring": {
"version": "v6.0.1",
"build":"990",
"version": "v6.0.3",
"build":"1025",
"codename":""
},
"source": "https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot/"
View File
+1
View File
@@ -1,6 +1,7 @@
const readline = require('readline');
function boot (bot, options, discordClient, config) {
bot.on("packet.login", (data) => {
if (bot.options.isCreayun) return
if (new Date().getDay() === 5) {
bot.chat.message('Gettin\' freaky on a friday night!');
} else {
+10 -1
View File
@@ -18,7 +18,7 @@ function chat (bot, options, config) {
bot.on('registry_ready', registry => {
ChatMessage = loadPrismarineChat(registry)
})
if (options.isSavage) {
if (options.isSavage || options.isCreayun) {
bot.chatParsers = [CreayunChatParser, sayConsoleChatParser]
} else {
bot.chatParsers = [KaboomChatParser, ChipmunkModChatParser, VanillaChatParser, sayConsoleChatParser, yfdCustomChatParser]
@@ -58,6 +58,12 @@ function chat (bot, options, config) {
case 5:
bot.emit('message', { translate: "chat.type.announcement", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ]})
break
case 3:
bot.emit('message', { translate: "commands.message.display.outgoing", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ], color: "gray", italic: true })
break
case 2:
bot.emit('message', { translate: "commands.message.display.incoming", with: [ bot.players.find(player => player.uuid === packet.senderUuid).profile.name, packet.plainMessage ], color: "gray", italic: true })
break
default:
bot.emit('message', unsigned)
}
@@ -129,5 +135,8 @@ function chat (bot, options, config) {
})
}
}
bot.tellraw = (selector, message) => {
bot.core.run(`minecraft:tellraw ${selector} ` + JSON.stringify(message))
}
}
module.exports = chat;
+11 -4
View File
@@ -11,9 +11,16 @@ function core (bot, options, config) {
const { start, end } = bot.core.area
if (!pos) return
if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return
// if (isNaN(pos.x + start.x)) bot.chat.command('world 3');
// console.log(isNaN(pos.x + start.x))
if (bot.options.useChat || bot.options.isCreayun || bot.options.isSavage) return
if (isNaN(pos.x + start.x)) {
bot.chat.command('spawn');
return
}
/*^^^
for checking is the core pos is null and if so
it will not refill core until the pos is not NaN
instead of tping to a set cords cuz fuck you im not doing that
*/
bot.chat.command(`minecraft:fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName:'${JSON.stringify(config.core.name)}'}`)
},
@@ -68,7 +75,7 @@ function core (bot, options, config) {
}
}
// if (bot.options.useChat ?? bot.options.isCreayun ?? bot.options.isSavage) return
if (bot.options.isSavage) return
if (bot.options.isSavage || bot.options.isCreayun) return
bot.on('move', () => {
// if (bot.options.isSavage) return
bot.core.move(bot.position)
+23 -11
View File
@@ -36,7 +36,7 @@ function command_manager (bot, options, config, discordClient) {
])
} else if (source?.sources?.console && !source?.sources?.discord) {
if (!command || !command.execute)
bot.console.warn(bot.getMessageAsPrismarine([
bot.console.warn([
{
translate: 'command.unknown.command',
color: "dark_red"
@@ -52,21 +52,20 @@ function command_manager (bot, options, config, discordClient) {
translate: "command.context.here",
color: "dark_red"
}
])?.toAnsi())
])
}
if (command?.trustLevel > 0) {
const event = bot.discord.message;
const roles = event?.member?.roles?.cache;
if (command?.trustLevel === 1 && !source?.sources?.discord) {
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 and 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' })
} else if (command?.trustLevel === 1 && source?.sources.discord) {
const hasRole = roles?.some(role => role.name === `${config.discord.roles.trusted}` || role.name === `${config.discord.roles.owner}`)
if (!hasRole) throw new CommandError({ translate: 'You are not trusted or the owner!' })
}
if (command?.trustLevel === 2 && !source.sources.console) {
// bot.chat.message('trust level 2 does nothing currently'); placeholder code
if (args.length === 0 && bot.validation.admin && bot.validation.owner && !source.sources.console) throw new CommandError({ text: "Please provide an trusted or owner hash" })
if (args[0] !== bot.validation.trusted && args[0] !== bot.validation.owner && !source.sources.console) throw new CommandError({ translate: 'Invalid trusted or owner hash', color: 'dark_red' })
}
@@ -79,13 +78,14 @@ function command_manager (bot, options, config, discordClient) {
} else if (command?.trustLevel === 4 && !source.sources.console) {
throw new CommandError('This command can only be ran via console');
}
} if (!command?.discordExecute && command && source.sources.discord) {
}
if (!command?.discordExecute && command && source?.sources?.discord) {
throw new CommandError(`${command.name} command is not supported in discord!`)
} else if (command?.discordExecute && command && source.sources.discord) {
} else if (command?.discordExecute && command && source?.sources?.discord) {
return command.discordExecute({ bot, source, arguments: args, config, discordClient })
} else if (!command?.execute && command && !source.sources.discord) {
} else if (!command?.execute && command && !source?.sources?.discord) {
throw new CommandError(`${command.name} command is not supported in game!`)
} else if (command?.execute && command && !source.sources.discord) {
} else if (command?.execute && command && !source?.sources?.discord) {
return command?.execute({ bot, source, arguments: args, config, discordClient})
}
} catch (error) {
@@ -101,9 +101,21 @@ function command_manager (bot, options, config, discordClient) {
]
})
} else if (!source?.sources?.discord && !source?.sources?.console) {
if (error instanceof CommandError)
bot.tellraw("@a", { text: error.message, color: "dark_red" })
else bot.tellraw("@a", [{ translate: 'command.failed', color: "dark_red", hoverEvent: { action: 'show_text', contents: `${error.stack}` } }])
if (error instanceof CommandError) {
if (bot.options.isSavage || bot.options.isCreayun) {
bot.chat.message(`&4${error.message}`)
} else {
bot.tellraw("@a", { text: error.message, color: "dark_red" })
}
} else {
if (bot.options.isSavage || bot.options.isCreayun) {
bot.chat.message(`${bot.getMessageAsPrismarine({ translate: "command.failed", color: "dark_red" })?.toMotd().replaceAll('§','&')}`)
} else {
bot.tellraw("@a", [{ translate: 'command.failed', color: "dark_red", hoverEvent: { action: 'show_text', contents: `${error.stack}` } }])
}
}
// else bot.tellraw("@a", [{ translate: 'command.failed', color: "dark_red", hoverEvent: { action: 'show_text', contents: `${error.stack}` } }])
//}
}
}
},
+10 -2
View File
@@ -1,6 +1,7 @@
const CommandSource = require('../util/command_source');
const prismarineChat = require('prismarine-chat')('1.20.2');
function Console (bot, options, config) {
let rateLimit = 0;
bot.console = {
readline: null,
server: 'all',
@@ -34,7 +35,7 @@ function Console (bot, options, config) {
this.refreshLine(bot.getMessageAsPrismarine(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} §4error§8] §8[${options.serverName}§8] `)?.toAnsi() + error)
},
info (message) {
this.refreshLine(bot.getMessageAsPrismarine(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} §2info§8] §8[${options.serverName}§8] `)?.toAnsi() + message)
this.refreshLine(prismarineChat.fromNotch(`§8[§1${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} §3${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} §2info§8] §8[${options.serverName}§8] `)?.toAnsi() + message)
},
customChat: {
enabled: false,
@@ -49,7 +50,7 @@ function Console (bot, options, config) {
},
{
selector: `${bot.username}`, color:'#00FFFF',
clickEvent: { action: 'suggest_command', value: '~help' }
clickEvent: { action: 'suggest_command', value: `${config.prefixes[0]}help` }
},
{
text: '',
@@ -66,7 +67,14 @@ function Console (bot, options, config) {
}
}
bot.on('message', (message) => {
rateLimit++
setTimeout(() => {
rateLimit--
}, 1000)
if (!options.logging) return;
/* if (rateLimit > 100) {
return
}*/
bot.console.log(bot.getMessageAsPrismarine(message)?.toAnsi());
bot.console.fileLogger(`[${new Date().toLocaleTimeString("en-US", { timeZone: "America/CHICAGO", })} ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })} logs] [${options.serverName}] ${bot.getMessageAsPrismarine(message)?.toString()}`);
})
+57
View File
@@ -0,0 +1,57 @@
const fs = require('fs');
const path = require('path');
const jsonData = fs.readFileSync(path.join(__dirname, '../data/filter.json'));
function filterFunction (bot, options, config) {
bot.filter = {
list () {
try {
return JSON.parse(jsonData);
} catch (e) {
bot.chat.message(`&4${e.toString()}`);
}
},
add (player) {
try {
const filterList = JSON.parse(jsonData);
const addData = {
ignoreCase: false,
name: player
}
filterList.push(addData);
const data = JSON.stringify(filterList);
fs.writeFile(jsonData, data, (err) => {
if (err) throw err;
})
console.log(data);
} catch (e) {
bot.chat.message(`${e.toString()}`);
}
},
ignoreCase (player) {
try {
const filterList = JSON.parse(jsonData);
const addData = {
ignoreCase: true,
name: player
}
filterList.push(addData);
const data = JSON.stringify(filterList);
fs.writeFile(jsonData, data, (err) => {
if (err) throw err;
})
console.log(data);
} catch (e) {
bot.chat.message(`${e.toString()}`);
}
},
clear () {
try {
// fs.rmSync(path.join(__dirname, '../data/filter.json'));
fs.writeFileSync(jsonData, JSON.stringify([]));
} catch (e) {
bot.chat.message(`${e.toString()}`)
}
}
}
}
module.exports = filterFunction;
+16 -6
View File
@@ -18,11 +18,20 @@ function player_list (bot, options, config) {
}
})
bot.on('packet.player_remove', ({ players }) => {
// TODO: Add player removal (with validation)
for (const player of players) {
bot.players = bot.players.filter(entry => entry.uuid !== player)
}
bot.on('packet.player_remove', async ({players}) => { // players has uuids of the players
let player_completion = (await bot.tab_complete('scoreboard players add ')).filter(_ => _.tooltip == undefined) // exclude @a, @r, @s, @e, @p -aaa
bot.players.forEach(async player => {
if(!players.includes(player.uuid)) return
const a = player_completion.filter(_ => _.match == player.profile.name)
if(a.length >= 1) {
player.vanished = true
} else {
bot.players = bot.players.filter(_ => _.uuid != player.uuid)
}
})
})
function addPlayer (entry) {
@@ -35,7 +44,8 @@ function player_list (bot, options, config) {
gamemode: undefined,
listed: undefined,
latency: undefined,
displayName: undefined
displayName: undefined,
vanished: false
})
}
+3 -1
View File
@@ -58,8 +58,10 @@ function selfcare (bot, options, config) {
gameMode = packet.gameMode;
clientLock = packet.gameMode;
timer = setInterval(() => {
if (bot.options.isSavage && !bot.options.isKaboom) {
if (bot.options.isSavage && !bot.options.isKaboom && !bot.options.isCreayun) {
if (clientLock !== 4) bot._client.write("client_command", { actionId: 0 });
} else if (bot.options.isCreayun && !bot.options.isKaboom && !bot.options.isSavage) {
} else if (bot.options.isKaboom && !bot.options.isSavage) {
if (permissionLevel < 2) bot.chat.command('op @s[type=player]');
else if (gameMode !== 1) bot.chat.command('minecraft:gamemode creative');
+18
View File
@@ -0,0 +1,18 @@
module.exports = (bot) => {
// let aaa cook
bot.tab_complete = (str) => {
return new Promise((resolve) => {
bot._client.write('tab_complete', {
text: str, assumeCommand: false, sendBlockInSight: false
})
const tab_completeH = (packet) => {
bot._client.removeListener('tab_complete', tab_completeH)
resolve(packet.matches)
}
bot._client.once('tab_complete', tab_completeH)
})
}
}
+16 -16
View File
@@ -1,27 +1,27 @@
function ChipmunkMod (message, data, context, bot) {
try {
if (message === null || typeof message !== 'object') return
if (message.with?.length < 3 || (message.translate !== '[%s] %s › %s' && message.translate !== '%s %s › %s')) return
if (message === null || typeof message !== 'object') return
if (message.with?.length < 3 || (message.translate !== '[%s] %s › %s' && message.translate !== '%s %s › %s')) return
const senderComponent = message.with[1]
const contents = message.with[2]
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
const senderComponent = message.with[1]
const contents = message.with[2]
let sender
const hoverEvent = senderComponent.hoverEvent
if (hoverEvent?.action === 'show_entity') {
const id = hoverEvent.contents.id
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.uuid === id)
} else {
const stringUsername = data.getMessageAsPrismarine(senderComponent).toString() // TypeError: data.getMessageAsPrismarine is not a function
sender = data.players.find(player => player.profile.name === stringUsername)
}
sender = data.players.find(player => player.profile.name === stringUsername)
}
if (!sender) return null
if (!sender) return null;
return { sender, contents, type: 'minecraft:chat', senderComponent }
return { sender, contents, type: 'minecraft:chat', senderComponent }
} catch(e) {
console.error(e)
console.error(e)
}
}
module.exports = ChipmunkMod
+5 -3
View File
@@ -1,14 +1,16 @@
const ChatMessage = require('prismarine-chat')('1.20.2');
const util = require('util');
function creayun (messageobj, data) {
let match;
let sender;
const stringify = message => new ChatMessage(message).toString()
const message = stringify(messageobj);
const playerWithPrefix = /^(.*?) (\S*?) » (.*?)$/;
const playerWithoutPrefix = /^(\S*?) » (.*?)$/
if (playerWithPrefix.test(message)) {
let match = message.match(playerWithPrefix)
const sender = data.players.find((player) => player.uuid === player.uuid)
if (!sender) return undefined
match = message.match(playerWithPrefix)
sender = data.players.find(player => player.profile.name === match[2])
if (!sender) return;
return { sender, contents: match[3], type: 'minecraft:chat'};
}
}
+55
View File
@@ -9,6 +9,61 @@ function ansi (message) {
"\x1B\[92m": "\x1B\[32m", // Green
"\x1B\[0m": "\x1B\[0m\x1B\[37m", // White
"\x1B\[97m": "\x1B\[0m\x1B\[37m", // White
"\x1B\[30m": "\x1B[30m", // black
"\x1B\[35m": "\x1B[35m", // purple
'\x1B[3m': "\x1B[23m", // italic
'\x1B[4m': "\x1B[24m", // underline
'\x1B[9m': "\x1B[29m", // strike through
'\x1B[6m': "\x1B[29m" // obfuscated
/*
Black 30 40
Red 31 41
Green 32 42
Yellow 33 43
Blue 34 44
Magenta 35 45
Cyan 36 46
White 37 47
Default 39 49
Reset 0 0
ESC[1;34;{...}m Set graphics modes for cell, separated by semicolon (;).
ESC[0m reset all modes (styles and colors)
ESC[1m ESC[22m set bold mode.
ESC[2m ESC[22m set dim/faint mode.
ESC[3m ESC[23m set italic mode.
ESC[4m ESC[24m set underline mode.
ESC[5m ESC[25m set blinking mode
ESC[7m ESC[27m set inverse/reverse mode
ESC[8m ESC[28m set hidden/invisible mode
ESC[9m ESC[29m set strikethrough mode.
*/
/*
const defaultAnsiCodes = {
'§0': '\u001b[30m',
'§1': '\u001b[34m',
'§2': '\u001b[32m',
'§3': '\u001b[36m',
'§4': '\u001b[31m',
'§5': '\u001b[35m',
'§6': '\u001b[33m',
'§7': '\u001b[37m',
'§8': '\u001b[90m',
'§9': '\u001b[94m',
'§a': '\u001b[92m',
'§b': '\u001b[96m',
'§c': '\u001b[91m',
'§d': '\u001b[95m',
'§e': '\u001b[93m',
'§f': '\u001b[97m',
'§l': '\u001b[1m',
'§o': '\u001b[3m',
'§n': '\u001b[4m',
'§m': '\u001b[9m',
'§k': '\u001b[6m',
'§r': '\u001b[0m'
}
*/
};
let i = message;