- add example env

- update readme
This commit is contained in:
Enrico Bühler 2022-09-21 22:59:27 +02:00
parent 447cd322b5
commit eee0f69794
3 changed files with 36 additions and 2 deletions

10
.env.example Normal file
View File

@ -0,0 +1,10 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
DATABASE_URL="file:./dev.db"
DISCORD_TOKEN=
DISCORD_APPLICATION_ID=
DISCORD_CHANNEL_ID=

View File

@ -1,2 +1,28 @@
# discord-bot # discord-bot
## Setup
first install [volta](https://volta.sh/)
(optional) install https://ngrok.com/download for opening db browser remotely
After installing volta and setting up an user for the bot with sudo group
- ```source ~/.bashrc```
- ```volta install node```
- ```volta install yarn```
- ```volta install pm2```
In repo (after setting up .env):
- ```yarn install```
- ```yarn prisma migrate dev```
- ```pm2 start ecosystem.config.js```
## Commands
- Start the application ```yarn start```
- Start dev ```yarn dev```
- Start db browser ```yarn prisma studio```

View File

@ -2,8 +2,6 @@ export default {
discord: { discord: {
applicationId: process.env.DISCORD_APPLICATION_ID || "", applicationId: process.env.DISCORD_APPLICATION_ID || "",
channelId: process.env.DISCORD_CHANNEL_ID || "", channelId: process.env.DISCORD_CHANNEL_ID || "",
guildId: process.env.DISCORD_GUILD_ID || "",
token: process.env.DISCORD_TOKEN || "", token: process.env.DISCORD_TOKEN || "",
secret: process.env.DISCORD_SECRET || "",
}, },
}; };