Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitcoin price fails with unexpected mimetype "application/json" #97

Open
AllanTaylor314 opened this issue Jan 20, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working priority: medium This has a medium priority

Comments

@AllanTaylor314
Copy link

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.

@kkrypt0nn kkrypt0nn self-assigned this Jan 29, 2024
@kkrypt0nn kkrypt0nn added bug Something isn't working priority: medium This has a medium priority labels Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: medium This has a medium priority
Projects
None yet
Development

No branches or pull requests

2 participants