Set disable notif value to 0
parent
9201599aae
commit
911218cdaf
|
@ -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.***`);
|
||||
}
|
||||
|
|
|
@ -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 <preferred ram threshold in MB>\`, you can disable these notifications by running \`=limits set-ram-notification -1\`.`)
|
||||
|
|
Loading…
Reference in New Issue