ajout exeption api rate limited
This commit is contained in:
parent
331d4623a4
commit
0b186bd7ec
1 changed files with 5 additions and 3 deletions
|
@ -118,8 +118,10 @@ def getChangelogs(version = 'latest'):
|
||||||
version = f'tags/v{version}'
|
version = f'tags/v{version}'
|
||||||
changements = requests.get(f"https://api.github.com/repos/Confrerie-du-Kassoulait/KassouBot/releases/{version}").json()
|
changements = requests.get(f"https://api.github.com/repos/Confrerie-du-Kassoulait/KassouBot/releases/{version}").json()
|
||||||
try:
|
try:
|
||||||
changements["message"] # renvois None si aucune version correspondante n'a été trouvée
|
if changements["message"].startswith("API"): # renvois 0 si c'est une erreur API
|
||||||
|
return 0
|
||||||
|
else: # renvois None si aucune version correspondante n'a été trouvée
|
||||||
return None
|
return None
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
return (changements["html_url"], changements["tag_name"][1:], changements["body"])
|
return [changements["html_url"], changements["tag_name"][1:], changements["body"]]
|
||||||
|
|
Reference in a new issue