Python-Discord-Bot-Template icon indicating copy to clipboard operation
Python-Discord-Bot-Template copied to clipboard

Bitcoin price fails with unexpected mimetype "application/json"

Open AllanTaylor314 opened this issue 1 year ago • 0 comments

Describe the bug The bitcoin command fails to parse the response since Coindesk have fixed their API. discord.app_commands.errors.CommandInvokeError: Command 'bitcoin' raised an exception: ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: application/json; charset=utf-8', url=URL('https://api.coindesk.com/v1/bpi/currentprice/BTC.json')

To Reproduce Run /bitcoin

Expected behavior An embed with the current price of bitcoin is displayed

Template Version 6.1.0

Additional context Coindesk seems to have fixed their API to return the correct MIME type. Previously it returned application/javascript as noted in the code. I would propose removing the explicit content_type (default application/json) or setting it to None to explicitly ignore MIME type.

AllanTaylor314 avatar Jan 20 '24 01:01 AllanTaylor314