Add baseline for sources to available event_data

This commit is contained in:
Zedifus
2025-11-16 19:41:31 +00:00
parent 2f7b340a4c
commit 931f42ec37
2 changed files with 11 additions and 3 deletions

View File

@@ -77,13 +77,20 @@ def callback(called_func):
webhook["webhook_type"]
)
# Extract source context from kwargs if present
source_type = kwargs.get("source_type", "unknown")
source_id = kwargs.get("source_id", "")
source_name = kwargs.get("source_name", "")
event_data = {
"server_name": args[0].name,
"server_id": args[0].server_id,
"user": "",
"user_id": "",
"command": command,
"event_type": event_type,
"source_type": source_type,
"source_id": source_id,
"source_name": source_name,
}
# Add time variables to event_data

View File

@@ -79,7 +79,8 @@ class WebhookFactory:
"""
# Common variables for all events
common_vars = [
"server_name", "server_id", "user", "user_id", "event_type",
"server_name", "server_id", "event_type",
"source_type", "source_id", "source_name",
"time_iso", "time_unix", "time_day", "time_month", "time_year", "time_formatted"
]
return {