alchemy v0.6.3 Alchemy.User
This module contains functions and types related to discord users.
Link to this section Summary
Types
Represents a discord User. The default values exist to cover missing fields.
A shortened version of a Guild struct, through the view of a User.
Functions
Used to get the url for a user's avatar
Returns a string that mentions a user when used in a message
Link to this section Types
snowflake()
snowflake() :: String.t()
snowflake() :: String.t()
Represents a discord User. The default values exist to cover missing fields.
idrepresents a unique user id
usernamerepresents a user's current username
discriminator4 digit tag to differenciate usernames
avatarA string representing their avatar hash. Use
avatar_urlto get the corresponding url from aUserobjectbotWhether or not the user is a bot - default:
false
A bot usually doesn't have the authorization necessary to access these 2, so they're usually missing.
verifiedWhether the account is verified - default:
:hiddenemailThe user's email - default:
:hidden
token()
token() :: String.t()
token() :: String.t()
url()
url() :: String.t()
url() :: String.t()
user_guild()
A shortened version of a Guild struct, through the view of a User.
idRepresents the guild's id.
nameRepresents the guild's name.
iconA string representing the guild's icon hash.
ownerWhether the user linked to the guild owns it.
permissionsBitwise of the user's enabled/disabled permissions.
Link to this section Functions
avatar_url(user)
Used to get the url for a user's avatar
type must be one of "png", "webp", "jpg", "gif"
size must be one of 128, 256, 512, 1024, 2048
Examples
> User.avatar_url(user)
https://cdn.discordapp.com/avatars/...
avatar_url(user, type, size)
avatar_url(Alchemy.User.t(), String.t(), Integer) :: url()
avatar_url(Alchemy.User.t(), String.t(), Integer) :: url()
mention(user)
Returns a string that mentions a user when used in a message