odin-bot-v2 icon indicating copy to clipboard operation
odin-bot-v2 copied to clipboard

Feature: Allow Channel ID's to be overridden via `.env`

Open Asartea opened this issue 6 months ago • 1 comments

Complete the following REQUIRED checkboxes:

  • [x] I have thoroughly read and understand The Odin Project Contributing Guide

  • [x] The title of this issue follows the command name: brief description of request format, e.g. /help: add optional @user parameter

The following checkbox is OPTIONAL:

  • [x] I would like to be assigned this issue to work on it

1. Description of the Feature Request: Currently, all of the channel ID's are stored within config.js. This means that if a contributor want to test some piece of code that depends on a specific ID, the only way to do so in a personal server is to change the value there manually.

The issue with this is that config.js is a git tracked file, which means that if they forget to do undo their change before committing their changes (this is especially dangerous when you are also making an actual config change), or risk breaking production.

I propose specifying all channel ID's instead in the following format

channelNameChannelId: process.env.CHANNEL_NAME_CHANNEL_ID || <actual id>

This allows the ID to be changed by setting the right env variable in .env instead, which is kept only locally and doesn't require the make change, test, remember to undo change, forget, commit, frantically undo change, commit, force push, hope nobody merged the PR cycle.

2. Acceptance Criteria:

  • [ ] All channel ID's are specified in the above format

3. Additional Information:

Asartea avatar Aug 13 '24 20:08 Asartea