Represents a doc on Guilded.

Example

new Doc(channel, rawDoc);

Hierarchy

Constructors

  • Parameters

    • channel: DocChannel

      The doc channel the doc belongs to.

    • raw: APIDoc

      The raw data of the doc.

    • Optional cache: boolean

      Whether to cache the doc.

    Returns Doc

Properties

channel: DocChannel
channelId: string

The ID of the channel the doc belongs to.

client: Client
content: string

The content of the doc.

createdAt: Date

The date the doc was created.

createdBy: string

The ID of the user that created the doc.

editedAt?: Date

The date the doc was edited.

editedBy?: string

The ID of the user that edited the doc.

id: number
mentions?: APIMentions

The mentions of the doc.

raw: APIDoc
serverId: string

The ID of the server the doc belongs to.

title: string

The title of the doc.

Accessors

  • get author(): undefined | ServerMember
  • The server member that created the doc.

    Returns undefined | ServerMember

  • get authorId(): string
  • The ID of the user that created the doc.

    Returns string

  • get createdTimestamp(): number
  • The timestamp the doc was created.

    Returns number

  • get editedTimestamp(): undefined | number
  • The timestamp the doc was edited.

    Returns undefined | number

  • get editor(): undefined | ServerMember
  • The server member that edited the doc.

    Returns undefined | ServerMember

  • get isCached(): boolean
  • Whether the doc is cached.

    Returns boolean

  • get server(): undefined | Server
  • The server the doc belongs to.

    Returns undefined | Server

Methods

  • Delete the doc.

    Returns

    The deleted doc.

    Example

    doc.delete();
    

    Returns Promise<Doc>

  • Edit the doc.

    Returns

    The edited doc.

    Example

    doc.edit('New title', 'New content');
    

    Parameters

    • title: string

      The title of the doc.

    • content: string

      The content of the doc.

    Returns Promise<Doc>

  • Fetch the doc.

    Returns

    The fetched doc.

    Example

    doc.fetch();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the doc with.

    Returns Promise<Doc>

  • Fetch the server member that created the doc.

    Returns

    The fetched server member.

    Example

    doc.fetchAuthor();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server member with.

    Returns Promise<ServerMember>

  • Fetch the server member that edited the doc.

    Returns

    The fetched server member.

    Example

    doc.fetchEditor();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server member with.

    Returns Promise<undefined | ServerMember>

  • Fetch the server the doc belongs to.

    Returns

    The fetched server.

    Example

    doc.fetchServer();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server with.

    Returns Promise<Server>