Handle cases efficiently when user avatar hash is None. Add method to return Discord default avatar url equivalent.

This commit is contained in:
thec0sm0s
2020-06-02 13:15:00 +05:30
parent f5be182c2f
commit 1fc91d24c2
4 changed files with 16 additions and 3 deletions

View File

@@ -50,7 +50,8 @@ def me():
<head>
<title>{user.name}</title>
</head>
<body><img src='{user.avatar_url}' />
<body><img src='{user.avatar_url or user.default_avatar_url}' />
<p>Is avatar animated: {str(user.is_avatar_animated)}</p>
<a href={url_for("my_connections")}>Connections</a>
<br />
</body>