Skip to content

GedasFX/Alderto

Repository files navigation

Alderto

A discord accountant bot with a Web user interface.

Versions:

  • Full version

Harder to set up, has Web user interface.

  • Lite version

    Faster, less setup time, cannot control it thru Web.

Instalation

Requirements: .Net Core 3.0 Runtime, A recent version of PostgreSQL (v11.x works).

Process:

  1. Download latest release;
  2. Extract the folder;
  3. Find appsettings.json file and fill it out (see Configuration file below);
  4. Launch the bot using command dotnet Alderto.Web.dll (dotnet Alderto.Bot.dll for lite version).

Based on the configuration of the machine and appsettings.json, you may have to run it in administrator mode for port allocation (not applicable to lite version). adding sudo in front of the command on Linux would do the trick.

Configuration file

Bot's configuration can be found at appsettings.json file. Tutorial how to set up the configuration:

To get id's for channels and other things, follow this guide from Discord support.

Https

In order to use SSL, you must first have a certificate present on the host device. Big cloud hosting providers, such as AWS of Azure can issue a certificate, otherwise you will have to issue one yourself. Let's encrypt is a project that can help you achieve that.

To activate SSL on Kestrel server, set the environment variable ASPNETCORE_URLS=https://*.

Development

Requirements: Visual Studio 2019 with .Net Core 3.1 SDK, Node.js version 10.9.0 or later (for WebUI only)

Process:

  1. Clone the repository
  2. Launch project in Visual Studio.

There are 2 versions of the bot. Lite and Full. To use lite version, select Alderto.Bot as startup project. For full version select Alderto.Web as startup project.

  1. Set up user secrets with the key c53fe5d3-16e9-400d-a588-4859345371e5. Follow this guide on how to do this. Alternatively you can edit appsettings.json, however be wary that you can leak your private keys in source control.
  2. *[Optional: Full version only] Set up Angular app:
    • Go to folder Alderto.Web/ClientApp;
    • Open command line and type the following commands:
      • npm install, npm start. This will install all required libraries and start the application. Installation is only needed once per update.

        Note: If npm does not work, make sure Node.js is installed properly and npm is bound to the PATH variable.

  3. Build the project.

Misc development quirks

Database migrations are applied on launch of application. To create a migration, use this CLI command in the root Alderto folder: dotnet ef migrations add MIGRATION_NAME --project Alderto.Data --startup-project Alderto.Web