mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-04-03 07:31:56 +02: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,
|
'username': usrdb.username,
|
||||||
'nickname': usrdb.nickname,
|
'nickname': usrdb.nickname,
|
||||||
'discriminator': usrdb.discriminator,
|
'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)
|
users['authenticated'].append(meta)
|
||||||
return users
|
return users
|
||||||
|
@ -95,8 +95,10 @@ def check_user_permission(guild_id, id):
|
|||||||
return user_has_permission(guild['permissions'], id) or guild['owner']
|
return user_has_permission(guild['permissions'], id) or guild['owner']
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def generate_avatar_url(id, av, discrim="0000"):
|
def generate_avatar_url(id, av, discrim="0000", allow_animate=False):
|
||||||
if av:
|
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'
|
return avatar_base_url + str(id) + '/' + str(av) + '.png'
|
||||||
else:
|
else:
|
||||||
default_av = [0, 1, 2, 3, 4]
|
default_av = [0, 1, 2, 3, 4]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user