mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-12-05 01:10:15 +00:00
Add baseline for sources to available event_data
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user