class UsersAPI

export declare class UsersAPI

Constructors

constructor(
rest: REST
)

Constructs a new instance of the UsersAPI class

createDM(
userId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIChannel>

Opens a new DM channel with a user

See also: https://discord.com/developers/docs/resources/user#create-dm

editCurrentGuildMember(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIGuildMember>

Edits the guild member for the current user

See also: https://discord.com/developers/docs/resources/guild#modify-current-member

get(
userId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIUser>

Fetches a user by their id

See also: https://discord.com/developers/docs/resources/user#get-user

getApplicationRoleConnection(
applicationId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIApplicationRoleConnection>

Gets the current user's active application role connection

See also: https://discord.com/developers/docs/resources/user#get-user-application-role-connection

getConnections(
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPICurrentUserConnectionsResult>

Gets the current user's connections

See also: https://discord.com/developers/docs/resources/user#get-user-connections

getCurrent(
options?: Pick<RequestData, 'signal'>
) : Promise<APIUser>

Returns the user object of the requester's account

See also: https://discord.com/developers/docs/resources/user#get-current-user

getGuildMember(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIGuildMember>

Fetches the guild member for the current user

See also: https://discord.com/developers/docs/resources/user#get-current-user-guild-member

Returns a list of partial guild objects the current user is a member of

See also: https://discord.com/developers/docs/resources/user#get-current-user-guilds

leaveGuild(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Leaves the guild with the given id

See also: https://discord.com/developers/docs/resources/user#leave-guild

updateApplicationRoleConnection() : Promise<APIApplicationRoleConnection>

Updates the current user's application role connection

See also: https://discord.com/developers/docs/resources/user#update-user-application-role-connection