MarcDonald / twitch-spotify-request-bot

This is a bot that listens to the chat of a given Twitch stream for messages with a Spotify song link in them and then adds that song to a playlist and/or your queue.
https://www.marcdonald.com
MIT License
31 stars 22 forks source link

Replacing variables with environment variables #9

Closed IvanGodinez21 closed 3 years ago

IvanGodinez21 commented 3 years ago

I would like to use .env file, so I edited the code and I think it could be used by other users, and maybe they may like it: This allows to use the program in hosting platforms (Like Heroku).

Now requires the following modules: -dotenv -env-smart

This is just a suggestion, and this might require some changes to work perfectly in hosting platforms

IvanGodinez21 commented 3 years ago

Done, I fixed everything based on your comments @MarcDonald I think... 😅

Also, I recommend you to use a development branch, so you can test it before merging

IvanGodinez21 commented 3 years ago

Sorry I can't merge, only those with write access to this repository can merge pull requests.

Also, I have found that some platforms start the deployment running the "build" script, if you wish to run it without problems, you should change the script section of package.json like this:

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "npm run tsc && node build/index.js",
    "tsc": "tsc",
    "start": "npm run tsc && node build/index.js",
    "start:dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
    "lint": "prettier -c 'src/**/*{.js,.ts}' && prettier -c '*.md'",
    "lint:fix": "prettier --write 'src/**/*{.js,.ts}' && prettier --write '*.md'"
  },
MarcDonald commented 3 years ago

My bad, I'll merge this now and make that change the next time I do a commit. Thanks! 😄