UsersAPI
export declare class UsersAPI
export 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, { signal }?)
:
Promise<import("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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
edit(body, { signal }?)
:
Promise<import("discord-api-types/v10").APIUser>
Edits the current user
Name | Type | Optional | Description |
---|---|---|---|
body | RESTPatchAPICurrentUserJSONBody | No | The new data for the current user |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
editCurrentGuildMember(guildId, body?, { reason, signal }?)
:
Promise<import("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 |
body | RESTPatchAPIGuildMemberJSONBody | Yes | The new data for the guild member |
{ reason, signal } | Pick<RequestData, 'reason' | 'signal'> | Yes | None |
get(userId, { signal }?)
:
Promise<import("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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getApplicationRoleConnection(applicationId, { signal }?)
:
Promise<import("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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getConnections({ signal }?)
:
Promise<RESTGetAPICurrentUserConnectionsResult>
Gets the current user's connections
Name | Type | Optional | Description |
---|---|---|---|
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getCurrent({ signal }?)
:
Promise<import("discord-api-types/v10").APIUser>
Returns the user object of the requester's account
Name | Type | Optional | Description |
---|---|---|---|
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getGuildMember(guildId, { signal }?)
:
Promise<import("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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getGuilds(query?, { signal }?)
:
Promise<RESTGetAPICurrentUserGuildsResult>
Returns a list of partial guild objects the current user is a member of
Name | Type | Optional | Description |
---|---|---|---|
query | RESTGetAPICurrentUserGuildsQuery | Yes | The query options to use when fetching the current user's guilds |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
leaveGuild(guildId, { signal }?)
:
Promise<void>
Leaves the guild with the given id
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
updateApplicationRoleConnection(applicationId, body, { signal }?)
:
Promise<import("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 |
body | RESTPutAPICurrentUserApplicationRoleConnectionJSONBody | No | The data to use when updating the application role connection |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |