From d38ce103797b871ceeb99264cf0043e77122a92c Mon Sep 17 00:00:00 2001 From: Fedor Lapshin Date: Mon, 3 Jul 2023 17:57:36 +0300 Subject: [PATCH] refactor: rename AvatarIndex to DefaultAvatarIndex --- user.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user.go b/user.go index b13cc54af..0a4cbb584 100644 --- a/user.go +++ b/user.go @@ -113,7 +113,7 @@ func (u *User) Mention() string { func (u *User) AvatarURL(size string) string { return avatarURL( u.Avatar, - EndpointDefaultUserAvatar(u.AvatarIndex()), + EndpointDefaultUserAvatar(u.DefaultAvatarIndex()), EndpointUserAvatar(u.ID, u.Avatar), EndpointUserAvatarAnimated(u.ID, u.Avatar), size, @@ -134,8 +134,8 @@ func (u *User) isMigrated() bool { return u.Discriminator == "" || u.Discriminator == "0" } -// AvatarIndex returns the index of the user's avatar -func (u *User) AvatarIndex() uint64 { +// DefaultAvatarIndex returns the index of the user's default avatar. +func (u *User) DefaultAvatarIndex() uint64 { if u.isMigrated() { id, _ := strconv.ParseUint(u.ID, 10, 64) return (id >> 22) % 6