feat: add HTML template rendering and test notification functionality
Build and Deploy Docker Container / test (push) Successful in 32s
Build and Deploy Docker Container / build-and-deploy (push) Failing after 58s

This commit is contained in:
2026-05-10 12:01:25 +02:00
parent 1dcd80a8bb
commit 6bae1e2f66
4 changed files with 85 additions and 47 deletions
+14 -9
View File
@@ -6,12 +6,8 @@ from pathlib import Path
DEFAULT_TEMPLATES: dict[str, dict] = {
"reminder_halftime": {
"text": "Half-time in 5 minutes!",
"color": 0xE67E22,
},
"halftime": {
"text": "Half-time!",
"420": {
"text": "Blaze it!",
"color": 0x2ECC71,
"image_url": "https://copyparty.allucanget.biz/img/weed.png",
},
@@ -19,11 +15,19 @@ DEFAULT_TEMPLATES: dict[str, dict] = {
"text": "This is your 5 minute reminder to 420!",
"color": 0xE67E22,
},
"420": {
"text": "Blaze it!",
"halftime": {
"text": "Half-time!",
"color": 0x2ECC71,
"image_url": "https://copyparty.allucanget.biz/img/weed.png",
},
"reminder_halftime": {
"text": "Half-time in 5 minutes!",
"color": 0xE67E22,
},
"test": {
"text": "This is a test notification.",
"color": 0x3498DB,
},
}
@@ -73,7 +77,8 @@ def save_templates(path: str | Path, templates: dict) -> None:
p.parent.mkdir(parents=True, exist_ok=True)
tmp = p.with_suffix(p.suffix + ".tmp")
tmp.write_text(json.dumps(normalized, indent=2, sort_keys=True) + "\n", encoding="utf-8")
tmp.write_text(json.dumps(normalized, indent=2,
sort_keys=True) + "\n", encoding="utf-8")
tmp.replace(p)