export async function media(pinnedTweetId, opts = {}) {
  if (!pinnedTweetId) throw new Error("media requires a pinnedTweetId");
  const res = await this.graphql("ImmersiveMedia", {
    variables: {
      pinned_tweet_id: pinnedTweetId,
      page_name: opts.pageName ?? "immersive_video",
      ...opts.variables,
    },
  });
  return res?.data?.immersiveMedia ?? res;
}

export async function profile(pinnedTweetId, opts = {}) {
  if (!pinnedTweetId) throw new Error("profile requires a pinnedTweetId");
  const res = await this.graphql("ImmersiveProfile", {
    variables: { pinned_tweet_id: pinnedTweetId, ...opts.variables },
  });
  return res?.data?.immersiveProfile ?? res;
}
