alchemy v0.1.9 Alchemy.User

Represents a discord user. The default values exist to cover missing fields.

  • id

    represents a unique client id

  • username

    represents a client’s current username

  • discriminator

    4 digit tag to differenciate usernames

  • avatar

    A string representing their avatar hash. Use avatar_url to get the corresponding url from a User object

  • bot

    Whether 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.

  • verified

    Whether the account is verified - default: :hidden

  • email

    The user’s email - default: :hidden

Summary

Functions

Used to get the url for a user’s avatar

Types

t :: %Alchemy.User{avatar: String.t, bot: Boolean, discriminator: String.t, email: :hidden | String.t, id: String.t, username: String.t, verified: :hidden | Boolean}

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)

Specs

avatar_url(Alchemy.User.t, String.t, Integer) :: url