1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 04:10:59 -05:00

Prevent MP function from throwing errors.

This commit is contained in:
toast-ts 2023-08-12 19:46:03 +10:00 committed by GitHub
parent 3ab2fe3bd9
commit 21ea97d3c6

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;