Skip to content

Class: UserEndpoint ​

Defined in: endpoints/user.ts:18

Constructors ​

Constructor ​

ts
new UserEndpoint(client): UserEndpoint;

Defined in: endpoints/user.ts:19

Parameters ​

ParameterType
clientRESTClient

Returns ​

UserEndpoint

Methods ​

deleteAccount() ​

ts
deleteAccount(currentPassword?): Promise<IDeleteUserResponse>;

Defined in: endpoints/user.ts:95

Delete the signed-in account. An account with an email sign-in must confirm it with currentPassword.

Parameters ​

ParameterType
currentPassword?string

Returns ​

Promise<IDeleteUserResponse>


disableTurbo() ​

ts
disableTurbo(): Promise<IUpdateUserResponse>;

Defined in: endpoints/user.ts:48

Disable your Turbo status without changing your appearance preferences.

Returns ​

Promise<IUpdateUserResponse>


getOwnBadges() ​

ts
getOwnBadges(): Promise<IOwnBadgesResponse>;

Defined in: endpoints/user.ts:80

every badge you hold, including ones you have hidden

Returns ​

Promise<IOwnBadgesResponse>


getProfile() ​

ts
getProfile(userId): Promise<IUserProfileResponse>;

Defined in: endpoints/user.ts:30

Someone's whole profile: bio, colours, CSS, badges, and the servers and friends you have in common. Badges from a server are included only when you are in that server too.

Parameters ​

ParameterType
userIdnumber

Returns ​

Promise<IUserProfileResponse>


getUserProfile() ​

ts
getUserProfile(userId): Promise<IGetUserResponse>;

Defined in: endpoints/user.ts:21

Parameters ​

ParameterType
userIdnumber

Returns ​

Promise<IGetUserResponse>


markBadgesSeen() ​

ts
markBadgesSeen(badgeIds): Promise<IApiResponse>;

Defined in: endpoints/user.ts:90

the "badge unlocked" popup has been shown for these, so no device shows it again

Parameters ​

ParameterType
badgeIdsnumber[]

Returns ​

Promise<IApiResponse>


searchUsers() ​

ts
searchUsers(query): Promise<ISearchUsersResponse>;

Defined in: endpoints/user.ts:99

Parameters ​

ParameterType
querystring

Returns ​

Promise<ISearchUsersResponse>


setBadgeHidden() ​

ts
setBadgeHidden(badgeId, hidden): Promise<IOwnBadgeResponse>;

Defined in: endpoints/user.ts:85

show or hide a badge you were given on your profile

Parameters ​

ParameterType
badgeIdnumber
hiddenboolean

Returns ​

Promise<IOwnBadgeResponse>


unlockTurbo() ​

ts
unlockTurbo(): Promise<IUpdateUserResponse>;

Defined in: endpoints/user.ts:43

Unlock the Turbo Pro Max easter egg. No payment or application text is sent.

Returns ​

Promise<IUpdateUserResponse>


updateStatus() ​

ts
updateStatus(params): Promise<IUpdateUserStatusResponse>;

Defined in: endpoints/user.ts:56

Your status as everyone else sees it, and its message. Idle, do not disturb and offline (invisible) are kept for when you next connect; online clears that.

Parameters ​

ParameterType
params{ activeStatus?: IUserStatus; statusEmoji?: string | null; statusMessage?: string | null; }
params.activeStatus?IUserStatus
params.statusEmoji?string | null
params.statusMessage?string | null

Returns ​

Promise<IUpdateUserStatusResponse>


updateUserPreferences() ​

ts
updateUserPreferences(preferences, options?): Promise<IUpdateUserPreferencesResponse>;

Defined in: endpoints/user.ts:65

Bind queued saves to their original session, even if the client's token changes.

Parameters ​

ParameterType
preferencesIClientPreferences
options?{ signal?: AbortSignal; token?: string; }
options.signal?AbortSignal
options.token?string

Returns ​

Promise<IUpdateUserPreferencesResponse>


updateUserProfile() ​

ts
updateUserProfile(params): Promise<IUpdateUserResponse>;

Defined in: endpoints/user.ts:38

Change your own profile. Fields left out are unchanged; null clears one. Pictures are pending media ids from api.media.uploadMediaFile.

Parameters ​

ParameterType
paramsIProfileUpdate

Returns ​

Promise<IUpdateUserResponse>

Released under the GNU Affero General Public License v3.0.