Search...

UsersAPI

export declare class UsersAPI 
export declare class UsersAPI 

No summary provided.

constructor(rest)

Constructs a new instance of the UsersAPI class
NameTypeOptionalDescription
restRESTNoNone

createDM(userId, { signal }?)

:

Promise<import("discord-api-types/v10").APIChannel>

Opens a new DM channel with a user
NameTypeOptionalDescription
userIdSnowflakeNoThe id of the user to open a DM channel with
{ signal }Pick<RequestData, 'signal'>YesNone

edit(body, { signal }?)

:

Promise<import("discord-api-types/v10").APIUser>

NameTypeOptionalDescription
bodyRESTPatchAPICurrentUserJSONBodyNoThe new data for the current user
{ signal }Pick<RequestData, 'signal'>YesNone

editCurrentGuildMember(guildId, body?, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIGuildMember>

Edits the guild member for the current user
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
bodyRESTPatchAPIGuildMemberJSONBodyYesThe new data for the guild member
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

get(userId, { signal }?)

:

Promise<import("discord-api-types/v10").APIUser>

NameTypeOptionalDescription
userIdSnowflakeNoThe id of the user to fetch
{ signal }Pick<RequestData, 'signal'>YesNone

getApplicationRoleConnection(applicationId, { signal }?)

:

Promise<import("discord-api-types/v10").APIApplicationRoleConnection>

Gets the current user's active application role connection
NameTypeOptionalDescription
applicationIdSnowflakeNoThe id of the application
{ signal }Pick<RequestData, 'signal'>YesNone

getConnections({ signal }?)

:

Promise<RESTGetAPICurrentUserConnectionsResult>

NameTypeOptionalDescription
{ signal }Pick<RequestData, 'signal'>YesNone

getCurrent({ signal }?)

:

Promise<import("discord-api-types/v10").APIUser>

Returns the user object of the requester's account
NameTypeOptionalDescription
{ signal }Pick<RequestData, 'signal'>YesNone

getGuildMember(guildId, { signal }?)

:

Promise<import("discord-api-types/v10").APIGuildMember>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
{ signal }Pick<RequestData, 'signal'>YesNone

getGuilds(query?, { signal }?)

:

Promise<RESTGetAPICurrentUserGuildsResult>

Returns a list of partial guild objects the current user is a member of
NameTypeOptionalDescription
queryRESTGetAPICurrentUserGuildsQueryYesThe query options to use when fetching the current user's guilds
{ signal }Pick<RequestData, 'signal'>YesNone

leaveGuild(guildId, { signal }?)

:

Promise<void>

Leaves the guild with the given id
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
{ signal }Pick<RequestData, 'signal'>YesNone

updateApplicationRoleConnection(applicationId, body, { signal }?)

:

Promise<import("discord-api-types/v10").APIApplicationRoleConnection>

Updates the current user's application role connection
NameTypeOptionalDescription
applicationIdSnowflakeNoThe id of the application
bodyRESTPutAPICurrentUserApplicationRoleConnectionJSONBodyNoThe data to use when updating the application role connection
{ signal }Pick<RequestData, 'signal'>YesNone