Skip to content

Ascyt/open-qotd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

407 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenQOTD

This project is made using C#, DSharpPlus, PostgreSQL and Docker.

Deployment

To deploy, you will need to have git, .NET, and Docker Compose installed. This should work on any OS, but feel free to let me know if something doesn't work as expected.

  1. Clone the repository and cd into it:
    git clone https://github.com/Ascyt/open-qotd
    cd open-qotd
    
  2. Create a .env-file (in the repo root) and replace the parts in the square brackets with your information:
    POSTGRES_PASSWORD=[choose a secure password for postgres]
    POSTGRES_PORT=[use 5432 if you're not running multiple instances at once]
    OPENQOTD_TOKEN=[your Discord bot's token]
    PGDATA_PATH=[wherever you want your data to be stored]
  3. Start the database:
    docker compose up db -d
    
  4. In Bot/appsettings.json (or Bot/appsettings.defaults.json if it doesn't exist), set the EnableDbMigrationMode flag to true:
    // ...
    "EnableDbMigrationMode": true,
    // ...
  5. Install the .NET migration tool:
    dotnet tool install --global dotnet-ef
    
  6. Run the following to make migrations (and initialize the database tables):
    cd Bot
    dotnet ef migrations add InitialCreate
    dotnet ef database update
    cd ..
    
  7. In Bot/appsettings.json, set the EnableDbMigrationMode back to false:
        // ...
        "EnableDbMigrationMode": false,
        // ...
  8. Stop the database container:
    docker compose down
    
  9. From now on you can start the entire project with the following:
    docker compose up --build -d
    

For testing, it should work to just stop the bot-Container (in Docker Desktop or using CLI) and run the project in VS or something similar.

Contributions

This project is open to contributions! Please note that the code might be a little rough around the edges and is missing documentation, so feel free to ask me personally for help. Feel free to check out the Issues tab for things that need to be implemented!

License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

About

Discord bot that handles Questions Of The Day.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors