FechtBot: A Discord Bot to manage turn/phase-based tabletop RPG combat online players
View wiki link for bot invite link and other related links:
https://github.com/Glidias/fechtbot/wiki
Ensure you have Heroku CLI installed
- Login to heroku via the CLI
$ heroku login
- Create a new heroku app
$ heroku create
-
Before pushing to heroku, you need to set up the config variables in other words the env variables you would use locally
i. Go to Settings -> Reveal Config Vars
ii. Add the config variables according to the .env.example
iii. These Include
DATABASE_URL TOKEN PREFIX NPM_CONFIG_PRODUCTION (Must be false)
iv. Ensure that you add NPM_CONFIG_PRODUCTION to false to allow installation of dev dependencies for post build to work correctly
-
Commit any changes and push your code from local repo to your git
$ git add -A
$ git commit -m "message here"
$ git push heroku master
- Open the heroku app
$ heroku open
Note: You may also connect your github repo to the heroku and add automatic deployment on push to the github repo
These configuration setups are necessary for the app to function correctly as intended. These configuration setups will be required to be added as environment variables for the server to make use of.
For development you will need a .env file for environmental variables. This includes:
DATABASE_URL=mongodb+srv://username:password@clusterURLEg?retryWrites=true
TOKEN=YOUR_DISCORD_BOT_TOKEN
PREFIX=THE_BOT_COMMAND_PREFIX_USED_TYPICALLY_!
A MongoDB URI is needed to connect to a MongoDB connection. The easiest way to do this is to use Mongo Atlas. If you'd like to do this locally you can follow the instructions at (https://docs.mongodb.com/manual/installation/)
- Select 'Build a New Cluster' and follow the prompts
- When the Cluster has been created, click on 'Connect'
- Choose your connection method, for the purposes of this application we will use 'Connect Your Application'
- Next you will need to grab this connection string (Standard connection string). This is the URI that will be used as an environment variable