From d0f16fd484fe218387441be29fe93559ed7e74a7 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Fri, 11 Nov 2022 18:17:50 +0700 Subject: [PATCH] i give up i can't do it :((((((( --- plugins/players.js | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/plugins/players.js b/plugins/players.js index 981ea10..b5400fd 100644 --- a/plugins/players.js +++ b/plugins/players.js @@ -47,7 +47,7 @@ class TabCompletePlayerRequester { constructor(bot) { this.bot = bot; - bot.on('target_packet', (name, data) => { + bot._client.on('target_packet', (name, data) => { if (name !== 'tab_complete') return; const players = data.matches @@ -107,10 +107,8 @@ function inject(bot, dcclient, config) { }); function addPlayer(player, packet) { - if (bot.options.host === 'sus.shhnowisnottheti.me') { - if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet); - else bot.emit('player_added', player, packet); - } + // if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet); + // else bot.emit('player_added', player, packet); bot.players.addPlayer(player); } @@ -146,19 +144,11 @@ function inject(bot, dcclient, config) { } async function removePlayer(player, packet) { - if (bot.options.host === 'sus.shhnowisnottheti.me') { - const fullPlayer = bot.players.getPlayer(player); - - const players = await bot.requester.getPlayerList(); - - if (fullPlayer && players.some((name) => name === fullPlayer.name)) { - bot.emit('player_vanished', player); - - return; - } - } - - bot.emit('player_removed', player, packet); + // const fullPlayer = bot.players.getPlayer(player); + // const players = await bot.requester.getPlayerList(); + // + // if (fullPlayer && players.some((name) => name === fullPlayer.name)) bot.emit('player_vanished', player); + /* else */bot.emit('player_removed', player, packet); bot.players.removePlayer(player); }