Space Slash Command | Pycord & NASA APOD API

Опубликовано: 24 Октябрь 2024
на канале: Digiwind
781
13

In this video, we make a space slash command in Pycord to get random images related to space and astronomy with NASA's APOD API (the U.S. National Aeronautics and Space Administration's Astronomy Picture of the Day Application Programming Interface - yes, Americans love acronyms).

Dependencies: AIOHTTP (an asynchronous HTTP Client/Server for asyncio and Python), JSON (built into Python), datetime (for our timestamps), and Pycord.

Install Pycord: pip install py-cord (or pip install py-cord==2.0.0b1 for v2)
Install AIOHTTP: pip install aiohttp

Get Started with AIOHTTP: https://docs.aiohttp.org/en/stable/

See today's Astronomy Picture of the Day: https://apod.nasa.gov
NASA APIs (get your API key here): https://api.nasa.gov
NASA APOD API Endpoint (used in this video): https://api.nasa.gov/planetary/apod?a...

The rate limits for the DEMO_KEY are:
Hourly Limit: 30 requests per IP address per hour
Daily Limit: 50 requests per IP address per day

Article about Asynchronous HTTP Requests in Python with aiohttp and asyncio (referenced in this video): https://www.twilio.com/blog/asynchron...

Discord Developer Portal:   / discord  

Pycord:
Pycord Documentation: https://docs.pycord.dev/en/master/
Pycord Discord:   / discord  
Pycord Github: https://github.com/Pycord-Development...

Find the code used in this video in this repository (space.py): https://github.com/Digiwind/Digiwind-...

My Socials:
Discord Server:   / discord  
Twitter (@Digiwind_YT):   / digiwind_yt  
Reddit (u/digiwind_yt):   / digiwind_yt  
Top.gg: https://top.gg/user/512025208542986241
Github (Digiwind): https://github.com/Digiwind

Music used in this video:
Purrple Cat – Missing You
Provided by Lofi Records
Watch:    • Purrple Cat – Missing You  
Download/Stream: https://fanlink.to/DistantWorlds

Purrple Cat – Alien Sky
Provided by Lofi Records
Watch:    • Purrple Cat – Alien Sky  
Download/Stream: https://fanlink.to/DistantWorlds

👀 Don't mind that random appearance of a Discord link at 06:17...

#SpaceCommand #Pycord #Digiwind #SpaceSlashCommand #DiscordSpaceCommand