mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Gif avatars for user cards
This commit is contained in:
parent
309d2de7c7
commit
aa5a4fa79a
@ -140,7 +140,7 @@ def get_online_embed_users(guild_id):
|
||||
'username': usrdb.username,
|
||||
'nickname': usrdb.nickname,
|
||||
'discriminator': usrdb.discriminator,
|
||||
'avatar_url': generate_avatar_url(usrdb.user_id, usrdb.avatar),
|
||||
'avatar_url': generate_avatar_url(usrdb.user_id, usrdb.avatar, "0000", True),
|
||||
}
|
||||
users['authenticated'].append(meta)
|
||||
return users
|
||||
|
@ -95,8 +95,10 @@ def check_user_permission(guild_id, id):
|
||||
return user_has_permission(guild['permissions'], id) or guild['owner']
|
||||
return False
|
||||
|
||||
def generate_avatar_url(id, av, discrim="0000"):
|
||||
def generate_avatar_url(id, av, discrim="0000", allow_animate=False):
|
||||
if av:
|
||||
if allow_animate && str(av).startswith("a_"):
|
||||
return avatar_base_url + str(id) + '/' + str(av) + '.gif'
|
||||
return avatar_base_url + str(id) + '/' + str(av) + '.png'
|
||||
else:
|
||||
default_av = [0, 1, 2, 3, 4]
|
||||
|
Loading…
Reference in New Issue
Block a user