Skip to content

Conversation

@developer51709
Copy link

@developer51709 developer51709 commented Jan 5, 2026

Relevant Issues

Closes #1709

Description

This PR provides a full rewrite of the Space cog to address ongoing failures caused by deprecated NASA APIs, inconsistent response formats, and unhandled exceptions. The goal of this rewrite is to restore stability to the space‑related commands while keeping the implementation self‑contained and avoiding changes to other parts of the codebase.

Summary of Changes

  • Implemented a new, robust NASA API request layer that:
    • Handles non‑200 responses gracefully
    • Detects and handles non‑JSON responses
    • Catches timeouts and network errors
    • Returns structured results instead of raising exceptions
    • Improves logging for debugging and monitoring
  • Updated APOD, EPIC, and NASA Images commands to use the new request layer
  • Added user‑friendly fallback messages when NASA services are unavailable
  • Disabled Mars Rover commands with clear messaging, as the underlying NASA API has been archived
  • Preserved all existing command names, signatures, and external behavior to avoid breaking changes
  • Kept the entire implementation within a single file for easier review and minimal repository impact This rewrite significantly improves reliability and prepares the cog for future API updates or fallback integrations.

Did you:

Note:
I have not yet joined the Python Discord community because I currently do not have access to my Discord account — it is on my laptop, which I do not have with me at the moment. I do plan to join the community as soon as I regain access to my account.

This version fixes the main commands and adds proper error handling.
Removed unnecessary `else:` statement
Added more detailed error description for archived API message
This commit replaces the archived **NASA Mars Rover API** with the **Mars 2020 Perseverance Raw Images API**.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NASA Commands not working

1 participant