idk but i want color codes back

This commit is contained in:
ChomeNS 2022-09-04 18:30:21 +07:00
parent e8e1321791
commit 1679f252e3

View file

@ -45,13 +45,13 @@ function inject(bot, dcclient) {
bot.command_handler.main(prefix, username, usernameraw, message, sender, channeldc);
}
};
bot.on('message', async (username, message, sender) => {
bot.on('message', async (usernamee, messagee, senderr) => {
// try catch cuz TypeError: Cannot read properties of undefined (reading 'replace')
try {
const usernameraw = username.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, '');
var sender = bot.playersAddedPlayers[usernameraw];
var username = bot.getplayerusername[sender];
var message = message.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, '');
const usernameraw = usernamee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, '');
const sender = bot.playersAddedPlayers[usernameraw];
const username = bot.getplayerusername[senderr];
const message = messagee.replace(/§r/ /* /§[a-f0-9rlonmk]/g */, '').replace(/§/g, '');
bot.command_handler.run(username, usernameraw, message, sender);
} catch (e) {
return;