diff --git a/src/commands/Ondemand/Mod.js b/src/commands/Ondemand/Mod.js index 545ad8281..6c7a01275 100644 --- a/src/commands/Ondemand/Mod.js +++ b/src/commands/Ondemand/Mod.js @@ -17,7 +17,8 @@ class Mod extends Command { */ constructor(bot) { super(bot, 'warframe.misc.mod', 'mod', 'Search the Warframe Wiki for a mod\'s image', 'WARFRAME'); - this.regex = new RegExp('^mod(.+)', 'i'); + // Should match "/mod blind rage, for example" + this.regex = new RegExp('^mod (.+)', 'i'); this.noResultStr = '```haskell\nNo result for search, Operator. Attempt another search query.```'; } @@ -35,7 +36,9 @@ class Mod extends Command { } try { - const results = await fetch(`${apiBase}/mods/search/${query}`); + // Need to search in all lower case. "Blind Rage = blind rage" + const url = `${apiBase}/mods/search/${query.toLowerCase()}`; + const results = await fetch(url); if (results.length > 0) { const pages = []; results.forEach((result) => { diff --git a/src/embeds/ModEmbed.js b/src/embeds/ModEmbed.js index 8f5f26889..ed685a678 100644 --- a/src/embeds/ModEmbed.js +++ b/src/embeds/ModEmbed.js @@ -18,7 +18,19 @@ class ModEmbed extends BaseEmbed { this.title = modData.name; this.color = rarity[modData.rarity.toLowerCase()]; - this.description = `_${emojify(modData.description)}_`; + + // If we have a description, show it. For stance mods, etc + if (modData.description) { + this.description = `_${emojify(modData.description)}_`; + } + + // If we have an effect, show the max rank effect + const statsLength = modData.levelStats.length; + if (modData.levelStats && 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.image = { url: `https://cdn.warframestat.us/img/${modData.imageName}`,