- Full Automation - No manual intervention required.
- State Management - Uses persistent storage to ensure operations resume after restarts.
- Multiple Deployment Options - Supports Windows service, Docker container, and more.
- Sync all followers/following.
- Auto follow user who follow you.
- Auto unfollow user who unfollow you.
- Condition based auto unfollow/follow.
- Email notifications for statistics and exception information.
Warning
β» Do not set the request frequency too high when modifying configurations. Excessive requests may trigger GitHub restrictions (β including potential IP blocking, rate limiting, or account suspension. Proceed with caution!!!).
- Clone the repository.
- Generate a GitHub personal access token with at least the
user:followscope. See: Managing Personal Access Tokens. - Save the token to the
GITHUB_TOKENvariable in the.env.localfile. - Modify other configurations in the
.envfile as needed. - Modify the bot configurations in the
bots.yamlfile as needed.
Modify the DATABASE.URL configuration item in the .env file to support the following databases:
# Install dependencies
rye add pymysqlDATABASE.URL = mysql+pymysql://username:password@localhost/follower_botDATABASE.URL = sqlite:///data/store.dbConfigure the relevant settings in the .env.local file to enable the email notification feature.
# Email configuration
# SMTP server
EMAIL.SMTP_SERVER = smtp.gmail.com
# SMTP port
EMAIL.SMTP_PORT = 587
# SMTP username
EMAIL.SMTP_USERNAME = "username"
# SMTP password
EMAIL.SMTP_PASSWORD = "password"
# Sender email address
EMAIL.SENDER_EMAIL = "[email protected]"
# List of recipient email addresses
EMAIL.RECIPIENT_EMAILS = ["[email protected]"]Note
If using a custom Python environment, update the <executable/> path in follower-bot-service.xml.
# Create a virtual environment and install dependencies
rye sync
# WinSW config reference: https://github.com/winsw/winsw/blob/v3/docs/xml-config-file.md
# Register as a Windows service
follower-bot-service.exe install
# Start the service
follower-bot-service.exe start
# Stop the service
follower-bot-service.exe stop
# Uninstall the service
follower-bot-service.exe uninstall# Build the Docker image
docker build -t follower-bot .
# Run the Docker container
docker run -d --name follower-bot -v "logs:/app/logs" -v "data:/app/data" follower-bot
# Stop the container
docker stop follower-botDebugging in a virtual environment (recommended):
# Install dependencies
rye sync
# Run/Debug the bot
rye run start [-h]Debugging in a local environment:
# Install dependencies
pip install --no-cache -r requirements.lock
# Run/Debug the bot
python -m follower_bot.bot [-h]- Rye: Python environment manager
- WinSW: Windows service manager
- Github API: GitHub API reference
- pydantic: Python data validation
- pydantic-settings: Settings management for Pydantic
- loguru: Python logging library
- loguru-config: Configuration for loguru
- requests: HTTP library for Python
- rate-keeper: API Rate Keeper Decorator
- apscheduler: Task scheduling library for Python
- sqlmodel: SQL and ORM library for Python
- pyyaml: YAML parser and emitter for Python