mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 18:54:55 -05:00
fix most things
This commit is contained in:
parent
a2adbbb955
commit
be8908ab6e
3 changed files with 3 additions and 1 deletions
|
@ -48,6 +48,7 @@ function inject(bot, dcclient, config) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
bot.on('message', async (usernamee, messagee, senderr) => {
|
bot.on('message', async (usernamee, messagee, senderr) => {
|
||||||
|
console.log()
|
||||||
// try catch cuz TypeError: Cannot read properties of undefined (reading 'replace')
|
// try catch cuz TypeError: Cannot read properties of undefined (reading 'replace')
|
||||||
try {
|
try {
|
||||||
const usernameraw = usernamee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, '');
|
const usernameraw = usernamee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, '');
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
/* eslint-disable prefer-rest-params */
|
/* eslint-disable prefer-rest-params */
|
||||||
const moment = require('moment-timezone');
|
const moment = require('moment-timezone');
|
||||||
|
const util = require('util');
|
||||||
|
|
||||||
function inject(bot, dcclient, config, rl) {
|
function inject(bot, dcclient, config, rl) {
|
||||||
if (!config.console) return;
|
if (!config.console) return;
|
||||||
|
|
|
@ -108,7 +108,7 @@ function inject(bot, dcclient, config) {
|
||||||
|
|
||||||
function addPlayer(player, packet) {
|
function addPlayer(player, packet) {
|
||||||
// if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet);
|
// if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet);
|
||||||
// else bot.emit('player_added', player, packet);
|
/* else */bot.emit('player_added', player, packet);
|
||||||
|
|
||||||
bot.players.addPlayer(player);
|
bot.players.addPlayer(player);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue