Skip to content

Commit

Permalink
Output Guild name to log (#1557)
Browse files Browse the repository at this point in the history
* Please for the love of god work now

* Remove unused import

* I think I got it now

* Make it a bit fancier

* Output Guild Name in Log

---------

Co-authored-by: DoJapHD <[email protected]>
Co-authored-by: DoJapHD <[email protected]>
  • Loading branch information
3 people authored Dec 26, 2024
1 parent c07d5b1 commit 2378768
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/actions/validate-manifest/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,22 @@ def check_discord_invite(url: str):
request = requests.get(f'https://discord.com/api/v9/invites/{invite}')
if request.status_code == 200:
print(f'Invite for {invite} was successful.')

response_data = request.json()
guild_data = response_data.get('guild', {})
if isinstance(guild_data, dict):
guild_name = guild_data.get('name', 'Unknown Guild')
else:
guild_name = 'Unknown Guild'
print(f'Guild name: {guild_name}')

return True
else:
print(f'Invite for {invite} was invalid .')
print(f'Invite for {invite} was invalid.')
return False
except requests.exceptions.ConnectionError:
print(f'Discord seems to be down while checking. Please check manually\n')
return False

if __name__ == '__main__':
main()
main()

0 comments on commit 2378768

Please sign in to comment.