{"id":13288286,"url":"https://github.com/0xtaufeeq/Astronomy-Discord-Bot","last_synced_at":"2025-03-10T06:33:20.826Z","repository":{"id":104888825,"uuid":"389537502","full_name":"0xtaufeeq/Astronomy-Discord-Bot","owner":"0xtaufeeq","description":"Astronomy-Discord-Bot is an open-source Discord Bot that automatically sends \"Astronomy Picture Of The Day\" and posts it in a channel on your server. Each day a different image or photograph of our universe is featured, along with a brief explanation written by a professional astronomer. Astronomy Picture of the Day is provided by NASA and Michigan Technological University.","archived":false,"fork":false,"pushed_at":"2021-08-29T20:02:10.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-15T10:45:39.583Z","etag":null,"topics":["astronomy","astrophysics","discord","discord-bot","discord-py","discordpy","hacktoberfest","hacktoberfest2022","nasa-api","nasa-apod","python"],"latest_commit_sha":null,"homepage":"https://taufeeq.team","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xtaufeeq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-26T06:54:30.000Z","updated_at":"2024-07-15T10:45:50.480Z","dependencies_parsed_at":null,"dependency_job_id":"ac75be95-64e8-44a6-81b2-df720e19e934","html_url":"https://github.com/0xtaufeeq/Astronomy-Discord-Bot","commit_stats":null,"previous_names":["0xtaufeeq/astronomy-discord-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xtaufeeq%2FAstronomy-Discord-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xtaufeeq%2FAstronomy-Discord-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xtaufeeq%2FAstronomy-Discord-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xtaufeeq%2FAstronomy-Discord-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xtaufeeq","download_url":"https://codeload.github.com/0xtaufeeq/Astronomy-Discord-Bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242805420,"owners_count":20187995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","astrophysics","discord","discord-bot","discord-py","discordpy","hacktoberfest","hacktoberfest2022","nasa-api","nasa-apod","python"],"created_at":"2024-07-29T16:56:17.508Z","updated_at":"2025-03-10T06:33:20.429Z","avatar_url":"https://github.com/0xtaufeeq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astronomy-Discord-Bot\n\n# Code\n\n```py\nfrom os import name\nimport discord\nimport aiohttp\nimport requests\nfrom discord_components import*\nfrom discord import flags\nfrom discord.ext import commands, tasks\n\nclient = commands.Bot(command_prefix=commands.when_mentioned_or('.'))\nclient.remove_command('help')\n\naopdkey = \"AOPDKEY\"\n\n@client.command()\nasync def apod(ctx):\n    client.ses = aiohttp.ClientSession()\n    url = f'https://api.nasa.gov/planetary/apod?api_key={aopdkey}'\n    async with client.ses.get(url) as r:\n        if r.status in range(200, 299):\n            data = await r.json()\n            url = data['url']\n            imgtitle = data['title']\n            imgdate = data['date']\n            explanation = data['explanation']\n            ogimg = data['hdurl']\n            credit = data['copyright']\n            embed = discord.Embed(\n                title='🌠 Astronomy Picture Of The Day',\n                description=f'**Date -** {imgdate}', color = 000000, timestamp=ctx.message.created_at).set_image(\n                url=url).add_field(name=imgtitle, \n                value=f'**Explaination - **\\n{explanation}').add_field(name='Original Image -',\n                value=f'[Click Here]({ogimg})',inline=False).add_field(name='Image Credit \u0026 Copyright -',\n                value=credit).set_footer(text=\"Requested by: {}\".format(ctx.author.display_name))\n            await ctx.send(embed=embed, \n                        components=[\n                            Button(style=ButtonStyle.URL, label='View in browser', url='https://apod.nasa.gov/apod/astropix.html')\n                            ],\n                            \n                        )\n           \n@client.event\nasync def on_ready():\n    DiscordComponents(client)\n    \n    print(f'{client.user} has connected to Discord!')\n\nclient.run('BOT-TOKEN')```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xtaufeeq%2FAstronomy-Discord-Bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xtaufeeq%2FAstronomy-Discord-Bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xtaufeeq%2FAstronomy-Discord-Bot/lists"}