refactor: add config.py

this change adds self validation in __init__, allows to make config values with different types (not just string) and stores config values in classes for easier accessibility

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2025-03-26 20:29:44 +03:00
parent 768f9abdcf
commit 5262975275
Signed by: mctaylors
GPG key ID: 4EEF4F949A266EE2
5 changed files with 57 additions and 35 deletions

View file

@ -4,13 +4,13 @@
Token =
; (Optional) URL for "source code" button in /about.
; If not set, button will not appear in "about" menu.
SourceUrl =
SourceUrl = git.mctaylors.ru
[App]
; Application name (e.g. Danbooru).
Name = Danbooru
; Host (without http://) used to access the application API.
Host = danbooru.donmai.us
Host = stashboo.ru
; (Optional) Public host name (without http://) for the “Open in [App.Name]” button.
; Useful if the bot is hosted on the same server as the application.
; If not set, [App.Host] will be used instead.