Mjpin
Discord bot that generates Midjourney prompts with AI and posts images to Pinterest
Changelog
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog,...
mjpin Discord Bot Documentation
Comprehensive user documentation for the mjpin Discord bot - automated Pinterest pinning and Midjourney prompt generation. What mjpin Does mjpin...
Deployment Configuration
Production deployment patterns using PM2 process manager. PM2 Configuration Configuration file: ecosystem.config.js Purpose: Defines application process configuration Manages environment variables...
Environment Variables
Required and optional environment variables for bot configuration. Required Variables Discord configuration: MJPIN_DISCORD_TOKEN - Bot authentication token from Discord Developer...
Storage Architecture
File-based JSON storage for all persistent data in data/ directory. File Structure Data directory: /data/ Stored files: pinterest_tokens.json - OAuth...
Message Search System
Discord channel history search with keyword filtering and image detection for /pin command. Search Functions Utility module: src/utils/messageSearch.js Core functions:...
Rate Limiting System
Sliding window rate limiting for Pinterest API compliance (100 pins per 12 hours per account). Rate Limit Specification Pinterest API...
Discord.js Integration
Discord bot implementation using discord.js v14 with slash commands and message content access. Bot Configuration Required intents: GatewayIntentBits.Guilds - Guild...
OpenAI API Integration
OpenAI ChatGPT API integration with per-guild model selection and modular prompt system. Model Selection API endpoint: https://api.openai.com/v1/models Model filtering: Bot...
Pinterest API Integration
Pinterest API v5 integration with multi-account OAuth2 support. OAuth2 Authentication Authorization flow: User executes /auth command Bot generates OAuth URL...
Account Management Commands
Commands for Pinterest authentication, board synchronization, and account switching. /auth Generates Pinterest OAuth2 authorization URL for account linking. Parameters: None...
Admin Commands
Administrative commands requiring elevated Discord permissions. /model Configures OpenAI model for server prompt generation. Parameters: None Permission: Requires Manage Server...
Workflow Commands
Core commands for pinning images and generating prompts. /pin Searches channel history for keyword-matching images and pins them to Pinterest...