Source: lib/db/reads.js

  1. import { hasCommentedOnPost } from "./reads";
  2. // TODO: Replace all dream-specific scheme by post-specific scheme
  3. export * from "./posts/reads";
  4. export * from "./users/reads";
  5. export * from "./comments/reads";
  6. export * from "./stars/reads";
  7. export * from "./inbox/reads";
  8. // All methods below this line shouldn't be ported to any package.
  9. /**
  10. * Checks if the AI has commented on a post
  11. *
  12. * @param {string} postId The post id
  13. * @returns {Promise<boolean>}
  14. */
  15. export async function hasAiCommentedOnPost(postId) {
  16. const [hasCommented, legacyHasCommented] = await Promise.all([
  17. hasCommentedOnPost("Sonia", postId),
  18. hasCommentedOnPost("Sonio", postId),
  19. ]);
  20. return hasCommented || legacyHasCommented;
  21. }