Skip to content

tigodev1/ProgrammerBot

ProgrammerBot

AI-first Discord bot framework for coding communities.

CI Node.js License: MIT Discord.js

Byteron mascot

Byteron-powered coding support, GitHub automation, and polished Discord updates.

ProgrammerBot combines discord.js, MySQL persistence, Pollinations AI, and GitHub automation into one production-ready bot that can scale across servers.

Stable docs note: this section is kept concise for quick GitHub project-page scanning.

Quick Links

Why This Repo

  • Strong Discord thread support flow for coding communities
  • Built-in GitHub change summaries with visual announcements
  • Clear deployment path for Webdock + PM2 environments
  • Extensible structure for multi-bot or multi-feature growth

What It Does

  • Opens support threads when users mention the bot
  • Keeps per-thread memory and contextual AI replies
  • Reads screenshots + attached scripts for debugging help
  • Sends code back as file attachments when needed
  • Executes live API requests during thread replies for real data validation/testing
  • Announces GitHub PR/issue/commit updates in Discord
  • Generates themed pixel-art update images with Byteron
  • Supports webhook mode for near real-time GitHub announcements

Tech Stack

  • Node.js 20+
  • discord.js v14
  • MySQL (mysql2)
  • Pollinations text + image APIs
  • Sharp image compositing
  • PM2 process management
  • PHP helper scripts for WebSSH operations

Setup (Local)

  1. Copy .env.example to .env
  2. Fill required values
  3. Install + deploy commands
  4. Start runtime
npm install
npm run deploy
npm start

Setup (Webdock / WebSSH)

php /var/www/html/ProgrammerBot/control/install.php
php /var/www/html/ProgrammerBot/control/start.php
php /var/www/html/ProgrammerBot/control/status.php

Core Environment Variables

Required runtime:

  • DISCORD_TOKEN
  • DISCORD_CLIENT_ID
  • MYSQL_HOST
  • MYSQL_PORT
  • MYSQL_DATABASE
  • MYSQL_USER
  • MYSQL_PASSWORD
  • POLLINATIONS_API_KEY
  • POLLINATIONS_TEXT_MODEL
  • POLLINATIONS_IMAGE_MODEL

GitHub announcements:

  • GITHUB_REPO_OWNER
  • GITHUB_REPO_NAME
  • GITHUB_REPO_BRANCH
  • PR_UPDATE_CHANNEL_ID
  • ISSUE_UPDATE_CHANNEL_ID
  • COMMIT_UPDATE_CHANNEL_ID
  • PR_UPDATE_AUTHOR_LOGIN
  • PR_UPDATE_AUTHOR_NAME
  • PR_UPDATE_POLL_INTERVAL_MS
  • PR_UPDATE_MAX_PR_FETCH

Webhook mode:

  • GITHUB_WEBHOOK_ENABLED
  • GITHUB_WEBHOOK_HOST
  • GITHUB_WEBHOOK_PORT
  • GITHUB_WEBHOOK_PATH
  • GITHUB_WEBHOOK_SECRET

AI + memory tuning:

  • POLLINATIONS_TIMEOUT_MS
  • POLLINATIONS_MAX_RETRIES
  • THREAD_MEMORY_MAX_MESSAGES
  • THREAD_CONTEXT_MAX_MESSAGES
  • THREAD_USER_HISTORY_MAX_MESSAGES
  • BOT_PUBLIC_NAME
  • BOT_CREATOR_NAME
  • BOT_CREATOR_PROFILE_URL
  • API_TOOL_TIMEOUT_MS
  • API_TOOL_MAX_RESPONSE_CHARS
  • API_TOOL_ALLOWED_HOSTS

Project Layout

  • src/index.js - Discord runtime entrypoint
  • src/commands/ - slash commands
  • src/services/threadAiService.js - thread AI workflow
  • src/services/attachmentService.js - image/text attachment context
  • src/services/databaseService.js - MySQL schema + persistence
  • src/services/prUpdateService.js - GitHub summary + image announcement pipeline
  • src/services/githubWebhookServer.js - webhook listener
  • control/ - deployment / PM2 helper scripts

Operations

For day-to-day deployment and recovery commands, use CHEATSHEET.md.

License

MIT

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors