Function getTopicAndPosts

  • Get a forum topic, as well as its main post (content) and the posts that were sent in it!

    Parameters

    • this: API
    • topic: number | Topic

      An object with the id of the topic in question

    • Optionalconfig: {
          cursor_string?: string;
          first_post?: number | Forum.Post;
          limit?: number;
          sort?: "id_desc" | "id_asc";
      }

      How many results maximum, how to sort them, etc...

      • Optionalcursor_string?: string

        Use a response's cursor_string with the same parameters to get the next "page" of results, so posts in this instance!

      • Optionalfirst_post?: number | Forum.Post

        The id (or the post itself) of the first post to be returned in posts (irrelevant if using a cursor_string)

      • Optionallimit?: number

        How many posts maximum, up to 50

      • Optionalsort?: "id_desc" | "id_asc"

        "id_asc" to have the oldest post at the beginning of the posts array, "id_desc" to have the newest instead

    Returns Promise<{
        cursor_string: string | null;
        posts: Forum.Post[];
        topic: Topic;
    }>

    The oldest post of a topic is the text of a topic