Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LoggedInUser

A logged-in Geometry Dash player

Hierarchy

Index

Constructors

constructor

Properties

Protected _creator

_creator: UserCreator

The creator associated with this user

accountID

accountID: number

The player's account ID

cosmetics

cosmetics: UserCosmetics

The player's cosmetics

id

id: number

The player's user ID

permissions

permissions: Permission

The player's permissions

socials

socials: Readonly<Socials>

The player's social media profiles

stats

stats: { coins: { normal: number; user: number }; cp: number; demons: number; diamonds: number; rank: number; stars: number }

The player's stats

Type declaration

  • coins: { normal: number; user: number }

    The coins the player has collected

    • normal: number

      The number of coins in the single-player mode (gold coins) the player has collected

    • user: number

      The number of coins in user-created levels (silver coins) the player has collected

  • cp: number

    The number of creator points the player has earned

  • demons: number

    The number of demons the player has beaten

  • diamonds: number

    The number of diamonds the player has collected

  • rank: number

    The global rank of the player

  • stars: number

    The number of stars the player has collected

username

username: string

The player's username

Methods

acceptFriendRequest

  • Accepts a friend request

    async

    Parameters

    Returns Promise<boolean>

    Whether accepting the friend request was successful

block

  • Block a user

    async

    Parameters

    Returns Promise<boolean>

    Whether the blocking succeeded

cancelFriendRequest

  • Cancels a friend request, deleting it from the server

    async

    Parameters

    Returns Promise<boolean>

    Whether the cancellation was succesful

deleteAccountComment

  • Deletes an account comment from the server

    async

    Parameters

    Returns Promise<boolean>

deleteComment

  • deleteComment(commentID: number, levelID: number | SearchedLevel): Promise<boolean>
  • deleteComment(commentID: LevelComment<User>): Promise<boolean>
  • Deletes a comment from the server

    async

    Parameters

    • commentID: number

      The comment ID to delete

    • levelID: number | SearchedLevel

      The level ID where the comment was posted

    Returns Promise<boolean>

    Whether the comment deletion was successful

  • Deletes a comment from the server

    async

    Parameters

    Returns Promise<boolean>

    Whether the comment deletion was successful

deleteMessage

  • deleteMessage(messageID: SearchedMessage<boolean>): Promise<boolean>
  • deleteMessage(messageID: number, outgoing: boolean): Promise<boolean>
  • Deletes a message from the servers

    async

    Parameters

    Returns Promise<boolean>

    Whether the message deletion was successful

  • Deletes a message from the servers

    async

    Parameters

    • messageID: number
    • outgoing: boolean

      Whether the message is outgoing or not

    Returns Promise<boolean>

    Whether the message deletion was successful

dislike

dislikeAccountComment

  • Dislikes an account comment

    async

    Parameters

    Returns Promise<boolean>

    Whether the disliking succeeded

  • Dislikes an account comment

    async

    Parameters

    • id: number

      The ID of the account comment to dislike

    • accountID: StatlessSearchedUser | User | number

      The account ID of the profile the comment is on

    Returns Promise<boolean>

    Whether the disliking succeeded

dislikeComment

  • Dislikes a comment

    async

    Parameters

    Returns Promise<boolean>

    Whether the disliking succeeded

  • Dislikes a comment

    async

    Parameters

    • id: number

      The ID of the comment to dislike

    • levelID: SearchedLevel | number

      The ID of the level the comment is on

    Returns Promise<boolean>

    Whether the disliking succeeded

dislikeLevel

  • Dislikes a level

    async

    Parameters

    • id: SearchedLevel | number

      The ID of the level to dislike (or the level itself)

    Returns Promise<boolean>

    Whether the disliking succeeded

getAccountComments

  • Get the most recent comment posted to this account's page

    async

    Returns Promise<AccountComment<this>>

    The most recent comment

  • Get the comments posted to this account's page

    async

    Parameters

    • num: number

      The maximum number of comments to get

    Returns Promise<AccountComment<this>[]>

    An array of this user's profile comments

getBlocked

  • Finds the users that have been blocked by this player

    async

    Returns Promise<StatlessSearchedUser[]>

    An array of blocked users

getComments

  • getComments(byLikes?: boolean): Promise<LevelComment<this>>
  • getComments(byLikes: boolean, num: number): Promise<LevelComment<this>[]>
  • Gets the most recent or most liked level comment by the user

    async

    Parameters

    • Optional byLikes: boolean

      Whether to sort by likes or not

    Returns Promise<LevelComment<this>>

    The most recent or most liked comment made by this user

  • Gets the most recent or most liked level comments by the user

    async

    Parameters

    • byLikes: boolean

      Whether to sort by likes or not

    • num: number

      The number of comments to get

    Returns Promise<LevelComment<this>[]>

    An array of the most recent or most liked comments made by this user

getFriendRequests

  • Gets friend requests

    async

    Parameters

    • Optional num: number

      The number of friend requests to get. Default 10.

    • Optional outgoing: false

      Whether to get outgoing or incoming friend requests. Defaults to incoming.

    Returns Promise<IncomingFriendRequest[]>

    The array of friend requests based on the provided parameters

  • Gets friend requests

    async

    Parameters

    • num: number

      The number of friend requests to get. Default 10.

    • outgoing: true

      Whether to get outgoing or incoming friend requests. Defaults to incoming.

    Returns Promise<OutgoingFriendRequest[]>

    The array of friend requests based on the provided parameters

getFriends

  • Finds all friends of this player

    async

    Returns Promise<StatlessSearchedUser[]>

    An array of the player's friends

getFriendsLeaderboard

  • Gets the friends leaderboard

    async

    Returns Promise<SearchedUser[]>

    The leaderboard, with position being index + 1

getFullMessage

  • getFullMessage<T>(messageID: SearchedMessage<T>): Promise<Message<T>>
  • getFullMessage<T>(messageID: number, outgoing: boolean): Promise<Message<T>>
  • Gets the full message from a searched message

    async

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<Message<T>>

    The full message, including the body

  • Gets the full message from a searched message

    async

    Type parameters

    • T: boolean

    Parameters

    • messageID: number

      The message ID to resolve

    • outgoing: boolean

      Whether the message is outgoing or not

    Returns Promise<Message<T>>

    The full message, including the body

getLevels

  • getLevels(): Promise<this extends LoggedInUser ? LoggedInSearchedLevel : SearchedLevel>
  • getLevels(num: number): Promise
  • Gets the most recent level by the user

    async

    Returns Promise<this extends LoggedInUser ? LoggedInSearchedLevel : SearchedLevel>

    The most recent level made by this user

  • Gets the most recentlevels by the user

    async

    Parameters

    • num: number

      The number of levels to get

    Returns Promise

    An array of the most recent levels made by this user

getMessages

  • getMessages(num?: number, outgoing?: false): Promise<SearchedMessage<false>[]>
  • getMessages(num: number, outgoing: true): Promise<SearchedMessage<true>[]>
  • Gets messages sent to or from this user

    async

    Parameters

    • Optional num: number

      The number of messages to get. Defaults to 10.

    • Optional outgoing: false

      Whether to get outgoing or incoming messages. Defaults to incoming.

    Returns Promise<SearchedMessage<false>[]>

    An array of incoming or outgoing messages

  • Gets messages sent to or from this user

    async

    Parameters

    • num: number

      The number of messages to get. Defaults to 10.

    • outgoing: true

      Whether to get outgoing or incoming messages. Defaults to incoming.

    Returns Promise<SearchedMessage<true>[]>

    An array of incoming or outgoing messages

like

likeAccountComment

  • Likes an account comment

    async

    Parameters

    Returns Promise<boolean>

    Whether the liking succeeded

  • Likes an account comment

    async

    Parameters

    • id: number

      The ID of the account comment to like

    • accountID: StatlessSearchedUser | User | number

      The account ID of the profile the comment is on

    Returns Promise<boolean>

    Whether the liking succeeded

likeComment

  • Likes a comment

    async

    Parameters

    Returns Promise<boolean>

    Whether the liking succeeded

  • Likes a comment

    async

    Parameters

    • id: number

      The ID of the comment to like

    • levelID: SearchedLevel | number

      The ID of the level the comment is on

    Returns Promise<boolean>

    Whether the liking succeeded

likeLevel

  • Likes a level

    async

    Parameters

    • id: SearchedLevel | number

      The ID of the level to like (or the level itself)

    Returns Promise<boolean>

    Whether the liking succeeded

markFriendRequestAsRead

  • Mark a friend request as read

    async

    Parameters

    Returns Promise<boolean>

    Whether marking as read was successful or not

postAccountComment

  • Post a comment to this account's page

    async

    Parameters

    • msg: string

      The message to post

    Returns Promise<LoggedInAccountComment>

    The comment that was just created (may not be 100% accurate); null if it failed

postComment

  • Post a comment to a level

    async

    Parameters

    • level: SearchedLevel | number

      The level to post the comment on

    • msg: string

      The message to post

    • Optional percent: number

      The percentage to post with the comment. This can be any integer (even above 100)

    Returns Promise<LoggedInLevelComment>

    The comment that was just created (may not be 100% accurate); null if it failed

rejectFriendRequest

  • Rejects a friend request, deleting it from the server

    async

    Parameters

    Returns Promise<boolean>

    Whether the rejection was succesful

sendFriendRequest

  • Send a friend request to another player

    async

    Parameters

    • id: ConvertibleToAccountID

      The account ID, username, user, or searched user to send a friend request to

    • Default value msg: string = ""

      The message to send with the friend request

    Returns Promise<boolean>

    Whether the friend request sending was successful

sendMessage

  • Sends a message to a friend

    async

    Parameters

    • id: ConvertibleToAccountID

      The account ID, username, user, or searched user to message. Must be a friend of this account.

    • subject: string

      The subject of the message to send

    • body: string

      The body of the message to send

    Returns Promise<boolean>

    Whether sending the message was successful

unblock

  • Unblock a user

    async

    Parameters

    Returns Promise<boolean>

    Whether the unblocking succeeded

unfriend

  • Unfriends another player.

    async

    Parameters

    • id: ConvertibleToAccountID

      The account ID, username, user, or searched user to message. Must be a friend of this account.

    Returns Promise<boolean>

    Whether the unfriending was successful

updateLevelDescription

  • updateLevelDescription(levelID: number, desc: string): Promise<boolean>
  • updateLevelDescription(levelID: SearchedLevel, desc: string): Promise<boolean>
  • Updates a level's description

    Parameters

    • levelID: number

      The level ID to update the description for

    • desc: string

      The new description for the level

    Returns Promise<boolean>

    Whether or not the level description update succeeded

  • Updates a level's description

    Parameters

    • levelID: SearchedLevel

      The level object to update the description for

    • desc: string

      The new description for the level

    Returns Promise<boolean>

    Whether or not the level description update succeeded

Generated using TypeDoc