src/cogs/apis.py
async def apod(self, ctx, date=None):
        """Show the Astronomical Picture of the Day.

        date: yyyy-mm-dd
        Optional date for a specific picture.
        """
        url = f'https://api.nasa.gov/planetary/apod?api_key={nasa_api_key}'

        if date is not None:
            url += f'&date={date}'

        data, status = await self.get_data(url)

        if data and status:
            return await ctx.reply(f"{status}: {data['msg']}")

        if data['media_type'] == 'image':
            embed = discord.Embed(
                title=f"{data['title']}",
                colour=discord.Colour.blurple()
            )
            embed.set_image(url=data['url'])

            if 'copyright' in data:
                embed.set_footer(
                    text=f"Image Credit & Copyright: {data['copyright']}"
                    )
            else:
                embed.set_footer(text='Public Domain')
            return await ctx.send(embed=embed)

        if data['media_type'] == 'video' and 'youtube' in data['url']:
            url = re.search(
                'https://www.youtube.com/embed/(.*)?rel=0', data['url']
                )
            return await ctx.send(f"https://youtu.be/{url.group(1)}")

        await ctx.send(data['url'])
Show the Astronomical Picture of the Day.

        date: yyyy-mm-dd
        Optional date for a specific picture.
        
Show the Astronomical Picture of the Day.
date: yyyy-mm-dd
Optional date for a specific picture.
Show the Astronomical Picture of the Day . date : yyyy - mm - dd Optional date for a specific picture .
async def apod(self, ctx, date=None):
        url = f'https://api.nasa.gov/planetary/apod?api_key={nasa_api_key}'
        if date is not None:
            url += f'&date={date}'
        data, status = await self.get_data(url)
        if data and status:
            return await ctx.reply(f"{status}: {data['msg']}")
        if data['media_type'] == 'image':
            embed = discord.Embed(
                title=f"{data['title']}",
                colour=discord.Colour.blurple()
            )
            embed.set_image(url=data['url'])
            if 'copyright' in data:
                embed.set_footer(
                    text=f"Image Credit & Copyright: {data['copyright']}"
                    )
            else:
                embed.set_footer(text='Public Domain')
            return await ctx.send(embed=embed)
        if data['media_type'] == 'video' and 'youtube' in data['url']:
            url = re.search(
                'https://www.youtube.com/embed/(.*)?rel=0', data['url']
                )
            return await ctx.send(f"https://youtu.be/{url.group(1)}")
        await ctx.send(data['url'])
async def apod ( self , ctx , date = None ) : url = f'https://api.nasa.gov/planetary/apod?api_key={nasa_api_key}' if date is not None : url += f'&date={date}' data , status = await self . get_data ( url ) if data and status : return await ctx . reply ( f"{status}: {data['msg']}" ) if data [ 'media_type' ] == 'image' : embed = discord . Embed ( title = f"{data['title']}" , colour = discord . Colour . blurple ( ) ) embed . set_image ( url = data [ 'url' ] ) if 'copyright' in data : embed . set_footer ( text = f"Image Credit & Copyright: {data['copyright']}" ) else : embed . set_footer ( text = 'Public Domain' ) return await ctx . send ( embed = embed ) if data [ 'media_type' ] == 'video' and 'youtube' in data [ 'url' ] : url = re . search ( 'https://www.youtube.com/embed/(.*)?rel=0' , data [ 'url' ] ) return await ctx . send ( f"https://youtu.be/{url.group(1)}" ) await ctx . send ( data [ 'url' ] )
Show the Astronomical Picture of the Day.
Show the Astronomical Picture of the Day .
"""Show the Astronomical Picture of the Day.

        date: yyyy-mm-dd
        Optional date for a specific picture.
        """
self
ctx
date