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:
parent
3ab2fe3bd9
commit
21ea97d3c6
@ -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 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 playersOnServer = DSS.data.slots?.players.filter(x=>x.isUsed);
|
||||||
const playersInCache = client.MPServerCache.players;
|
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)}`));
|
playersOnServer.forEach(player=>playerData.push(`**${player.name} ${player.isAdmin ? '| admin' : ''}**\nFarming for ${client.formatPlayerUptime(player.uptime)}`));
|
||||||
|
|
||||||
ServerName = client.MPServerCache.name;
|
ServerName = client.MPServerCache.name;
|
||||||
|
Loading…
Reference in New Issue
Block a user