I saw this question on stackoverflow: Testing if discord invite link is invalid?, but it's a year old and some of the modules don't exist in Python 3.
I've tried doing (the invite here is invalid): I expected a 404 not found error:
import urllib.request
content = urllib.request.urlopen('https://discord.gg/UWxaV8m').read()
print(content)
But, that gives me an error: urllib.error.HTTPError: HTTP Error 403: Forbidden; are there other ways of doing this? Also, looking at the error: it looks like I'm not allowed to access that invite because I'm a bot user? idk