Skip to content

Commit

Permalink
Update EnemyEmbed.js
Browse files Browse the repository at this point in the history
Update Enemies.js
Update Enemies.js
Update EnemyEmbed.js
Update EnemyEmbed.js
Update Enemies.js
Update RaidEmbed.js
Update Raid.js
Update Raid.js
Update Raid.js
Update Raid.js
Update Raid.js
  • Loading branch information
TobiTenno committed Feb 12, 2017
1 parent c9082ca commit cad31db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/commands/Enemies.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Enemies extends Command {
* @param {Genesis} bot The bot object
*/
constructor(bot) {
super(bot, 'ondemand.enemies', 'enemies', 'Display any currently active acolyte-style enemies.');
super(bot, 'ondemand.acolytes', 'acolyte', 'Display any currently active acolyte-style enemies.');
}

/**
Expand All @@ -24,7 +24,7 @@ class Enemies extends Command {
this.bot.settings.getChannelPlatform(message.channel)
.then(platform => this.bot.worldStates[platform].getData())
.then((ws) => {
const persistentEnemies = ws.persistentEnemies.filter(e => e.isDiscovered);
const persistentEnemies = ws.persistentEnemies;
return message.channel.sendEmbed(new EnemyEmbed(this.bot, persistentEnemies));
}).then(() => {
if (message.deletable) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/Raid.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Raid extends Command {

this.bot.settings.getChannelPlatform(message.channel)
.then((platform) => {
const url = `https://api.trials.wf/api/player/${platform.toLowerCase()}/${query}/completed`;
const url = encodeURI(`https://api.trials.wf/api/player/${platform.toLowerCase()}/${query}/completed`);
const raidCache = new Cache(url, 999999);

raidCache.getDataJson().then((data) => {
Expand Down
6 changes: 3 additions & 3 deletions src/embeds/EnemyEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class EnemyEmbed extends BaseEmbed {
this.color = enemies.length > 2 ? 0x00ff00 : 0xff0000;
this.fields = enemies.map(e => ({
name: e.agentType,
value: `Last discovered at ${e.lastDiscoveredAt}.\nIt has ${e.healthPercent}% health remaining and is currently ${e.isDiscovered ? 'discovered' : 'not discovered'}`,
value: `Last discovered at ${e.lastDiscoveredAt}.\nIt has ${(100*Number(e.healthPercent)).toFixed(2)}% health remaining and is currently ${e.isDiscovered ? 'discovered' : 'not discovered'}`,
}));
} else if (enemies.length === 1) {
const e = enemies[0];
this.title = e.agentType;
this.description = 'Enemy Discovered!';
this.description = `Enemy ${e.discovered ? 'Discovered' : 'Hiding'}!`;
this.color = 0xaf5b4b;
this.fields = [{ name: '_ _', value: `**Discovered At:** ${e.lastDiscoveredAt}` },
this.fields = [{ name: '_ _', value: `**${e.discovered? '' : 'Last '}Discovered At:** ${e.lastDiscoveredAt}` },
{ name: '_ _', value: `**Health Remaining:** ${(100*Number(e.healthPercent)).toFixed(2)}%` },
{ name: '_ _', value: `Will flee after ${e.fleeDamage} damage.\nGet after the Acolyte, Tenno!`}];
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/embeds/RaidEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RaidStatEmbed extends BaseEmbed {
constructor(bot, userStats, query) {
super();
this.title = `Raid statistics for ${query}`;
this.url = `https://trials.wf/player/?user=${query}`;
this.url = encodeURI(`https://trials.wf/player/?user=${query}`);
this.color = 0xaf5b4b;
this.thumbnail = {
url: 'https://raw.githubusercontent.com/aliasfalse/genesis/master/src/resources/NightmareRaidSekhara.png',
Expand Down

0 comments on commit cad31db

Please sign in to comment.