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, options?):Promise<APIChannel>
Opens a new DM channel with a user
NameTypeOptionalDescription
userIdSnowflakeNo
The id of the user to open a DM channel with
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for opening the DM
edit(body, options?):Promise<APIUser>
NameTypeOptionalDescription
bodyRESTPatchAPICurrentUserJSONBodyNo
The new data for the current user
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for editing the user
editCurrentGuildMember(guildId, body?, options?):Promise<APIGuildMember>
Edits the guild member for the current user
NameTypeOptionalDescription
guildIdSnowflakeNo
The id of the guild
bodyRESTPatchAPIGuildMemberJSONBodyYes
The new data for the guild member
optionsPick<RequestData, 'auth' | 'reason' | 'signal'>Yes
The options for editing the guild member
get(userId, options?):Promise<APIUser>
NameTypeOptionalDescription
userIdSnowflakeNo
The id of the user to fetch
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for fetching the user
getApplicationRoleConnection(applicationId, options?):Promise<APIApplicationRoleConnection>
Gets the current user's active application role connection
NameTypeOptionalDescription
applicationIdSnowflakeNo
The id of the application
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for fetching the role connections
NameTypeOptionalDescription
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for fetching the user's connections
getCurrent(options?):Promise<APIUser>
Returns the user object of the requester's account
NameTypeOptionalDescription
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for fetching the current user
getGuildMember(guildId, options?):Promise<APIGuildMember>
NameTypeOptionalDescription
guildIdSnowflakeNo
The id of the guild
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for fetching the guild member
getGuilds(query?, options?):Promise<RESTGetAPICurrentUserGuildsResult>
Returns a list of partial guild objects the current user is a member of
NameTypeOptionalDescription
queryRESTGetAPICurrentUserGuildsQueryYes
The query options for fetching the current user's guilds
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for fetching the guilds
leaveGuild(guildId, options?):Promise<void>
Leaves the guild with the given id
NameTypeOptionalDescription
guildIdSnowflakeNo
The id of the guild
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for leaving the guild
updateApplicationRoleConnection(applicationId, body, options?):Promise<APIApplicationRoleConnection>
Updates the current user's application role connection
NameTypeOptionalDescription
applicationIdSnowflakeNo
The id of the application
bodyRESTPutAPICurrentUserApplicationRoleConnectionJSONBodyNo
The data for updating the application role connection
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for updating the application role connection