UsersAPI
declare class UsersAPI
declare class UsersAPI
No summary provided.
constructor(rest)
Constructs a new instance of the
UsersAPI
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
createDM(userId)
:
Promise<discord_api_types_v10.APIChannel>
Opens a new DM channel with a user
Name | Type | Optional | Description |
---|---|---|---|
userId | Snowflake | No | The id of the user to open a DM channel with |
edit(user)
:
Promise<discord_api_types_v10.APIUser>
Edits the current user
Name | Type | Optional | Description |
---|---|---|---|
user | RESTPatchAPICurrentUserJSONBody | No | The new data for the current user |
editGuildMember(guildId, member?, reason?)
:
Promise<discord_api_types_v10.APIGuildMember>
Edits the guild member for the current user
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
member | RESTPatchAPIGuildMemberJSONBody | Yes | The new data for the guild member |
reason | string | Yes | The reason for editing this guild member |
get(userId)
:
Promise<discord_api_types_v10.APIUser>
Fetches a user by their id
Name | Type | Optional | Description |
---|---|---|---|
userId | Snowflake | No | The id of the user to fetch |
getApplicationRoleConnection(applicationId)
:
Promise<discord_api_types_v10.APIApplicationRoleConnection>
Gets the current user's active application role connection
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The id of the application |
getConnections()
:
Promise<RESTGetAPICurrentUserConnectionsResult>
Gets the current user's connections
getCurrent()
:
Promise<discord_api_types_v10.APIUser>
Returns the user object of the requester's account
getGuildMember(guildId)
:
Promise<discord_api_types_v10.APIGuildMember>
Fetches the guild member for the current user
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
getGuilds(options?)
:
Promise<RESTGetAPICurrentUserGuildsResult>
Returns a list of partial guild objects the current user is a member of
Name | Type | Optional | Description |
---|---|---|---|
options | RESTGetAPICurrentUserGuildsQuery | Yes | The options to use when fetching the current user's guilds |
leaveGuild(guildId)
:
Promise<void>
Leaves the guild with the given id
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
setVoiceState(guildId, options?)
:
Promise<never>
Sets the voice state for the current user
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
options | RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody | Yes | The options to use when setting the voice state |
updateApplicationRoleConnection(applicationId, options)
:
Promise<discord_api_types_v10.APIApplicationRoleConnection>
Updates the current user's application role connection
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The id of the application |
options | RESTPutAPICurrentUserApplicationRoleConnectionJSONBody | No | The options to use when updating the application role connection |