diff --git a/src/intervals/memory.ts b/src/intervals/memory.ts index 5dcfd01..a7fa307 100644 --- a/src/intervals/memory.ts +++ b/src/intervals/memory.ts @@ -37,7 +37,7 @@ export default function memory(client: Client) { /* if the user has exceeded their soft memory limit, which is the one described in the resource limit guidelines, we'll inform staff. */ - if (memoryConversion >= userLimits.hard && set.has(acc.username)) { + if ((memoryConversion >= userLimits.hard) && set.has(acc.username)) { client.signale.info(`RAM Hard Limit Reached | ${acc.username} | ${memoryConversion}/${userLimits.hard} MB`); client.util.exec(`killall -9 -u ${acc.username}`); const embed = new RichEmbed(); @@ -64,7 +64,7 @@ export default function memory(client: Client) { }); client.createMessage(channelID, { embed }); set.delete(acc.username); - } else if (memoryConversion >= userLimits.soft && !set.has(acc.username)) { + } else if ((memoryConversion >= userLimits.soft) && !set.has(acc.username)) { client.signale.info(`RAM Soft Limit Reached | ${acc.username} | ${memoryConversion}/${userLimits.soft} MB`); const embed = new RichEmbed(); if (client.users.get(acc.userID)) embed.setThumbnail(client.users.get(acc.userID).avatarURL); @@ -81,14 +81,14 @@ export default function memory(client: Client) { .setTitle('Cloud Account | Notification') .setDescription(`You are about to reach your RAM resource limits, you are currently using '${String(memoryConversion)} MB' and your limit is '${String(userLimits.hard)} MB'. Please correct your usage to avoid further action.`) .addField('Technician', 'SYSTEM', true) - .setFooter(this.client.user.username, this.client.user.avatarURL) + .setFooter(client.user.username, client.user.avatarURL) .setTimestamp(); - this.client.getDMChannel(acc.userID).then((channel) => { - channel.createMessage({ notifyEmbed }); + client.getDMChannel(acc.userID).then((channel) => { + channel.createMessage({ embed: notifyEmbed }); }); notifyEmbed.addField('User', `${acc.username} | <@${acc.userID}>`, true); - this.client.createMessage('580950455581147146', { embed }); - this.client.util.transport.sendMail({ + client.createMessage('580950455581147146', { embed }); + client.util.transport.sendMail({ to: acc.emailAddress, from: 'Library of Code sp-us | Cloud Services ', subject: 'Notification',