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
Space Cog implementing #364
Conversation
…efault parameters
…est to NASA API and support arguments endpoint and params.
…in (upcoming) .nasa command.
…t NASA and/or space
… need for it) and moved all what this do to .nasa command.
…es), modified .mars command result check, some very small fixes.
Where are the embed colors ? |
@AG4lyf Embed colors is not most important things... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general question, I noticed that we're only using the image urls we get back from the API; do the API responses also include image data? And, if so, do you have an idea about the size of these responses? Are we talking KBs? MB? Multiple MB per request?
…, changed embed title, removed HD parameter + changed img from hdurl to url.
…m getting with random.choice
@SebastiaanZ First, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated in the issues this PR covers, these should all be implemented as subcommands of a single command, rather than as individual commands.
As also stated in the issues this PR covers, there should be some more customization available for the commands to make queries more interesting.
For example:
- The NASA Image API supports quite a few search options, including a free text search, keyword search, description search, and year start/end constraints
- The Earth API endpoint supports latitude & longitude queries
- The Mars command right now only fetches images from the Curiosity Rover and there are 2 other rovers (Opportunity, Spirit) supported by the API
The default being a purely random selection is fine, but please take some time to review the API documentation for each of the endpoints being used here and expand the functionality to provide the capability for some more interesting searches.
As commented on in #350, there needs to be handling for the scenario where the requested page (currently selected randomly) exceeds the number of pages present.
…ming new command.
…L date and way to change rover. Added custom converter for SOL and standard date.
…mand to not call head command when trying to use subcommand.
…space apod` command docstring
… this to commands.
…on to it to work correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few instances where multilining doesn't align with the prevailing codestyle in the repository, and also is inconsistent within the cog.
This, for example:
await ctx.send(embed=await self.create_nasa_embed(
item["data"][0]["title"],
item["data"][0]["description"],
item["links"][0]["href"]
))
Should be something like this:
await ctx.send(
embed=await self.create_nasa_embed(
item["data"][0]["title"],
item["data"][0]["description"],
item["links"][0]["href"]
)
)
Same with function signatures.
No:
async def fetch_from_nasa(self,
endpoint: str,
params: Optional[Dict[str, Any]] = None,
base: Optional[str] = NASA_BASE_URL
) -> Dict[str, Any]:
Yes:
async def fetch_from_nasa(
self,
endpoint: str,
params: Optional[Dict[str, Any]] = None,
base: Optional[str] = NASA_BASE_URL
) -> Dict[str, Any]:
… commands + add comments
… can command used in format `.space mars` and `.space mars <rover>` too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every looks pretty good! I only have some small nags, and this should be good to go.
Relevant Issues
Closes #360
Closes #359
Closes #358
Closes #357
Description
I added
.apod <date (optional)>
,.nasa
,.mars <date>
and.earth
command. Note: Mars command have date limitations.Reasoning
Due their issues got approved.
Screenshots
Did you:
pipenv lock
?pipenv run lint
)?