diff --git a/src/commands/limits_setramnotification.ts b/src/commands/limits_setramnotification.ts index 11ecf9c..aa60271 100644 --- a/src/commands/limits_setramnotification.ts +++ b/src/commands/limits_setramnotification.ts @@ -17,8 +17,8 @@ export default class Limits_SetRAMNotification extends Command { if (!account) return message.channel.createMessage(`***${this.client.stores.emojis.error} You do not have a Cloud Account.***`); const tier = await this.client.db.Tier.findOne({ id: account.tier }); if (Number(args[0]) >= tier.resourceLimits.ram) return message.channel.createMessage(`***${this.client.stores.emojis.error} You cannot set your notification limit to be set to or above your hard limit.***`); - if ((Number(args[0]) < 1) && (Number(args[0]) !== -1)) return message.channel.createMessage(`***${this.client.stores.emojis.error} You cannot set your notification limit to a negative number.***`); - if (Number(args[0]) === -1) { + if (Number(args[0]) < 0) return message.channel.createMessage(`***${this.client.stores.emojis.error} You cannot set your notification limit to a negative number.***`); + if (Number(args[0]) === 0) { await account.updateOne({ $set: { ramLimitNotification: -1 } }); return message.channel.createMessage(`***${this.client.stores.emojis.success} You have disabled notifications.***`); } diff --git a/src/intervals/memory.ts b/src/intervals/memory.ts index c3390c9..81702fd 100644 --- a/src/intervals/memory.ts +++ b/src/intervals/memory.ts @@ -77,7 +77,7 @@ export default function memory(client: Client) { embed.setTimestamp(); await client.createMessage(channelID, { embed }); if (memoryConversion >= acc.ramLimitNotification) { - if (acc.ramLimitNotification === -1) return; + if (acc.ramLimitNotification === 0) return; const notifyEmbed = new RichEmbed() .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 - 10)} MB'. Please correct your usage to avoid further action.\nYou can set your notification preferences by running \`=limits set-ram-notification \`, you can disable these notifications by running \`=limits set-ram-notification -1\`.`)