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)

:

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

edit(user)

:

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

NameTypeOptionalDescription
userRESTPatchAPICurrentUserJSONBodyNoThe new data for the current user

editGuildMember(guildId, member?, reason?)

:

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

Edits the guild member for the current user
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
memberRESTPatchAPIGuildMemberJSONBodyYesThe new data for the guild member
reasonstringYesThe reason for editing this guild member

get(userId)

:

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

NameTypeOptionalDescription
userIdSnowflakeNoThe id of the user to fetch

getApplicationRoleConnection(applicationId)

:

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

Gets the current user's active application role connection
NameTypeOptionalDescription
applicationIdSnowflakeNoThe id of the application

getConnections()

:

Promise<RESTGetAPICurrentUserConnectionsResult>

getCurrent()

:

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

Returns the user object of the requester's account

getGuildMember(guildId)

:

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

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild

getGuilds(options?)

:

Promise<RESTGetAPICurrentUserGuildsResult>

Returns a list of partial guild objects the current user is a member of
NameTypeOptionalDescription
optionsRESTGetAPICurrentUserGuildsQueryYesThe options to use when fetching the current user's guilds

leaveGuild(guildId)

:

Promise<void>

Leaves the guild with the given id
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild

updateApplicationRoleConnection(applicationId, options)

:

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

Updates the current user's application role connection
NameTypeOptionalDescription
applicationIdSnowflakeNoThe id of the application
optionsRESTPutAPICurrentUserApplicationRoleConnectionJSONBodyNoThe options to use when updating the application role connection