Skip to content

Commit d90d70c

Browse files
Merge pull request #7 from HackNCState/refactor-config
refactored all configs into env file to avoid merge conflicts
2 parents 7f262ec + 910be0f commit d90d70c

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
DISCORD_BOT_TOKEN=
2+
SHEETS_ID=
3+
SERVICE_ACC_AUTH_PATH=
4+
CHANNEL_ID=

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.env
22

3-
discordannouncementsbot-37dea61d1483.json
3+
src/*.json
44

55
# Logs
66
logs

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ date time type title description location eventTime URL thumbnailURL imageURL
2222
## How to run the bot
2323

2424
1. clone the repo locally
25-
2. edit the `.env.example` file by adding the bot token and renaming it to `.env`
26-
3. create a Google Cloud application and enable the sheets API, download the auth file, and place it in the repo; add this location in the config.
27-
4. edit the `src/config.js` to replace the `sheetsID` and the `announcementsChannelID`
28-
5. in a terminal, run `npm run start` or `npm run dev` (if you're actively developing)
25+
2. create a Google Cloud application and enable the sheets API, download the auth file, and place it in the repo
26+
3. edit the `.env.example` file by adding the bot token and other necessary config data and renaming it to `.env`
27+
4. in a terminal, run `npm run start` or `npm run dev` (if you're actively developing)
2928

3029
---

src/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ require('dotenv').config();
44

55
const config = {
66
discordBotToken: process.env.DISCORD_BOT_TOKEN,
7-
announcementsChannelID: '',
7+
announcementsChannelID: process.env.CHANNEL_ID,
8+
googleAPIKeyFile: process.env.SERVICE_ACC_AUTH_PATH,
9+
sheetsID: process.env.SHEETS_ID,
810
announcementsRoleID: '',
9-
googleAPIKeyFile: '',
10-
sheetsID: '',
1111
};
1212

1313
module.exports = config;

0 commit comments

Comments
 (0)