Skip to content

Commit

Permalink
fix: let invalid mods fail command
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Oct 12, 2020
1 parent 92ba850 commit 954b207
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/embeds/ModEmbed.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const BaseEmbed = require('./BaseEmbed.js');
const { emojify } = require('../CommonFunctions');
const { emojify, apiCdnBase, wikiBase } = require('../CommonFunctions');

const rarity = {
common: 0x775448,
Expand All @@ -25,15 +25,15 @@ class ModEmbed extends BaseEmbed {
}

// If we have an effect, show the max rank effect
const statsLength = modData.levelStats.length;
if (modData.levelStats && statsLength > 0) {
const statsLength = modData.levelStats && modData.levelStats.length;
if (statsLength > 0) {
const stats = modData.levelStats[statsLength - 1].stats.join('\n');
this.description = `_${emojify(stats)}_`;
}

this.url = `https://warframe.fandom.com/wiki/${modData.name.replace(/\s/ig, '_')}`;
this.url = `${wikiBase}${modData.name.replace(/\s/ig, '_')}`;
this.image = {
url: `https://cdn.warframestat.us/img/${modData.imageName}`,
url: `${apiCdnBase}img/${modData.imageName}`,
};
this.fields = [{
name: 'Polarity',
Expand Down
4 changes: 3 additions & 1 deletion src/resources/emoji.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
"umbra": "<:umbra:459116667255914496>",
"yay": "<:yay:568974518228615189>",
"credits": "<:credits:668499068342763573>",
"ducats": "<:ducats:668499069169041420>"
"ducats": "<:ducats:668499069169041420>",
"green_tick": "<:green_tick:326794577006690305>",
"red_tick":"<:red_tick:326794577426251796>"
}

0 comments on commit 954b207

Please sign in to comment.