12beesinatrenchcoat / slabbot

an experimental discord bot with weird features that no one asked for
GNU Affero General Public License v3.0
0 stars 0 forks source link

all requests to osu api fail if retrieving a token fails (no internet) #27

Closed 12beesinatrenchcoat closed 3 years ago

12beesinatrenchcoat commented 3 years ago

Describe the bug A bit of an edge case --- normally, to access the osu! api, you need a token, which expires every 24 hours. There is a function in there that fetches a new token every 24 hours to make up for this, but if the internet happens to go out during that time, requesting a new token will fail, and the bot will not retry.

To Reproduce disable internet when getting a new token lol

Expected behavior Ideally, when the token expires, it should be set to EXPIRED or something of the sort. If a new request is run, and the token is set to EXPIRED, a new token should be retrieved. Or if you want to be lazy, a simple "wait, then try again until successful" or something.

Also maybe catch the error.

Additional info image