Discord Elixir v1.1.18 DiscordEx.RestClient.Resources.User View Source

Convience helper for user resource

Link to this section Summary

Functions

Get all user connections

Create direct message channel for user

Get currrent user

Get user direct message channels

Get user data for a specific user id

Current user guilds

User login that returns connection

User logout which kills the connection process

Modify the current user

Query users with results from mutual guilds

Link to this section Functions

Link to this function connections(conn) View Source
connections(pid()) :: list()

Get all user connections

Parameters

  • conn: User connection for REST holding auth info

Examples

User.connections(conn)
Link to this function create_dm_channel(conn, recipient_id) View Source
create_dm_channel(pid(), number()) :: map()

Create direct message channel for user

Parameters

  • conn: User connection for REST holding auth info
  • recipient_id: The user id in which a direct message channel should be open

Examples

User.create_dm_channel(conn, 9999991384736571)
Link to this function current(conn) View Source
current(pid()) :: map()

Get currrent user

Parameters

  • conn: User connection for REST holding auth info

Examples

User.current(conn)
Link to this function dm_channels(conn) View Source
dm_channels(pid()) :: map()

Get user direct message channels

Parameters

  • conn: User connection for REST holding auth info

Examples

User.dm_channels(conn)
Link to this function get(conn, user_id) View Source
get(pid(), number()) :: map()

Get user data for a specific user id

Parameters

  • conn: User connection for REST holding auth info
  • user_id: User ID

Examples

User.get(conn, 329230923902390)
Link to this function guilds(conn) View Source
guilds(pid()) :: list()

Current user guilds

Parameters

  • conn: User connection for REST holding auth info

Examples

User.guilds(conn)
Link to this function leave_guild(conn, guild_id) View Source
leave_guild(pid(), number()) :: nil

Leave guild

Parameters

  • conn: User connection for REST holding auth info
  • guild_id: The identifier for the guild in which the user wishes to leave

Examples

User.guilds(conn, 81323847812384)
Link to this function login(email, password) View Source
login(String.t(), String.t()) :: map()

User login that returns connection

Parameters

  • email: User’s email
  • password: User’s password

Examples

User.login("user39023@discordapp.com","password")
#=> {:ok, #PID<0.200.0>}
Link to this function logout(conn) View Source
logout(pid()) :: atom()

User logout which kills the connection process

Parameters

  • conn: User connection for REST holding auth info

Examples

User.logout(conn)
#=> :ok
Link to this function modify(conn, options) View Source
modify(pid(), map()) :: map()

Modify the current user

Parameters

  • conn: User connection for REST holding auth info
  • options: Updateable options which include (username, avatar) and email, password.

Examples

User.modify(conn, %{username: "SuperUserKato", email: "superuserkato@discordapp.com", password: "password"})
Link to this function query(conn, username, limit \\ 25) View Source
query(pid(), String.t(), number()) :: list()

Query users with results from mutual guilds

Parameters

  • conn: User connection for REST holding auth info
  • username: Nick of user who you are looking up
  • limit: How many results to return. (default: 25)

Examples

User.query(conn, "tontoXL3902", 10)