diff --git a/src/commands/Ondemand/Armor.js b/src/commands/Ondemand/Armor.js index fb81152be..faf54da09 100644 --- a/src/commands/Ondemand/Armor.js +++ b/src/commands/Ondemand/Armor.js @@ -139,13 +139,7 @@ class Armor extends Command { }, }; - message.reply('', { embed }) - .then(() => { - if (message.deletable) { - return message.delete(2000); - } - return Promise.resolve(); - }).catch(this.logger.error); + this.bot.messageManager.sendEmbed(message, embed, true, false); } /** diff --git a/src/commands/Ondemand/ConclaveChallenges.js b/src/commands/Ondemand/ConclaveChallenges.js index 00c371636..1b20bf12e 100644 --- a/src/commands/Ondemand/ConclaveChallenges.js +++ b/src/commands/Ondemand/ConclaveChallenges.js @@ -35,12 +35,7 @@ class ConclaveChallenges extends Command { .then((ws) => { const conclaveChallenges = ws.conclaveChallenges; const embed = new ConclaveChallengeEmbed(this.bot, conclaveChallenges, category); - return message.channel.sendEmbed(embed); - }).then(() => { - if (message.deletable) { - return message.delete(2000); - } - return Promise.resolve(); + this.bot.messageManager.sendEmbed(message, embed, true, false); }) .catch(this.logger.error); } diff --git a/src/commands/Ondemand/Darvo.js b/src/commands/Ondemand/Darvo.js index 23ba76528..75e787192 100644 --- a/src/commands/Ondemand/Darvo.js +++ b/src/commands/Ondemand/Darvo.js @@ -25,7 +25,7 @@ class Darvo extends Command { .then(platform => this.bot.worldStates[platform].getData()) .then((ws) => { const deal = ws.dailyDeals[0]; - return message.channel.sendEmbed(new DarvoEmbed(this.bot, deal)); + this.bot.messageManager.sendEmbed(message, new DarvoEmbed(this.bot, deal), true, false); }) .catch(this.logger.error); } diff --git a/src/commands/Ondemand/EarthCycle.js b/src/commands/Ondemand/EarthCycle.js index f1adb0e38..d38ed5e67 100644 --- a/src/commands/Ondemand/EarthCycle.js +++ b/src/commands/Ondemand/EarthCycle.js @@ -45,13 +45,7 @@ class EarthCycle extends Command { */ run(message) { const state = getCurrentEarthCycle(); - message.channel.sendEmbed(new EarthCycleEmbed(this.bot, state)) - .then(() => { - if (message.deletable) { - return message.delete(2000); - } - return Promise.resolve(); - }).catch(this.logger.error); + this.bot.messageManager.sendEmbed(message, new EarthCycleEmbed(this.bot, state), true, false); } } diff --git a/src/commands/Ondemand/Enemies.js b/src/commands/Ondemand/Enemies.js index 65bb95d5b..6a8974b05 100644 --- a/src/commands/Ondemand/Enemies.js +++ b/src/commands/Ondemand/Enemies.js @@ -25,12 +25,8 @@ class Enemies extends Command { .then(platform => this.bot.worldStates[platform].getData()) .then((ws) => { const persistentEnemies = ws.persistentEnemies; - return message.channel.sendEmbed(new EnemyEmbed(this.bot, persistentEnemies)); - }).then(() => { - if (message.deletable) { - return message.delete(2000); - } - return Promise.resolve(); + this.bot.messageManager.sendEmbed(message, + new EnemyEmbed(this.bot, persistentEnemies), true, false); }) .catch(this.logger.error); } diff --git a/src/commands/Ondemand/FeaturedDeal.js b/src/commands/Ondemand/FeaturedDeal.js index 2059ec605..7634fa020 100644 --- a/src/commands/Ondemand/FeaturedDeal.js +++ b/src/commands/Ondemand/FeaturedDeal.js @@ -26,13 +26,8 @@ class FeaturedDeal extends Command { .then(platform => this.bot.worldStates[platform].getData()) .then((ws) => { const sales = ws.flashSales.filter(popularItem => popularItem.isFeatured); - return message.channel.sendEmbed(new SalesEmbed(this.bot, sales)); - }) - .then(() => { - if (message.deletable) { - return message.delete(2000); - } - return new Promise(); + this.bot.messageManager.sendEmbed(message, + new SalesEmbed(this.bot, sales), true, false); }) .catch(this.logger.error); } diff --git a/src/commands/Ondemand/Fissures.js b/src/commands/Ondemand/Fissures.js index c333c6fe7..ee3ccb472 100644 --- a/src/commands/Ondemand/Fissures.js +++ b/src/commands/Ondemand/Fissures.js @@ -25,12 +25,8 @@ class Fissures extends Command { .then(platform => this.bot.worldStates[platform].getData()) .then((ws) => { const fissures = ws.fissures; - return message.channel.sendEmbed(new FissureEmbed(this.bot, fissures)); - }).then(() => { - if (message.deletable) { - return message.delete(2000); - } - return Promise.resolve(); + this.bot.messageManager.sendEmbed(message, + new FissureEmbed(this.bot, fissures), true, false); }) .catch(this.logger.error); } diff --git a/src/commands/Ondemand/Invasions.js b/src/commands/Ondemand/Invasions.js index f02a80a30..fcef22c02 100644 --- a/src/commands/Ondemand/Invasions.js +++ b/src/commands/Ondemand/Invasions.js @@ -25,12 +25,8 @@ class Invasions extends Command { .then(platform => this.bot.worldStates[platform].getData()) .then((ws) => { const invasions = ws.invasions.filter(i => !i.completed); - return message.channel.sendEmbed(new InvasionEmbed(this.bot, invasions)); - }).then(() => { - if (message.deletable) { - return message.delete(2000); - } - return Promise.resolve(); + this.bot.messageManager.sendEmbed(message, + new InvasionEmbed(this.bot, invasions), true, false); }) .catch(this.logger.error); }