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
Leave guild
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
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)
Get currrent user
Parameters
- conn: User connection for REST holding auth info
Examples
User.current(conn)
Get user direct message channels
Parameters
- conn: User connection for REST holding auth info
Examples
User.dm_channels(conn)
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)
Current user guilds
Parameters
- conn: User connection for REST holding auth info
Examples
User.guilds(conn)
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)
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>}
User logout which kills the connection process
Parameters
- conn: User connection for REST holding auth info
Examples
User.logout(conn)
#=> :ok
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)