skyra-project / skyra

A multipurpose Discord Bot designed to carry out most of your server's needs with great performance and stability.
https://skyra.pw
Apache License 2.0
289 stars 68 forks source link

bug: IGDB search is missing results shown on the main site and other bots #545

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the bug Certain games refuse to show up using the s!igdb command despite being searchable with the reference bot (hosted in the IGDB discord server) and the main search page.

To Reproduce Steps to reproduce the behavior:

  1. s!igdb Guilty Gear
  2. Observe error

Expected behavior Game was found by the bot and shown in the results

Screenshots

image

image

Additional context Similar issue in ribbon bot.

ghost commented 4 years ago

I wonder if this is related to everyone getting the paid tier for free now image

kyranet commented 4 years ago

No, the "WTF" (What a Terrible Failure) errors are caused to an internal error we were not handling correctly.

In this case, the error is:

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.
    at Function.checkField (/home/kyra/Skyra/node_modules/discord.js/src/structures/MessageEmbed.js:383:23)
    at MessageEmbed.addField (/home/kyra/Skyra/node_modules/discord.js/src/structures/MessageEmbed.js:201:39)
    at /home/kyra/Skyra/src/commands/Tools/Websearch/igdb.ts:101:6
    at UserRichDisplay._handlePageGeneration (/home/kyra/Skyra/node_modules/klasa/src/lib/util/RichDisplay.js:255:17)
    at UserRichDisplay.addPage (/home/kyra/Skyra/node_modules/klasa/src/lib/util/RichDisplay.js:165:24)
    at default_1.buildDisplay (/home/kyra/Skyra/src/commands/Tools/Websearch/igdb.ts:92:12)
    at default_1.run (/home/kyra/Skyra/src/commands/Tools/Websearch/igdb.ts:47:24)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at default_1.runCommand (/home/kyra/Skyra/src/monitors/commandHandler.ts:49:23)

It's not Skyra not having those entries because different tiers, but rather an error due to that specific entry not giving us the data we expected.

kyranet commented 4 years ago

Though another error came out too:

TypeError: Cannot read property 'length' of undefined
    at Object.cutText (/home/kyra/Skyra/src/lib/util/util.ts:152:10)
    at /home/kyra/Skyra/src/commands/Tools/Websearch/igdb.ts:96:21
    at UserRichDisplay._handlePageGeneration (/home/kyra/Skyra/node_modules/klasa/src/lib/util/RichDisplay.js:255:17)
    at UserRichDisplay.addPage (/home/kyra/Skyra/node_modules/klasa/src/lib/util/RichDisplay.js:165:24)
    at default_1.buildDisplay (/home/kyra/Skyra/src/commands/Tools/Websearch/igdb.ts:92:12)
    at default_1.run (/home/kyra/Skyra/src/commands/Tools/Websearch/igdb.ts:47:24)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at default_1.runCommand (/home/kyra/Skyra/src/monitors/commandHandler.ts:49:23)
    at default_1._run (/home/kyra/Skyra/node_modules/klasa/src/lib/structures/Monitor.js:99:4)
ghost commented 4 years ago

https://github.com/igdb/igdb-typescript-types Not sure if this will be helpful since their types includes a lot more than the bot needs, but it looks like they had to change it recently to accommodate changes to the API.

favna commented 4 years ago

Types are published to NPM, we can include them as devDependency so @dependabot can notify us when they change. Good find. https://yarnpkg.com/en/package/@igdb/types