fix invalid urls
This commit is contained in:
7
main.py
7
main.py
@@ -69,6 +69,13 @@ async def picable(interaction: Interaction, owner: str, repository: str):
|
||||
url = f"https://api.github.com/repos/{owner}/{repository}"
|
||||
headers = {"Authorization": f"token {github_token}"}
|
||||
response = requests.get(url, headers=headers)
|
||||
|
||||
if not response.status_code == 200:
|
||||
await interaction.followup.send(
|
||||
f"Invalid Repository. Please check the repository name and owner and try again. :x:"
|
||||
)
|
||||
return
|
||||
|
||||
response.raise_for_status()
|
||||
repo_info = response.json()
|
||||
repository_size_kb = repo_info["size"]
|
||||
|
||||
Reference in New Issue
Block a user