Skip to content

Add environment variable support and update Docker configuration#5

Merged
ItsAlexIK merged 5 commits intoItsAlexIK:mainfrom
Kf637:main
Jan 2, 2026
Merged

Add environment variable support and update Docker configuration#5
ItsAlexIK merged 5 commits intoItsAlexIK:mainfrom
Kf637:main

Conversation

@Kf637
Copy link
Copy Markdown
Collaborator

@Kf637 Kf637 commented Jan 2, 2026

  • Moved ALLOWED_USER_ID and ALLOWED_ROLE_ID to .env.example for better configuration management.
  • Updated htop.js to read user and role IDs from environment variables.
  • Added Dockerfile for containerization with optimized dependency installation.
  • Created .dockerignore to exclude unnecessary files from the Docker context.

- Moved ALLOWED_USER_ID and ALLOWED_ROLE_ID to .env.example for better configuration management.
- Updated htop.js to read user and role IDs from environment variables.
- Added Dockerfile for containerization with optimized dependency installation.
- Created .dockerignore to exclude unnecessary files from the Docker context.
@ItsAlexIK ItsAlexIK self-assigned this Jan 2, 2026
@Kf637
Copy link
Copy Markdown
Collaborator Author

Kf637 commented Jan 2, 2026

Changelog

All notable changes to this project are documented here.

2026-01-02

Added

  • Containerization support via Dockerfile (node:20-alpine base) and .dockerignore for lean builds.
  • Workflow to auto build and publish Docker image.

Changed

  • htop access control now reads ALLOWED_USER_ID and ALLOWED_ROLE_ID from environment variables to avoid hardcoded IDs.
  • Added console logging for command executions and status message send/update events for better observability.
  • Channel cleanup now keeps deleting in batches until nothing deletable remains, ensuring old status messages are fully cleared.
  • Ready event updated to clientReady to follow discord.js deprecation guidance.
  • Dependencies bumped: discord.js 14.25.1, dotenv 17.2.3, systeminformation 5.28.9.

Fixed

  • Prevented the channel cleanup loop from repeating unnecessarily when no deletable messages are left.

@Kf637 Kf637 marked this pull request as ready for review January 2, 2026 15:57
Copilot AI review requested due to automatic review settings January 2, 2026 15:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds containerization support and improves configuration management for a Discord bot by introducing environment variable support for user and role IDs, updating dependencies, and adding Docker deployment capabilities.

Key changes:

  • Moved hardcoded user and role IDs to environment variables for better configuration management
  • Updated multiple npm dependencies to newer versions
  • Added Docker support with Dockerfile, .dockerignore, and GitHub Actions workflow for automated image publishing

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/commands/htop.js Replaced hardcoded ALLOWED_USER_ID and ALLOWED_ROLE_ID with environment variable reads
.env.example Added new environment variables for user and role IDs (with syntax issues)
package.json Updated discord.js, dotenv, and systeminformation dependencies to newer versions
package-lock.json Corresponding lockfile updates for dependency version changes
Dockerfile New multi-stage Docker image configuration using Node.js 20 Alpine
.dockerignore Excludes unnecessary files from Docker build context
.github/workflows/docker-publish.yml Automated workflow to build and push Docker images to GHCR
index.js Changed event listener from "ready" to "clientReady" and added logging statements
README.md Updated asset paths from ./assets/ to .github/assets/
.github/assets/status.png Moved asset file to new location

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile
Comment thread .dockerignore
Comment thread .github/workflows/docker-publish.yml
Comment thread .env.example Outdated
Comment thread index.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ItsAlexIK
Copy link
Copy Markdown
Owner

ItsAlexIK commented Jan 2, 2026

Thanks for pissing off Copilot

@Kf637
Copy link
Copy Markdown
Collaborator Author

Kf637 commented Jan 2, 2026

Np, always here to piss it off.

@ItsAlexIK ItsAlexIK merged commit 2b96353 into ItsAlexIK:main Jan 2, 2026
@ItsAlexIK ItsAlexIK added enhancement New feature or request documentation Improvements or additions to documentation labels Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants