Skip to content

Conversation

@konard
Copy link
Owner

@konard konard commented Sep 22, 2025

🤖 AI-Powered Solution for Issue #47

This pull request implements the missing commenting functionality for VK communities, complementing the existing posting capabilities to fully address issue #47.

📋 Issue Reference

Fixes #47 - "A script that will comment or make posts in communities"

🔍 Analysis

While the repository already had functionality for posting to community walls (send-invitation-posts-for-friends.js), it was missing the ability to comment on existing posts. This PR adds that missing functionality.

🚀 Implementation Details

New Trigger: SendCommentsToCommunities

  • File: triggers/send-comments-to-communities.js
  • Frequency: Runs every 45 minutes (integrated with existing trigger system)
  • Integration: Added to index.js alongside other periodic triggers

Key Features

Smart Content Detection: Comments only on posts containing programming-related keywords:

  • программист, программирование, разработка, код, IT, технологии, веб, приложение, сайт

Duplicate Prevention: Checks existing comments to avoid commenting multiple times on the same post

Rate Limiting & Safety:

  • 30-second delays between comments
  • Maximum 2 comments per community per run
  • Only comments on recent posts (within 7 days)
  • Graceful error handling for access restrictions

Community Support:

  • Works with the same community list as the posting functionality
  • Separate message sets for restricted vs regular communities
  • Automatic community disabling on access errors

Message Variety: Multiple comment templates with appropriate tone and content

Technical Implementation

  • Uses VK API wall.getComments to check for existing comments
  • Uses VK API wall.createComment to add new comments
  • Follows existing codebase patterns and error handling
  • Includes comprehensive test coverage

🧪 Testing

  • Added unit tests in __tests__/triggers/send-comments-to-communities.js
  • Tests verify trigger structure and basic functionality
  • Mocked sleep functions to avoid timeouts in test environment

🎯 Result

The bot now has complete functionality for both posting AND commenting in VK communities, fully addressing the requirements of issue #47.


This solution was automatically implemented by the AI issue solver

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #47
@konard konard self-assigned this Sep 22, 2025
Implements automated commenting on relevant posts in VK communities to complement existing posting functionality. This addresses issue #47 which requested "a script that will comment or make posts in communities" - while posting was already implemented, commenting was missing.

Key features:
- Comments on posts containing programming-related keywords (программист, программирование, разработка, IT, etc.)
- Avoids duplicate comments by checking existing comments
- Respects rate limits with appropriate delays between comments
- Handles community restrictions and access errors gracefully
- Limits comments per community to avoid spam (max 2 per run)
- Only comments on recent posts (within 7 days)
- Includes different message sets for restricted vs regular communities
- Integrated with existing trigger system running every 45 minutes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] A script that will comment or make posts in communities Add community commenting functionality to complement existing posting Sep 22, 2025
@konard konard marked this pull request as ready for review September 22, 2025 19:41
@konard
Copy link
Owner Author

konard commented Sep 22, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

📎 Log file uploaded as GitHub Gist (211KB)
🔗 View complete solution draft log


Log automatically attached by solve.mjs with --attach-logs option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A script that will comment or make posts in communities

1 participant