struct Discord::User
- Discord::User
- Struct
- Value
- Object
Defined in:
discordcr/mappings/user.crConstructors
Instance Method Summary
- #avatar : Union(String, Nil)
- #avatar=(_avatar : Union(String, Nil))
-
#avatar_url(size : Int32 = 128)
Produces a CDN URL to this user's avatar in the given
size
. -
#avatar_url(format : CDN::UserAvatarFormat, size : Int32 = 128)
Produces a CDN URL to this user's avatar, in the given
format
andsize
. - #bot : Union(Bool, Nil)
- #bot=(_bot : Union(Bool, Nil))
- #discriminator : String
- #discriminator=(_discriminator : String)
- #email : Union(String, Nil)
- #email=(_email : Union(String, Nil))
- #flags : Union(UserFlags, Nil)
- #flags=(_flags : Union(UserFlags, Nil))
- #id : Snowflake
- #id=(_id : Snowflake)
- #member : Union(PartialGuildMember, Nil)
- #member=(_member : Union(PartialGuildMember, Nil))
-
#mention
Produces a string to mention this user in a message
- #mfa_enabled : Union(Bool, Nil)
- #mfa_enabled=(_mfa_enabled : Union(Bool, Nil))
- #system : Union(Bool, Nil)
- #system=(_system : Union(Bool, Nil))
- #to_json(json : JSON::Builder)
- #username : String
- #username=(_username : String)
- #verified : Union(Bool, Nil)
- #verified=(_verified : Union(Bool, Nil))
Constructor Detail
Instance Method Detail
def avatar_url(size : Int32 = 128)
#
Produces a CDN URL to this user's avatar in the given size
.
If the user has an avatar a WebP will be returned, or a GIF
if the avatar is animated. If the user has no avatar, a default
avatar URL is returned.
Produces a CDN URL to this user's avatar, in the given format
and
size
. If the user has no avatar, a default avatar URL is returned.