diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e9a46c1 --- /dev/null +++ b/.env.example @@ -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= diff --git a/README.md b/README.md index 00bcbeb..0aff4c9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,28 @@ # 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``` + + diff --git a/src/config.ts b/src/config.ts index 29d1b7a..ac59ae4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -2,8 +2,6 @@ export default { discord: { applicationId: process.env.DISCORD_APPLICATION_ID || "", channelId: process.env.DISCORD_CHANNEL_ID || "", - guildId: process.env.DISCORD_GUILD_ID || "", token: process.env.DISCORD_TOKEN || "", - secret: process.env.DISCORD_SECRET || "", }, };