Skip to content

Commit

Permalink
fix: sentient outpost embed
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobiah committed May 1, 2020
1 parent 1b5403f commit eca16af
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/embeds/SentientOutpostEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,13 @@

const BaseEmbed = require('./BaseEmbed.js');

const current = (outpost) => {
const defStart = new Date(outpost.activation).getTime();
const defEnd = new Date(outpost.expiry).getTime();
const predStart = new Date(outpost.previous.activation).getTime();
const predEnd = new Date(outpost.previous.expiry).getTime();
if (defStart < predStart) {
return {
activation: new Date(defStart),
expiry: new Date(defEnd),
};
}
return {
activation: new Date(predStart),
expiry: new Date(predEnd),
};
};

class SentientOutpostEmbed extends BaseEmbed {
constructor(bot, outpost, platform, i18n) {
super();
this.setTitle(i18n`[${platform.toUpperCase()}] Sentient Outpost`);
this.setDescription(outpost.mission.node);
this.setFooter('Fades at');
this.setTimestamp(current(outpost).expiry);
this.setTimestamp(outpost.expiry);
}
}

Expand Down

0 comments on commit eca16af

Please sign in to comment.