TheBastionBot / Bastion

🚀 Get an enhanced Discord experience!
https://bastion.traction.one
GNU General Public License v3.0
311 stars 245 forks source link

Overwatch stats showing `undefined` #58

Closed Midni8 closed 7 years ago

Midni8 commented 7 years ago

Prerequisites

Description

When the overwatch command is used for any player who does not have any stats, the stats are shown as undefined. This is a recent issue, it was not happening in older versions of Bastion.

Steps to Reproduce

  1. Use the overwatch command for a new user or for someone who does not have any stats.
  2. See the output

Expected behavior:
Showing N/A or Not Available or something easily understandable is a better choice.

Actual behavior:
The output shows undefined.

Reproduces how often:
Everytime

Additional Information

No additional information.

Versions

iamtraction commented 7 years ago

I saw that for a case in the #commands-testing channel. I will fix it in the next release.

iamtraction commented 7 years ago

The issue is not actually for new players or players with no stats, but with the library that Bastion uses to get Overwatch stats and the way it gets them (by scrapping the Overwatch website). That's not a good way to retrieve data, and since there are no other options, that's the only way too. So, when Overwatch made some changes to the site, the data retrieved from the library changed and caused every (most) keys to be undefined. But I've updated the code and fixed the issue. The fix will be released with the next release.

Thanks for reporting the issue! :ok_hand:

Midni8 commented 7 years ago

Oh I see. Thank you for the fix. :1st_place_medal: