-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: steel path embed & notifications
- Loading branch information
Showing
6 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const Command = require('../../models/Command.js'); | ||
const SteelPathEmbed = require('../../embeds/SteelPathEmbed'); | ||
|
||
module.exports = class SteelPath extends Command { | ||
constructor(bot) { | ||
super(bot, 'warframe.worldstate.steelpath', 'steelpath', 'Display the currently active Steel Path Rotating offering.', 'WARFRAME'); | ||
} | ||
|
||
async run(message, ctx) { | ||
const offering = await this.ws.get('steelPath', ctx.platform, ctx.language); | ||
if (!offering.currentReward) { | ||
await this.messageManager.sendMessage(message, 'There is currently no Steel Path Offering', true, true); | ||
return this.messageManager.statuses.FAILURE; | ||
} | ||
const embed = new SteelPathEmbed(this.bot, offering, { isCommand: true, i18n: ctx.i18n }); | ||
await this.messageManager.embed(message, embed, true, false); | ||
return this.messageManager.statuses.SUCCESS; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use strict'; | ||
|
||
const BaseEmbed = require('./BaseEmbed.js'); | ||
const { assetBase, emojify } = require('../CommonFunctions'); | ||
|
||
const steelPathThumb = `${assetBase}/img/steelpath.png`; | ||
|
||
module.exports = class SteelPathEmbed extends BaseEmbed { | ||
constructor(bot, offering, { isCommand = false, i18n }) { | ||
super(); | ||
|
||
const evergreen = [ | ||
{ name: i18n`Bishamo Pauldrons Blueprint`, cost: 15 }, | ||
{ name: i18n`Bishamo Cuirass Blueprint`, cost: 25 }, | ||
{ name: i18n`Bishamo Helmet Blueprint`, cost: 20 }, | ||
{ name: i18n`Bishamo Greaves Blueprint`, cost: 25 }, | ||
{ name: i18n`10k Kuva`, cost: 15 }, | ||
{ name: i18n`Relic Pack`, cost: 15 }, | ||
{ name: i18n`Stance Forma Blueprint`, cost: 10 }, | ||
{ name: i18n`Trio Orbit Ephermera`, cost: 3 }, | ||
{ name: i18n`Crania Ephemera`, cost: 85 }, | ||
]; | ||
|
||
this.description = `${i18n`**Rotating:**`} ${offering.currentReward.name || offering.currentReward}: ${offering.currentReward.cost || '???'}${isCommand ? emojify('steelessence') : i18n` essence`} | ||
${i18n`**Evergreen:**`} | ||
${evergreen | ||
.map(reward => `:white_small_square: ${reward.name}: ${reward.cost}${isCommand | ||
? emojify('steelessence') | ||
: i18n` essence`}`) | ||
.join('\n')}`; | ||
|
||
this.footer.text = i18n`Cycles at`; | ||
this.timestamp = offering.expiry; | ||
this.title = i18n`Steel Path Offerings`; | ||
this.thumbnail.url = steelPathThumb; | ||
this.color = 0x43464b; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters