1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 08:20:58 -05:00

Prevent MP function from throwing errors.

This commit is contained in:
Toast 2023-08-12 19:46:03 +10:00 committed by GitHub
parent 8f2854bffa
commit 100a437e2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,6 +83,7 @@ export default async(client:TClient,Channel:string,Message:string,ServerName:str
const serverLog = client.channels.resolve(client.config.mainServer.channels.fs_server_log) as Discord.TextChannel;
const playersOnServer = DSS.data.slots?.players.filter(x=>x.isUsed);
const playersInCache = client.MPServerCache.players;
if (!playersOnServer) return console.error('[MPLoop] Empty filter, ignoring...'); // For the love of god, stop throwing errors everytime.
playersOnServer.forEach(player=>playerData.push(`**${player.name} ${player.isAdmin ? '| admin' : ''}**\nFarming for ${client.formatPlayerUptime(player.uptime)}`));
ServerName = client.MPServerCache.name;