notify: honor fixed ntfy topic
This commit is contained in:
@@ -9,6 +9,7 @@ from Memory import MemoryManager
|
||||
|
||||
|
||||
ntfyBaseUrl = os.getenv("NTFY_BASE_URL")
|
||||
ntfyFixedTopic = os.getenv("NTFY_TOPIC")
|
||||
ntfyTopicTemplate = os.getenv("NTFY_TOPIC_TEMPLATE", "adhdbot-{userId}")
|
||||
ntfyAuthToken = os.getenv("NTFY_AUTH_TOKEN")
|
||||
|
||||
@@ -76,6 +77,9 @@ class NotificationDispatcher:
|
||||
|
||||
@staticmethod
|
||||
def buildTopic(actualUser: str) -> str:
|
||||
fixed = (ntfyFixedTopic or "").strip()
|
||||
if fixed:
|
||||
return fixed
|
||||
template = ntfyTopicTemplate or ""
|
||||
if not template:
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user