diff --git a/src/MPLoop.ts b/src/MPLoop.ts index abdbfd7..44839a9 100644 --- a/src/MPLoop.ts +++ b/src/MPLoop.ts @@ -80,7 +80,7 @@ export default async(client:TClient,Channel:string,Message:string,ServerName:str const serverIndicatorEmbed =(indicator:string)=>new client.embed().setTitle(`**${ServerName}** is now ${indicator}`).setColor(client.config.embedColorOrange).setTimestamp(); 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; playersOnServer.forEach(player=>playerData.push(`**${player.name} ${player.isAdmin ? '| admin' : ''}**\nFarming for ${client.formatPlayerUptime(player.uptime)}`)); diff --git a/src/commands/dev.ts b/src/commands/dev.ts index a17a847..4df7cf2 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -48,11 +48,10 @@ export default { if (error) return; if (typeof output === 'object') output = 'js\n'+util.formatWithOptions({depth: 1}, '%O', output) else output = '\n' + String(output); - - [client.tokens.main,client.tokens.beta,client.tokens.toast,client.tokens.tae,client.tokens.octokit,client.tokens.webhook_url,client.tokens.webhook_url_test,client.tokens.mongodb_uri,client.tokens.mongodb_uri_dev].forEach((x)=>{ - const regexp = new RegExp(x as string,'g'); - output = output.replace(regexp, ':noblank: No token?'); - }) + [ + client.tokens.main,client.tokens.beta,client.tokens.toast,client.tokens.webhook_url, + client.tokens.webhook_url_test,client.tokens.mongodb_uri,client.tokens.mongodb_uri_dev,client.tokens.octokit + ].forEach(x=>output = output.replace(new RegExp(x as string,'g'),':noblank: No token?')); const embed = new client.embed().setColor(client.config.embedColor).setTitle('__Eval__').addFields( {name: 'Input', value: `\`\`\`js\n${code.slice(0,1010)}\n\`\`\``}, {name: 'Output', value: `\`\`\`${removeUsername(output).slice(0,1016)}\n\`\`\``} diff --git a/src/typings/interfaces.d.ts b/src/typings/interfaces.d.ts index b9e2b59..5e8f3a5 100644 --- a/src/typings/interfaces.d.ts +++ b/src/typings/interfaces.d.ts @@ -125,7 +125,6 @@ export interface Tokens { main: string beta: string toast: string - tae: string octokit: string webhook_url: string webhook_url_test: string