Skip to content

Commit

Permalink
Feat: Allow overriding channel config via .env file (#584)
Browse files Browse the repository at this point in the history
Co-authored-by: MaoShizhong <[email protected]>
  • Loading branch information
Asartea and MaoShizhong authored Sep 27, 2024
1 parent 1ea1358 commit 539fe3e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
13 changes: 13 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,16 @@ DISCORD_GUILD_ID=xxxxxxx
DISCORD_CLIENT_ID=xxxxx

REDIS_URL=redis://localhost:6379

# Channels
# You can override the ID of any channel specified in the config file by setting it here
# The format is CHANNEL_NAME_CHANNEL_ID=CHANNEL_ID, e.g. INTRODUCTIONS_CHANNEL_ID=123456789
# For keys that accept multiple channel IDs, set the value as a comma-separated list of IDs, e.g. NO_POINTS_CHANNEL_IDs=123456789,987654321
NO_POINTS_CHANNEL_IDs='' # accepts multiple channel IDs
INTRODUCTIONS_CHANNEL_ID=''
GETTING_HIRED_CHANNEL_ID=''
BOT_SPAM_PLAYGROUND_CHANNEL_ID=''
FAQ_CHANNEL_ID=''
WSL_CHANNEL_ID=''
CONTACT_MODERATORS_CHANNEL_ID=''
RULES_CHANNEL_ID=''
22 changes: 14 additions & 8 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ const config = {
clientId: process.env.DISCORD_CLIENT_ID,
token: process.env.DISCORD_API_KEY,
channels: {
noPointsChannelIds: ['513125912070455296', '948409662255026227'],
introductionsChannelId: '690618925494566912',
gettingHiredChannelId: '669547324707569665',
botSpamPlaygroundChannelId: '513125912070455296',
FAQChannelId: '823266307293839401',
WSLChannelId: '1179839248803844117',
ContactModeratorsChannelId: '1059513837197459547',
rulesChannelId: '693244715839127653',
noPointsChannelIds: process.env.NO_POINTS_CHANNEL_IDs
? process.env.NO_POINTS_CHANNEL_IDs.split(',')
: ['513125912070455296', '948409662255026227'],
introductionsChannelId:
process.env.INTRODUCTIONS_CHANNEL_ID || '690618925494566912',
gettingHiredChannelId:
process.env.GETTING_HIRED_CHANNEL_ID || '669547324707569665',
botSpamPlaygroundChannelId:
process.env.BOT_SPAM_PLAYGROUND_CHANNEL_ID || '513125912070455296',
FAQChannelId: process.env.FAQ_CHANNEL_ID || '823266307293839401',
WSLChannelId: process.env.WSL_CHANNEL_ID || '1179839248803844117',
ContactModeratorsChannelId:
process.env.CONTACT_MODERATORS_CHANNEL_ID || '1059513837197459547',
rulesChannelId: process.env.RULES_CHANNEL_ID || '693244715839127653',
},
roles: {
NOBOTRoleId: '783764176178774036',
Expand Down

0 comments on commit 539fe3e

Please sign in to comment.