remove bad code

This commit is contained in:
ChomeNS 2022-12-30 19:47:14 +07:00
parent e5b38024ce
commit 5d41b4c908
2 changed files with 1 additions and 10 deletions

9
bot.js
View file

@ -52,7 +52,6 @@ async function createBot (server, config, getBots, setNewBot, dcclient, rl) {
}
bot.visibility = false
bot.getBots = getBots
bot.getplayerusername = {}
await sleep(200)
@ -62,9 +61,6 @@ async function createBot (server, config, getBots, setNewBot, dcclient, rl) {
const channel = dcclient.channels.cache.get(config.discord.servers[bot.options.host])
bot.playersAddedPlayers = {}
bot.getplayerusername = {}
bot._client.on('login', async function (data) {
bot.entityId = data.entityId
bot.uuid = bot._client.uuid
@ -128,11 +124,6 @@ async function createBot (server, config, getBots, setNewBot, dcclient, rl) {
// ]);
})
bot.on('player_added', (player) => {
bot.playersAddedPlayers[player.name] = player.UUID
bot.getplayerusername[player.UUID] = player.name
})
bot._client.on('end', function (reason) {
bot.end(reason, 'end')
})

View file

@ -70,7 +70,7 @@ function inject (bot, dcclient, config) {
bot.on('cspy', async function (_username, _message) {
const username = _username.replace(/§.?/g, '')
const message = _message.replace(/§.?/g, '')
const sender = bot.playersAddedPlayers[username]
const sender = bot.players.list.find((val) => val.name === username)?.UUID
bot.command_handler.run(username, message, sender, channeldc, bot.hash, bot.ownerHash, username)
})
function handleDiscordMessages (message) {